Auto-switch audio to HDMI when HDMI monitor/receiver plugged into laptop

17,548

Solution 1

In Ubuntu 11.10 pulseaudio will recognize when you plug hdmi (or phone jack) and will make the switch automatically.

See this:

http://voices.canonical.com/david.henningsson/?p=15

Solution 2

I had the same problem but its easy to fix in kubuntu...go to system settings, screen and you will find both your internal and hdmi screen...choose your settings and in the bottom choose hdmi as your default output and save your profile at the bottom...every time you log into kde it will use your hdmi screen as default and your sound output will be auto set by phonon...

Solution 3

In ubuntu 11.10, automatic switching still does not work. Apparently the features are not implemented yet. I am using a script to switch the sound card profile to HDMI and back.

pacmd "set-card-profile output:hdmi-stereo-extra1"

Assigned a short-cut key, life is now better. Read more about it here.

Share:
17,548

Related videos on Youtube

Oli
Author by

Oli

Hi, I'm Oli and I'm a "full-stack" web-dev-op. Eurgh. I'm also allergic to jargon BS. I spend most of my professional time writing Django websites and webapps for SMEs. I write a lot of Python outside of Django sites too. I administer various Linux servers for various tasks. I contribute to the open source projects that I use when I can. I'm a full-time Linux user and that has lead to helping other people live the dream. I am an official Ubuntu Member and I earnt my ♦ on SE's own Ask Ubuntu in 2011's moderator election. That's probably where I spend most of my unpaid time. I also run thepcspy.com which has been my place to write for the last decade or so. If you need to contact me for extended help, you can do so via my website, just remember that I have bills so if I feel your request is above and beyond normal duty, I might ask for remuneration for one-on-one support. For more social contact, you can usually find me (or just my computer) lurking in the Ask Ubuntu General Chat Room and on Freenode in #ubuntu and #ubuntu-uk under the handle Oli or Oli``.

Updated on September 18, 2022

Comments

  • Oli
    Oli over 1 year

    I have a laptop with an HDMI port. While we're homeless and staying with friends I've been plugging it into their surround sound receiver with an HDMI cable. To get sound working I have to open up the sound settings jobby and switch the hardware profile from "Analogue Stereo Output" to "Digital Stereo (HDMI) Output" to have sound coming from the surround sound instead of the laptop's mincey speakers.

    I have to do the reverse when I unplug it to get sound coming out of the speakers.

    I'm getting a little bored of doing this. I'd like to script this. I have seen this question and its answer but pacmd list-sinks only shows one sink when the sound profile drop down shows several options.

    And is there a udev event I could hook this into so it can run the script whenever the HDMI status changes?

  • Jo-Erlend Schinstad
    Jo-Erlend Schinstad over 12 years
    It's very easy to switch too another output device in Ubuntu. You click the sound indicator and select the audio preferences item. You then select output devices and choose which one you want. But he wanted it to be automatic. Your answer didn't really match. -1.
  • Oli
    Oli over 12 years
    Very cool. Looking forward to it!
  • A. Rabus
    A. Rabus over 12 years
    I don't want to wait, and I was hoping not to upgrade to 11.10..! :O looks like I will be, then.