Context: Debian/testing on a ASRock B450 with Ryzen 2200G, HDMI monitor.
I can set the default audio sink either via /etc/pulse/default.pa or manually with this command: pacmd set-default-sink alsa_output.pci-0000_38_00.1.hdmi-stereo-extra1
However, once the monitor enters standby mode, the default gets reset to the internal HDaudio card and the volume applet is no longer tracking the HDMI volume, rather the internal audio card feeding the headphone and back panel jacks. I assume this happens because the HDMI "card" gets unplugged but I'm not sure.
I also tried the suggestion in this other question but it didn't work. Most questions seems to be about setting pulseaudio defaults but this doesn't work: the audio is still routed correctly to the HDMI monitor, it's just the applet which is tracking the wrong volume. If I reset the default card with the command above, it goes back to showing the proper volume until the next standby.
How do I fix this? Basically, I need to run "pacmd set-default-sink" right after the hdmi sink becomes available again.
New info on sinks
- before standby: card 0 is hdmi, card 1 is internal; card 0 is default and available, card 1 is also available but not default (link to details: https://paste.scratchbook.ch/view/83c0e9a5)
- during standby: hdmi becomes unavailable, internal card is marked default (link to details: https://paste.scratchbook.ch/view/9e9ae422)
- after standby: hdmi is again available, internal card is still default (link to details: https://paste.scratchbook.ch/view/9be5801a)
After interrupting standby, I started a new player and I can confirm the music comes from the hdmi monitor, yet the applet shows a crossed-out speaker.
pacmd list-sinks
at the state of the HDMI sync in normal/standby mode, and the difference.pacmd
output. In theory, it should be possible to hook into Pulseaudio and reset the default sink to HDMI as soon as it becomes available again (basically a "permanent preferred default sink list"), but I'm not sure how to configure that; possibly one has to dig into the source code and change it a bit. Not sure what to recommend here. Can you program in C?pacmd list-sinks
before, during and after standby, put output in a pastebin etc., edit question with link, ping me in comments. If I see something, I can quote the relevant part in an answer, so it's not lost when the pastebin expires. Bug reports should contain all necessary info in whatever way the devs require (e.g. attachments). I very much doubt udev/hotplug is relevant; even if it was, you'd have a race-condition, because the pulseaudio demon also reacts on those (or actions triggered by those).