I see there is another question about HDMI audio on here but I have a permutation of it so I ask my question as well.
I've tried everything to get HDMI audio on my pi400 working properly.
I think it's a pulseaudio / ALSA issue, but I'm on Bullseye and have tried both 32 and 64-bit. (Currently on 64bit). The audio volume indicator does not suggest there is no audio device.
To the interesting bit:
I discovered that if I start firefox-esr first and stream audio from NRK.no and then open (optionally) Pavucontrol GUI - the audio works and it doesn't stop (This does not happen with Chromium or just Pavucontrol).
So if I then launch Amiberry (amigaemulator) there is audio - but as soon as I close firefox (and / or pavucontrol) the audio is gone!
There is audio playing in the mixers at any time there is audio playing, but it's SILENT to the monitor! I just don't understand why!
I hope I have not asked in a formally wrong way. If so I will accept moderation.
EDIT: the HDMI monitor is a Samsung two input computer monitor 32" curved.
A further development is that looking at https://forums.raspberrypi.com/viewtopic.php?p=2048530&sid=da4fc9de3ec64d13d1bd263cc9f71b4f#p2048530
Yields sound !
Adding this in config.txt
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
dtparam=audio=on
and this in cmdline.txt
snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=0
Best regards Dag / Norway