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.