We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3868

Summary: Delay after calling SDL_CloseAudioDevice
Product: SDL Reporter: Andreas <andreas.grabher>
Component: audioAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: eric.t.scrivner, sezeroz
Version: 2.0.6   
Hardware: x86_64   
OS: Mac OS X 10.9   

Description Andreas 2017-10-10 06:06:19 UTC
Calling SDL_CloseAudioDevice with valid SDL_AudioDeviceID causes a delay of multiple (> 10) seconds. The bug was not present in SDL v2.0.5. Affected machine is iMac, early 2009 running Mac OS X v10.9.5. No other hardware or OS tested.
Comment 1 Eric Scrivner 2017-10-12 18:42:00 UTC
Can confirm and reproduce this issue on OS X Sierra. Also, can add that this only happens when AudioSpec.samples < 1024. At 1024 or higher, calling CloseAudioDevice is nearly instantaneous.
Comment 2 Ryan C. Gordon 2017-10-13 05:18:10 UTC
This is fixed now, in https://hg.libsdl.org/SDL/rev/9658d3a4b03a ...if you have a chance, please test the latest in Mercurial, because we're planning to ship a 2.0.7 release very soon with this fix, and I'd like to know it solves your problem.

Thanks!

--ryan.
Comment 3 Andreas 2017-10-14 07:58:44 UTC
Thank you, Ryan! I just compiled the latest SDL2 code and can confirm that the delay is gone.
Comment 4 Eric Scrivner 2017-10-14 19:03:52 UTC
Ryan: Wow, thank you for the quick fix! Downloaded and can also confirm that this issue is no longer happening.