The issue persists even in the latest version of the Ubuntu flavored OS for the Pi, 22.04.
It reduces cable clutter and also the need for additional external speakers.
First up, you better peek if HDMI audio is working alright, by selecting it manually.
For that, you should probably find the unit name first.
Identify the HDMI Audio unit
The commandpactlcan control a running PulseAudio sound server.
A source is the input unit, and a sink is the output unit.
List all the available audio output devices on the Raspberry Pi:
Note down the gear withHDMIin the name.
Configure to Make HDMI the Default Audio gear
Search forStartupApplications Preferencesand open it.
ClickAdd Startup Programand fill in these details:
ClickAdd.