The room that prompted this had a television on HDMI with working PCM audio and nothing in the analog jack, and WirePlumber chose analog. A teacher who corrected it by hand then had to restart the browser before any sound came out. The policy is a pure function so it can be tested against that room rather than against a machine: an unavailable port is not a candidate, an analog port merely existing is not evidence of a cable, and an explicit AUDIO_OUTPUT overrides the lot. Twelve cases, the real room among them. The daemon follows PipeWire's own event stream rather than polling, and moves streams that are already playing, which is the part that stops a teacher having to close and reopen the browser. Co-Authored-By: Claude Opus 5 <[email protected]>
18 lines
510 B
Desktop File
18 lines
510 B
Desktop File
[Unit]
|
|
Description=Ekklesia Classroom audio output policy
|
|
Documentation=file:///usr/local/bin/classroom-audio
|
|
After=pipewire.service wireplumber.service
|
|
Wants=pipewire.service wireplumber.service
|
|
PartOf=graphical-session.target
|
|
|
|
[Service]
|
|
ExecStart=/usr/local/bin/classroom-audio
|
|
# The room losing its sound policy is a Sunday-morning problem, so this is
|
|
# never allowed to stay dead — the same rule the panel gets.
|
|
Restart=always
|
|
RestartSec=5
|
|
Slice=session.slice
|
|
|
|
[Install]
|
|
WantedBy=plasma-workspace.target
|