-
Notifications
You must be signed in to change notification settings - Fork 171
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
Phone call interruption makes unsuccessful session activation #87
Comments
It's really tricky to get this right. I've made so many fixes to broken Apple code over the years, and yet they still manage to break things in new and interesting ways with each release. I've tried hooking session management into the application foreground/background hook methods, which worked in some iOS releases but not others. I've also let the OS do its thing, which is flaky at best. I can take a look further into this, but no guarantees. If you find out more info, please post it! |
@kstenerud Thanks for quick response Karl... Yeah :) I get the point... I asked same question on StackOveflow as well, so I will update accordingly if I somehow came up with solution. In the mean while, can you direct me where to look or what to try ? |
The essential parts are in The method you're experiencing troubles with is |
I just noticed if I set allowIpod = NO and honorSilentSwitch = NO I get no errors. But this is not solution, at least not in my case.. |
I've been playing with phone calls while game running in order to test interruptions. I am using example from ObjectAL documentation called : "Using the OpenAL Objects and OALAudioTrack"
So, I let the library to handle this automatically...
[OALAudioSession sharedInstance ]. handleInterruptions = YES
And it works but partially. For example, with simple setup with 3 sounds I get next error message :
I've noticed that if I add more sounds (lets say 20) , I will get same messages:
Could not activate audio session after 20 tries:
After that, the session is activated.
So, finally, after unsuccessful tries, I get message which says : "Session activated after 21 tries"
But because kMaxSessionActivationRetries is set to 40, eventually sound playing will "break" because number of tries can easily reach more than 40 attempts. I am aware that I can change this value, but that doesn't actually solve the problem.
Am I missing something important here ? I thought that when handleInterruptions property is set to YES , we don't have to do any manual interruptions/session handling ? I am testing on iPhone 6 & iOS8 if that matters. Could anyone shed some light on this ? @kstenerud Any ideas ?
The text was updated successfully, but these errors were encountered: