After replacing the USB audio device in a GroovyArcade system, several games running on GroovyMAME stopped producing audio, while others continued working normally.
The issue initially appeared to be related to:
- ALSA
- SDL audio backend
- GroovyMAME timing
- USB audio compatibility
- syncaudio / syncrefresh
- low latency audio
However, the root cause was eventually identified as stale per-game audio mappings stored in MAME configuration files.
- OS: GroovyArcade (old installation)
- Emulator: GroovyMAME 0.279
- Audio backend: ALSA via SDL
- Audio device:
- Old:
USB PnP Sound Device, USB Audio - New:
AB13X USB Audio, USB Audio
- Old:
- Arcade cabinet with mono speaker setup
- Some games had audio
- Some games had no audio
aplayworked correctly- ALSA device detected correctly
- GroovyMAME logs showed:
Audio: Driver is alsa
- No explicit audio errors appeared in logs
/proc/asound/card0/pcm0p/sub0/statusremained:closed
This indicated that playback was never opened for affected games.
aplay -D default /usr/share/sounds/alsa/Front_Center.wavResult:
- Audio worked correctly
Relevant settings:
sound sdl
audiodriver alsa
samplerate 48000
syncaudio 1
audio_latency 2No obvious issues detected.
The system used a custom mono downmix configuration for the arcade cabinet:
pcm.dmix_mono {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
channels 2
}
}
pcm.mono {
type route
slave.pcm "dmix_mono"
ttable {
0.0 1
1.0 1
0.1 1
1.1 1
}
}
pcm.!default {
type plug
slave.pcm "mono"
}
Although somewhat fragile for low-latency GroovyMAME setups, this was NOT the main cause of the issue.
The real problem was found inside the per-game MAME .cfg files.
Working games contained:
<sound_map tag=":mono">
<node_mapping node="o:AB13X USB Audio, USB Audio" db="0.000000" />
</sound_map>Broken games contained either:
<sound_map tag=":mono" />or mappings to the OLD device:
<node_mapping node="o:USB PnP Sound Device, USB Audio" db="0.000000" />MAME stores mixer/audio routing persistently per game.
When:
- audio devices are changed
- USB DACs are replaced
- ALSA device names change
the stored node_mapping becomes invalid.
MAME does not automatically invalidate or regenerate these mappings.
As a result:
- games may silently lose audio
- no obvious ALSA errors appear
- playback device is never opened
The issue would likely NOT have occurred if the replacement USB audio device exposed the exact same device name as the previous one.
MAME stores audio routing using literal device strings such as:
node="o:USB PnP Sound Device, USB Audio"Changing the device name invalidated the stored mappings.
Mass replacement was performed:
find ~/.mame/cfg -type f -name "*.cfg" \
-exec sed -i 's|node="o:[^"]*"|node="o:AB13X USB Audio, USB Audio"|g' {} \;find ~/.mame/cfg -type f -name "*.cfg" -exec sh -c '
grep -q "<sound_map" "$1" && ! grep -q "node_mapping" "$1" && echo "$1"
' _ {} \;find ~/.mame/cfg -type f -name "*.cfg" \
-exec grep -l '<sound_map[^>]*/>' {} \;These files required deletion or regeneration.
The original .asoundrc worked but was overly complex for GroovyMAME.
A simpler route-based mono configuration is recommended instead of:
dmix- multiple ALSA plugin layers
- software mixing chains
The issue was NOT caused by:
- ALSA failure
- SDL incompatibility
- USB audio timing
- GroovyMAME bugs
- syncaudio settings
The actual cause was:
- persistent per-game MAME audio routing
- stale
node_mappingentries - invalid audio device names after USB audio replacement