Ubuntu – Ubuntu 16.04 HDMI Audio Not working, speaker-test works


I'm running kubuntu 16.04

I'm trying to get audio working through HDMI. I believe that I have to set the default card and device, but can not find how. I have check/tried:

  1. I have check to make sure that the speaker are not muted using alsamixer.
  2. In System Settings->Multimedia the default playback is set to "GF119 HDMI Controller Digital Stereo (HDMI)"
  3. aplay -l shows output of:
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC887-VD Digital [ALC887-VD Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
  1. speaker-test -c 2 -r 48000 -D hw:1,7 produces white noise.
  2. lspci -nn | grep '[04[80][13]]' produces:
00:14.2 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) [1002:4383] (rev 40)
01:00.1 Audio device [0403]: NVIDIA Corporation GF119 HDMI Audio Controller [10de:0e08] (rev a1)
  1. Purging and reinstalling pulse-audio and alsa-base.

I'm not sure what else to add to be helpful.

Best Answer

Here is how I got things working in case anyone else want to know. It may save you some time.

The problem seemed to be that pulse audio was send sound to card 1 device 3 which produced no sound with sound-test command. I needed to switch it to card 1 device 7, which did produce sound with sound-test.

I added two lines to the file /etc/pulse/default.pa

load-module module-alsa-sink device=hw:1,7
set-default-sink output 2

The hw:1,7 corresponds to the "card 1" and "device 7" shown for the device in the output of the "aplay -l". This was the card and device that played sound from sound-test. Number for the default sink is the index of the device shown by "pacmd list-sinks"

I also had to turn off the device corresponding the hw:1,3 using pavucontrol.

Also helpful was the site PulseAudio/Examples, in particular the section on HDMI output configuration.

Related Question