http://bugzilla.suse.com/show_bug.cgi?id=916048
--- Comment #14 from Troels Just
The feature should be already there, IIRC. However, whether it actually works depends on the hardware; some Intel onboard graphics have a fragile HDMI/DP audio notification (it's rather a hardware bug), and might not work always reliably. In the kernel side, the audio device for HDMI/DP is always present no matter whether it's plugged or not. If pavucontrol shows the HDMI device (plugged) or (unplugged) properly, the switching should work as is.
pavucontrol does indeed indicate the status of the HDMI audio connection, however no automatic switching takes place at all. I checked in /sys/class/drm/card0/card0HDMI-A-1/status, and it consistently, and reliable indicates whether HDMI is plugged in or not. This is the case both on my T420 and my X230. I looked around a bit, and I found some tricks where a udev rule invokes a script that then switches PulseAudio's output depending on the status of HDMI connectivity in /sys. I tried it, and it does seem to work with one problem. udev does not invoke the script when I plug the cable in (Despite /sys indicating the status correctly), so I invoke the script manually and it works. When I disconnect the cable, udev notices without a problem, script is invoked, and sound is returned to the laptop speakers. Here's a thought, could it be that udev not noticing the plugging in of HDMI, and PulseAudio, on its own, not doing any switching are somehow connected? -- You are receiving this mail because: You are on the CC list for the bug.