Categories:

Getting Audio over HDMI to work on Ubuntu

Posted 20111114. Last Updated 20111114.

I have a media computer, which I use HDMI for video and audio, and it usually takes me a few google searches to figure this out, so here it is, in one nice blog entry. FYI, this is an nVidia video card with HDMI.

To get audio working over HDMI, I had to put an entry into /etc/pulse/default.pa:
load-module module-alsa-sink device=hw:0,7

The only two parameters that I had to know where the 0 and 7.

To figure these out, type: aplay -l. You will see an output like this:
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0

The 0, in the line entry, comes from the output, where it says card 0. This is the device where my HDMI audio is. 7 comes from the output where it says device 7. I do not know a whole lot about the inner workings of this device, but I found 7 by randomly testing one of the four logical devices at a time.

To test this configuration, either restart, or you can kill pulse audio, and restart it by typing:
pulseaudio -k
pulseaudio

Thats all I had to do. Good luck!