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

SDL Audio driver is unstable and potentially hangs or crashes #26

Open
JayFoxRox opened this issue Apr 10, 2020 · 2 comments
Open

SDL Audio driver is unstable and potentially hangs or crashes #26

JayFoxRox opened this issue Apr 10, 2020 · 2 comments

Comments

@JayFoxRox
Copy link
Member

Before merging the SDL audio support, we have known about potential issues in the SDL audio portion:

The exact behavior seems to depend on different factors like chosen playback rate / SDL audio format.
We'll have to stress-test, review and debug the code.

It's also possible that the issues are unrelated to the audio driver - we have not been able to confirm anything specifically. We just had independent reports of crashes in applications using SDL audio.
Any underlying subsystem (SDL logic or xaudio for example) could be responsible.

Unfortunately the SDL audio subsystem has competing backend design philosophies, so it's complicated and hard to compare to other drivers (and there's no good reference driver within SDL itself either). Debugging this might take a while.

I also have to recommend against testing in XQEMU because the QEMU AC97 implementation might cause additional timing or interrupt injection issues.

As a workaround you will have to disable all SDL audio (including SDL mixer) in your application; if you don't do this, there could be potential crashes due to SDL audio.

@Ryzee119
Copy link

Ryzee119 commented Apr 12, 2021

I this still an issue? It was rewritten in d5d814e
I have been using the sdl audio driver now for a long time and never encounter this issue anymore.

@JayFoxRox
Copy link
Member Author

JayFoxRox commented Apr 12, 2021

I this still an issue? It was rewritten in d5d814e

I'm not sure. I don't think it crashes, but it might not be stable either?

I have been using the sdl audio driver now for a long time and never encounter this issue anymore.

That surprises me.

Was the problem from #27 (comment) resolved eventually?
Potential fixes might have been in SDL or in XAudio - maybe XboxDev/nxdk#364 / XboxDev/nxdk#364 (comment).
I remember having lots and lots of trouble with that; I believe I never fully understood it, but suspected that it was related to XAudio sync of digital and analog outputs (= them being driven from the same interrupt)?
If I fixed it, I probably discussed it on Discord or in one of the PRs or issues, but I can't be bothered to look through the history right now.

Also, most importantly, XboxDev/nxdk#362 almost definitely still exists, which I consider to be a major issue for stability (it breaks application state across applications / quick-reboot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants