Closed JayFoxRox closed 4 years ago
Actually opening the audio device fails with "Couldn't create mixer lock" though
Good feedback! I never actually tested this beyond init.
My main test-case is Neverball, which just exits early with the master revision. This PR makes Neverball go to the mainloop. I did not check if it might cause errors.
Is there any reason why it isn't being merged yet? Are we waiting for #15? I'm fine eitherway as I keep a hacky branch for Neverball anyway: https://github.com/JayFoxRox/nxdk-sdl/pull/1
Is there any reason why it isn't being merged yet? Are we waiting for #15?
Nah I think it's fine to merge this before #15. Merging.
I noticed that this fails:
SDL_Init(SDL_INIT_AUDIO)
.This shouldn't happen as I already added dummy drivers in #9. Unfortunately, it was incomplete (which I didn't know at the time).
There were 2 independent problems which break SDL audio:
SDL_AUDIO_DISABLED 1
with a misleading comment (implying the dummy would be active); it should beSDL_AUDIO_DRIVER_DUMMY
.demand_only = 1
. This means will be rejected unless explicitly requested through environment variables (which are alwaysNULL
in nxdk at the moment).As a solution, I add a source file which includes the dummy driver; however, the dummy backend with
demand_only = 1
is never registered itself. Instead it is registered as another backend ("xbox") withdemand_only = 0
. Accordingly, I useSDL_AUDIO_DRIVER_XBOX
in our config.I'm not sure about the commit title - suggestions welcome.
I have smoke-tested this by using this in the SDL sample
main
function:(needs
#include <assert.h>
)Please confirm that this works correctly (my nxdk and SDL trees also had other changes at the time).