Ssh to the machine and execute:
aplay -l
to determine you audio device. The output will look similar to this:
* List of PLAYBACK Hardware Devices *
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC283 Analog [ALC283 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
Note the card# and device#, for my HDMI out, the first device has card 0 and device 3, my configuration setting will be:
hw:0,3
Try other devices if one does not work for you.
Enter that into Settings->Audio->Audio device in the GUI
or in the ~/retroarch/default/config/retroarch.cfg file:
audio_device = "hw:0,3"