4

I'm running Ubuntu 18.04 on a Gigabyte 78LMT-USB3 (gen 6) motherboard. Using HDMI audio via my graphics card is not working at all. Sound via headphones is working fine.

Here is my alsa report: http://www.alsa-project.org/db/?f=317bebb3e63a8726494c1637432903834c7c128c

Any ideas why I can't get any audio via my graphics card?

3
  • Something like a nVidia GTX 970M to a GTX 1060? – WinEunuuchs2Unix May 6 '18 at 18:04
  • No its an AMD Radeon HD 7870 graphics card. I'm plugged into the HDMI port on it. Got display all fine just no audio, audio works via headphones though – Jamesking56 May 6 '18 at 18:47
  • Good to know as I have nVidia which has different solutions. – WinEunuuchs2Unix May 6 '18 at 18:59
1

You may need to add kernel parameters to /etc/default/grub.

sudo nano /etc/default/grub

Look for GRUB_CMDLINE_LINUX_DEFAULT and add amdgpu.dc=1 (or, if it doesn't work, radeon.audio=1). Then update grub and reboot:

sudo update-grub

Then look at the last tab in pavucontrol for a profile that includes HDMI output.

7
  • It says that they are all unplugged – Jamesking56 May 6 '18 at 17:41
  • I assume you've checked cables and made sure all devices are turned on? ... try running pulseaudio -k ; sleep 1 ; if ! pgrep pulseaudio ; then pulseaudio -D ; fi ... then try pavucontrol again? – xiota May 6 '18 at 17:58
  • Cables are fine, your command showed a couple of numbers but pavucontrol still shows all HDMI stereo unplugged – Jamesking56 May 6 '18 at 18:42
  • didn't use Ubuntu, 18.04 is first version – Jamesking56 May 6 '18 at 21:02
  • What happens if you select HDMI anyway, even though it says unplugged? – xiota May 6 '18 at 21:08
1

My HDMI Audio (AMD HD 4850) has disappeared after installing new kernel on Ubuntu 18.10. Restart system with previous kernel version helped to solve the issue:

  • kernel 4.18.0-21-generic: HDMI Audio is not working
  • kernel 4.18.0-20-generic: HDMI Audio is working

All Kernels starting from 4.15.0-51, 4.18.0-21 and 5.0.0-16 are affected.

See details in this bug (comment #27): https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1834771

1

For those who just want HDMI audio to work (without reverting to the older kernel), this is a quick fix.

Applies to many AMD devices, Ex. mine is "RS880 HDMI Audio [Radeon HD 4200 Series]."

Paste in terminal:

mkdir -p $HOME/bin
echo '#!/bin/bash

# Temporary workaround to restore HDMI audio until kernel is fixed
#       ref. https://askubuntu.com/a/1207919/165265
#
a=$(aplay -l | grep HDMI)
c=${a#*card }; card=${c:0:1}
d=${a%:*}; dev=${d: -1}

s=$(pacmd stat | grep sink)
[[ ${s: -4} == _${card}_${dev} ]] || {
pulseaudio --kill
rm $HOME/.config/pulse/*
wait
pulseaudio --start
pacmd load-module module-alsa-sink device=hw:$card,$dev
pacmd set-default-sink alsa_output.hw_${card}_${dev}
pacmd set-sink-volume alsa_output.hw_${card}_${dev} 35000
}
exit 0
' > $HOME/bin/fixHDMIaudio
chmod +x $HOME/bin/fixHDMIaudio
echo
cat $HOME/bin/fixHDMIaudio

The program checks whether HDMI audio is selected and if not, tries to activate it. Nothing is done if HDMI audio is already in use.

$HOME/bin/fixHDMIaudio can be added to Startup Applications or run from a launcher. Since all attempts at calling from /etc/pm/sleep.d to auto-restore after suspend or hibernate have failed, a launcher is handy.

Sometimes HDMI audio will refuse to activate without an audio stream playing.

On first run, it may be necessary to select HDMI Audio on the Output Devices tab of Pulse Audio Volume Control (sudo apt install pavucontrol). The Configuration tab will likely continue to show the HDMI port as 'unplugged'. That's related to the bug this workaround exists for (!) and can be ignored.

Volume is set at 70% (35000); edit as desired.

Credit and thanks to bassmanitram on github and others on launchpad and here.

2
  • on ubuntu 20.04, this made "HD-Audio Generic" appear in the sound settings, and on "test sound" pavucontrol does show some output there, but still no sound out of the speakers. This was about my tenth hack attempting to fix this, so I decided to test the monitor speakers, if they work at all. Connected it to a Macbook and everything got recognized and worked immediately -- no further comments... – xealits Dec 21 '20 at 20:05
  • @xealits, with sound settings not open, after running the program (in terminal or by shortcut), did u try then opening sound settings? This is a squirrely bug that sometimes just takes that odd click. Also running u20.04 and find I still need to use this, but much less often than w/ 18.04. You might also try pasting the first three lines and verify the correct values are being used. There's almost no way for this not to work since it forces pulse to use the correct source/sink. – u2n Dec 23 '20 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.