Solution: The fix above works. Heres a solution to the above issue with correct locations for batocera
SSH to the machine and execute:
aplay -l
to determine your 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
You may need to try other devices if one does not work for you.
To change the device using nano:
nano ~/.config/retroarch/retroarch.cfg
Use the down arrow to find the below and enter your device between the ""
audio_device = "hw:0,3"
Press "Ctrl X" to save and exit, Press "Y" to accept and Enter to return to commandline.
Launch a emulator to test sound is working, if not try another device. If sound works in Retroarch, then now reboot your machine. On reboot you should now have sound in ES.
Note: if you have messed with the settings in the ES GUI then you may need to change them back to HDMI and check the volume is up.