13

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?

4

4 Answers 4

3
+50

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

2
  • Very cool. Looking forward to it!
    – Oli
    Sep 7, 2011 at 13:28
  • I don't want to wait, and I was hoping not to upgrade to 11.10..! :O looks like I will be, then.
    – Dang Khoa
    Sep 7, 2011 at 19:13
3

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...

1

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.

-1

There is a tool in the ubuntu repositories, padevchooser, which claims to let you change the output on the fly. I tried this and it doesn't really work for me (trying to switch output between built-in sound card and external USB music centre). The tool only lets me select "Default" and "Other..." instead of listing my two output options.

You might, however, want to have a look at this blog post describing how to write a script to change the output device to HDMI. I don't know of a way to run this automatically, but at least it's only one click, so you can bind it to an unused button on your laptop.

1
  • 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. Sep 3, 2011 at 3:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .