Do a fresh new install of batocera.
After first boot, start Kodi.
In Kodi go to System, System settings, Audio, Audio output device and then you should see something like "HDA xxx PCH 'your TV/Monitor name' on HDMI #0 (or 1, 2)"
Choose the appropriate output device and test within kodi, if sound works (just start a youtube video or FilmOn addon).
Then exit kodi and go to ES Menu, Sound Settings and choose the same output device (for example HDMI #1), then exit the Settings and start a game. You should now have sound.