I had the same problems using a USB sound card.

It worked everywhere except in advmame

I fixed this on two different retropi images using this process:

edit the advmame.rc

delete these lines:

device_alsa_device default
device_alsa_mixer channel
device_sound alsa

After that it magically started working :)