#16133·SDL

SDL_audio.c assert in SDL_AddAudioDevice when PC returns from sleep

Author: AcclutionCreated Aug 10, 2026Updated Sep 30, 2026

Hi, I think my issue is that SDL_pipewire is getting io_list_remove and io_list_check_add on the same time somehow when my pc returns from sleep.

io_list_remove calls SDL_AudioDeviceDisconnected which just forwards the removal to the main thread while io_list_check_add calls SDL_AddAudioDevice which tries to add the device directly. Because it is happening one after the other then the remove call might not happen before the add call and the add call will assert in debug builds (and I guess try create a device that exists already in release builds), and later remove it on the main thread. And might make it so the user does not have any device later?

I guess it could be some setup issues on my computer that could make this happen but might be good to put adding the device on the main thread as well?

OS: Arch Linux (btw.. haha), wayland, sway and swayidle (that makes it go to sleep and return I think). Source build from main branch.