| Summary: | Android. Audio not initialized when thread starts. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sylvain <sylvain.becker> |
| Component: | *don't know* | Assignee: | Gabriel Jacobo <gabomdq> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | ARM | ||
| OS: | Android (All) | ||
I've added a detection for the case where the AudioTrack is not properly initialized: http://hg.libsdl.org/SDL/rev/463f78515a07 Note that this won't probably fix your problem right away, what you need to do is detect if there was a problem initializing the SDL Audio backend, and if that's the case disable audio (or use the dummy driver?) |
Hi, Here's a bug I got with an android application. It's very rare (a few stack traces obtained from google play: 1 per 10k). but easily fixed / at least here's a workaround ... The Audio seems not to be initialised when the run() method is called with AudioStartThread(). ------------------- java.lang.IllegalStateException: play() called on uninitialized AudioTrack. at android.media.AudioTrack.play(AudioTrack.java:829) at org.libsdl.app.SDLActivity$1.run(SDLActivity.java:419) at java.lang.Thread.run(Thread.java:856) -------------------- The static variable "mAudioTrack" could be initialised to null, by default. And some "try/catch" block added when doing : try{ if (mAudioTrack != null){ mAudioTrack.play(); nativeRunAudioThread(); } } catch(Exception e) {} and also try{ if (mAudioTrack != null){ mAudioTrack.stop(); } } catch(Exception e) {}