Re: iPhone - RenderCallback not called when phone is locked
Re: iPhone - RenderCallback not called when phone is locked
- Subject: Re: iPhone - RenderCallback not called when phone is locked
- From: John Morris <email@hidden>
- Date: Mon, 16 Nov 2009 17:46:06 -0800
Well, I'm doing this at app startup:
AudioSessionInitialize(NULL, kCFRunLoopDefaultMode, sessionInterrupted, this);
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(UInt32), &sessionCategory);
AudioSessionSetActive(true);
None of these return any errors. And I can use AudioSessionGetProperty() to check the category and it returns kAudioSessionCategory_MediaPlayback.
The only other time I touch the session is in my AudioSessionInterruptionListener:
void zmBoomBox::sessionInterrupted(void *inClientData, UInt32 inInterruptionState) {
zmBoomBox *_this = (zmBoomBox*)inClientData;
switch(inInterruptionState) {
case kAudioSessionBeginInterruption:
AudioOutputUnitStop(_this->zm_output);
AudioSessionSetActive(false);
break;
case kAudioSessionEndInterruption:
AudioSessionSetActive(true);
AudioOutputUnitStart(_this->zm_output);
break;
}
}
Is this not correct?
Thanks,
John Morris
Evolution Interactive
On Nov 16, 2009, at 5:18 PM, William Stewart wrote:
> that sounds (sorry about the pun!) like your session's category is not being established correctly. Are you setting your category before making yourself active, and never changing it (just to be sure)...
>
> On Nov 16, 2009, at 5:06 PM, John Morris wrote:
>
>> I'm having a bit of a problem with getting music to continue playing when the screen is locked.
>>
>> I am using RemoteIO with a MultiChannelMixer sitting on top of it in an AUGraph. I am using the kAudioSessionCategory_MediaPlayback session category and am pretty sure I am properly activating/deactivating the session. Everything works just fine except for when I hit the sleep/lock button. When I do this, the render callback stops being called and the device (iPhone & iPod Touch) continues to play the last filled buffer repeatedly. If I hit the home button to get to the "slide to unlock" screen, the music comes back on (calling the callback is resumed). If I let that screen timeout and go back to black, then the callback will stop again. If I unlock the device, everything resumes just fine.
>>
>> Any ideas?
>>
>> John Morris
>> Evolution Interactive _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Coreaudio-api mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden