Though if you are now running a fully updated Raspberry Pi Operating System, though ALSA is the base kernel audio, these days PulseAudio Sound Server which sits atop ALSA is used for controlling all Audio I/O:
https://www.raspberrypi.org/blog/new-ra ... mber-2020/
PulseAudio has a Configuration Mixer which gives more control:
sudo apt-get install pulseaudio pavucontrol pulseaudio-utils
pacmd list-sinks
# pacmd set-default-sink <name_of_hdmi_sink>
pacmd set-default-sink 0
Consider commenting out lines in /boot/config.txt that mention hdmi and force
Consider adding a config to retroarch.cfg to force it to prefer pulse-audio and the named device or index you picked.
echo 'audio_driver = "pulse"
audio_device = "0"' >> ~/.config/retroarch/retroarch.cfg
This is a great way to see which audio elements there are and which are connnected.
This gives a scripting way to force or use a particular audio device.
https://www.raspberrypi.org/documentation/configuration/audio-config.md
Changing the source here makes a big difference
sudo rasp-config
# Advanced Settings > Audio > Source