[pulseaudio-discuss] Auto-switching to and from HDMI ports (audio)

David Henningsson david.henningsson at canonical.com
Thu Mar 15 18:48:14 PDT 2012


I'm not exactly sure who I should send this to, so maybe I'm a little 
too inclusive here. Anyway.

The use case here is that your laptop speakers are active (or at least 
currently selected) and you plug an HDMI [1] cable in and activate the 
Should we, or should we not, automatically change the audio output to be 
to the HDMI output?
And likewise, when the cable is unplugged / the HDMI screen deactivated, 
should we, or should we not, change the audio output back to the speakers?

So there's a design decision that needs to be made, and probably quite 
quickly if it should go into PulseAudio 2.0 and/or Ubuntu 12.04.

The current behaviour is inconsistent, e g I've got bugs filed for 
Ubuntu 11.10 for machines that switch to HDMI on plug but not from HDMI 
on unplug.

To complicate matters, and to go a little bit into the technical stuff, 
the HDMI output is sometimes a separate card, and sometimes on the same 
card as the analog outputs. When I originally wrote 
module-switch-on-port-available, I admit not having thought thoroughly 
about switching between HDMI and analog outputs.

As I see it we have a couple of options.

  * no auto switching between HDMI and analog outputs at all. This is 
probably the simplest option. But maybe this is not the most user 
friendly option?

  * full switching. This requires not only profile switching on plug and 
unplug, but also switching between cards, i e moving streams between 
cards, and updating the default sink. More work, but definitely doable. 
I get the feeling that we want to avoid updating the default sink when 
it's not a direct user action though?

  * switching only if the HDMI outputs are on the same card as the 
analog output. This is also simple to achieve, but might be confusing 
for users and support engineers?

  * switching from HDMI but never to HDMI: assuming we're not certain 
that the user wants to use HDMI audio just because (s)he plugged it in, 
we could quite safely assume that (s)he does not want to use an 
unplugged HDMI cable. However, if we want to do this consistently, we 
still suffer from having to set the default sink.

What do you think?

David Henningsson, Canonical Ltd.

[1] The exact same applies to DisplayPort. Seen from userspace, 
DisplayPort and HDMI appears in the same way. I've just written HDMI 
everywhere for simplicity.

More information about the pulseaudio-discuss mailing list