No sound on HDMI Ubuntu 20.04
Solution 1:
After upgrading from Ubuntu 18.04 to 20.04, I noticed that pulseaudio would no longer detect HDMI audio output (plugged to an nVidia graphics card) when turning my TV on after I logged in. HDMI output is just not listed anymore in sound settings. This used to work in 18.04.
I found a workaround was to open a console and type the following command, after turning the TV on:
pulseaudio -k
Solution 2:
I am using Mint 20.1 with Xfce, and this solved it for me:
- Open the audio mixer (it's called
pavucontrol
here) - Switch to the Configuration tab (rightmost tab),
- There is a dropdown for selecting the profile for the builtin audio device.
- Here I could select a HDMI profile, just be careful to pick one that is not marked as not available.
- After that, audio through HDMI worked just fine.
I realize this is not quite Ubuntu, but close enough that I thought something like this should be possible on Ubuntu also.
Solution 3:
I see at least three possible reasons:
- your sound devices may be muted by default - run
alsamixer
and make sure all sound devices are unmuted. I assume you've done that since it's mentioned in one of the links you posted. - You may have to set a default 'sink' for sound output. Here is one post that helped me in the past with Xfce. One thing you can try is play sound to designated output eg
aplay -D plughw:0,1 /usr/share/sounds/alsa/Noise.wav
- try all possible combinations based on the output ofaplay -l
eg 1,3 or 1,7 etc -
Linux kernel issue. On a recent installation of Arch Linux I found out that HDMI audio was not working due to a regression in the Linux kernel. The bug is documented here: Bug 207223 - linux-5.6.x breaks NVidia HDMI audio. The fix was either to revert to a kernel <= 5.6 (version 2020-04-01), or use an LTS Kernel (which I did) and that solved the issue for me. Check the output of
uname -r
to verify your kernel version.
Additional steps you can do:
- You mentioned using a laptop, so I take that it that disabling the onboard sound card on your motherboard is not an option for you (presumably you will not always be using an external HDMI display). This may not solve your issue but would remove one unnecessary device on a desktop PC (it could be the default device at present).
- Something else: since you have an NVIDIA device you can choose between the proprietary driver from Nvidia or the open-source version (nouveau) and there is also Optimus, that I am not familiar with. Verify which one you are using. If all attempts fail you could try the other driver. But from experience nouveau should be perfectly capable unless maybe you have very recent hardware that is not yet Linux-supported.
I also recommend the Arch Linux wiki: Advanced Linux Sound Architecture. It helped me a lot debug my sound issues back in the day.