Pi5 lr-mame audio unknown error 524

I just updated my cabinet to the latest Pi5 image with linux Denian Trixie baseline and the latest build from source of lr-mame. If I run standalone mame, the audio is fine but from EmulationStation/RetroArch when I launch with lr-mame core, there’s no audio and I get this error:

AudioManager Error - Unable to open SDL audio: ALSA: Couldn’t open audio device: Unknown error 524

I tried all variations listed in RA for audio drivers (ALSA, ALSATHREAD, SDL) and none work. ChatGPT says: this is a **common issue when moving to the new Debian “Trixie” base on a Raspberry Pi, because the sound stack and ALSA/pulseaudio defaults have changed. RetroPie/EmulationStation/lr-mame may no longer pick the correct output device, or SDL/RetroArch audio backends may fail.

But alas, the AI troubleshooting goes down a rabbit hole and gets me nowhere - go figure.

Anyone having this issue or have any insight?

Had the exact same issue: Pi 5 running Ubuntu (not Raspberry Pi OS) with RetroPie, getting “Unable to open SDL audio: ALSA: Couldn’t open audio device: Unknown error 524” on every emulator launch.

Root cause: The Pi 5’s KMS display driver ( vc4-kms-v3d ) doesn’t support direct ALSA hardware access to HDMI audio: error 524. On Raspberry Pi OS this is handled transparently, but on Ubuntu (and likely other non-RPi OS distros), the ALSA-to-PipeWire bridge isn’t installed by default. Meanwhile, RetroPie’s bundled SDL2 is compiled without PulseAudio support, so SDL_AUDIODRIVER=pulse is a dead end too.

Fix: Install the PipeWire ALSA plugin so all ALSA clients (including SDL) transparently route through PipeWire:

sudo apt install pipewire-alsa
sudo reboot

That’s it. After reboot, ALSA output routes through PipeWire which knows how to talk to the KMS HDMI audio hardware. Both EmulationStation and RetroArch audio work immediately. You’ll still see “VolumeControl::init() - failed to find mixer elements!” on ES startup, that’s cosmetic and doesn’t affect playback.

No changes needed to retroarch.cfg , /etc/asound.conf , config.txt , or environment variables.

(Debugged and wrote this with help from Claude)