Question
Does SDL3 reliably fire SDL_AudioDeviceEvent for USB headset connect/disconnect across platforms?
Zo Dey
0 reputation · 27 Jan 2024, 13:38 UTC
127.8K views0
Goal
Determine whether SDL3's SDL_AudioDeviceEvent reliably reports USB headset connect and disconnect across the major OS backends.
Constraints
SDL3 exposes SDL_EVENT_AUDIO_DEVICE_ADDED and SDL_EVENT_AUDIO_DEVICE_REMOVED, but each backend (PipeWire, PulseAudio, WASAPI, CoreAudio) implements the notification differently. Event ordering, duplicate delivery, and device ID persistence vary, and SDL_GetAudioDeviceList may return transient IDs after a hot‑plug cycle.
Open Questions
- Does SDL3 fire SDL_AudioDeviceEvent consistently for a USB headset connect/disconnect on Linux (PipeWire/PulseAudio), Windows (WASAPI), and macOS (CoreAudio) without missing or duplicating events?
- Are there documented race conditions or known backend bugs that can cause SDL_EVENT_AUDIO_DEVICE_ADDED to be emitted for a device that is not yet fully ready or for an aggregate device created by the OS?
- What best‑practice pattern does the SDL community recommend for confirming device stability immediately after receiving an SDL_AudioDeviceEvent?