Not sure which version of RetroPie are you using (version 4.4 is too old to support the PI4), but out of the box I think HDMI sound should work using the 4.7.1 image.
Make sure that in the Audio settings in the RetroPie system you choose HDMI as output, then in ES the settings should be:
AUDIO CARD: Default
AUDIO DEVICE: HDMI
For OMX audio output, just use ALSA and it should work.