I'm using Ubuntu 20.04.
After I upgraded from 18.04 my HDMI audio output stopped being recognized. After tried tons of methods to fix this (https://help.ubuntu.com/community/SoundTroubleshootingProcedure) the only thing that worked is doing after restart:
sudo killall pulseaudio; pulseaudio -k; pulseaudio --start
By doing that the HDMI output start working.