96KHz audio won't play after migrating from SDL1.2 to SDL2


I just migrated my project from SDL1.2 to SDL2, and despite the migration guide saying audio should work pretty much out of the box, no audio was played after recompilation. SDL_OpenAudio returned 0 and my audio callback was being called; the desired and obtained AudioSpec structs were identical but the “samples” value (upped from 512 to 2048). Apparently, reducing the sample rate from 96KHz to 44.1 KHz restored sound playback, but 96KHz sound was working perfectly fine on SDL1.2.

Tested on macOS Sierra (10.12.3), haven’t tested on Linux or Windows yet. Using SDL2-2.0.5.

Edit: Tested on Linux Mint 64-bit and 96KHz audio seems to work. Seems like a bug in the macOS port of SDL2?
Edit 2: SDL2-2.0.4 seems to work on macOS. This is a bug introduced in 2.0.5 it appears.

We have dramatically rewritten the audio conversion code since SDL 2.0.5; this is likely working with the latest in revision control (which will become 2.0.6 pretty soon).

If you’re inclined, please test the latest revision and see if it helps you.


Just compiled SDL2.framework from here and tested the case again. The bug is still there – 96KHz sound does not play, 44.1KHZ sound does.

I also opened a bug report: https://bugzilla.libsdl.org/show_bug.cgi?id=3656

We figured this out last night! The latest in revision control should work now (assuming spurious’s github has caught up).

That was a fun bug to track down. :slight_smile:

Awesome! Any estimate for SDL 2.0.6’s release date?

Awesome! Any estimate for SDL 2.0.6’s release date?

Very very soon. We’re trying to lock it down right now.

1 Like

Sorry to bump this topic after almost a year, but I’ve tested again with SDL 2.0.8 and the bug is still there. Audio won’t play in 96KHz unless I set samples to 2048.