Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mix_CloseAudio() takes 2 seconds to run #88

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Mix_CloseAudio() takes 2 seconds to run #88

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Labels
invalid This doesn't seem right

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 1.2.8
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2010-06-30 08:33:59 +0000, Jacques Le Normand wrote:

// This code takes 2 seconds to run; it will output "2 seconds to close"
// g++ -Wall -I/usr/include/SDL test.cpp -o test.o -lSDL_mixer

#include
#include
#include <SDL/SDL_mixer.h>

int main(){
int audio_rate = 44100;
int audio_buffers = 1024;
Uint16 audio_format = AUDIO_S16SYS;
int audio_channels = 1;
Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers);
time_t a = time(NULL);
Mix_CloseAudio();
time_t b = time(NULL);
std::cout << difftime(b,a) << " seconds to close" << std::endl;
return 0;
}

On 2011-08-24 23:41:54 +0000, Ryan C. Gordon wrote:

I assume this is on Linux, right?

This isn't SDL_Mixer, it's SDL's pulseaudio (and maybe ALSA) target. We wait for all audio we wanted to play to finish (so it doesn't cut off the end), but the Pulse API is blocking too long in its drain operation.

--ryan.

On 2012-01-01 01:53:31 +0000, Ryan C. Gordon wrote:

Having looked into this a bit more, it's actually not our bug, it's PulseAudio's:

http://pulseaudio.org/ticket/866

(Using "ALSA" on modern versions of Ubuntu just reroutes your audio through PulseAudio, so you can't even get below the PulseAudio layer by default anymore...)

--ryan.

@SDLBugzilla SDLBugzilla added bug invalid This doesn't seem right labels Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant