I see some folks on here having kind of the opposite problem to me.
My desktop setup: A Pi 4 4GB, Ubuntu Mate 20.04 64 bit, 1 Dell HDMI monitor, 1 Dell DVI monitor. The monitors are variants of the same model, nearly identical. The HDMI monitor has a 3.5mm audio jack for audio passthrough via HDMI which has a bad habit of clipping the beginning of an audio stream, so I don't want to use it.
I CANNOT for the life of me get audio to come out of the 3.5mm jack with the HDMI monitor plugged in. With only the DVI monitor plugged in, it works. But if the HDMI monitor is attached to either HDMI socket, it will absolutely refuse to pipe audio out the built-in jack.
The Sound Preferences Dialog isn't much help. What does the "hardware" tab accomplish? I see three things listed as "Built-in Audio 1 Output/1 Input Stereo Output" I don't seem to be able to interact with them in any way. There's an Output tab that gives me radio buttons, again for the same three "Built-In Audio Stereo" options. The bottom-most one lets me play audio through the HDMI passthrough. No idea what the other one is, unless it thinks it can pipe audio to the DVI monitor.
There doesn't seem to be a way to set it to default to any of these on boot; using the HDMI passthrough every time the Pi boots I have to open the Sound Preferences menu and figure out which option to use. And if I don't do this, if I leave it on...whichever of the three identically labeled options it gives me...Youtube videos refuse to begin playing. I get the swirling loading whirlygig forever. The instant I select one of the other audio outputs, the video starts playing. If I select the first one again, the video hangs up.
sudo amixer cset umid=3 1
amixer: Cannot find the given element from control default