[Suggestion] S/PDIF keepalive
I've been experimenting with sound bars (a Bomaker Tapio 1 and a Samsung HW-T400) attached by optical S/PDIF as the machine's primary speakers. One thing I've noticed is that these devices seem quite keen to power down some of their internals as soon as the S/PDIF stream stops. The effects of this show up when the stream restarts:
- The Bomaker emits a soft click before the desired audio.
- The Samsung takes a fraction of a second to resume, chopping off the start of the desired audio. This is audible when changing tracks in Rhythmbox or Lollypop, and means short system alert sounds (i.e 'Drip') are never heard.
- Happens on all sound cards I've tried with an optical out (ALC892, ALC293, USB TI-PCM2704C). Not related to any
power_save
module option or auto-mute mixer settings.
Of course this isn't particular to PipeWire or Linux -- I can get similar behaviour on macOS (although it seems to have a longer timeout before stopping the output). This has also been observed on Windows with different hardware, for which someone wrote a keepalive tool [1]; in a similar vein, I find if I have a totally silent FLAC file playing in the background the sound bars stay awake and there are no audio delays.
So while not a PipeWire bug, maybe it's something that the sound server could resolve as an optional module that behaves like a silent stream, active whenever an S/PDIF output is selected as the output device (sample rate choice being beyond the scope of this mere sketch). In the meantime I can work around this using the sound bars' analogue inputs.