OK, found it. Thanks for the tip Scott! Under those modes, I'd have to enable the background mode for audio, otherwise when it takes longer for the foreground phone app to dismiss, the AudioOutputUnitStart() may fail its turn.
Thanks, Beinan On Mon, Jan 19, 2015 at 5:03 PM, Beinan Li <[email protected]> wrote: > Thanks. I found some clues. > > Just under AmbientSound and iOS8 devices, > > 1. If I put a sleep(2); before the AudioOutputUnitStart() call, then the > audio will restore normally. And 2 is an empirical number, 1 would be too > short, and 3 seems to work the same way as 2. > > 2. If the first call to AudioOutputUnitStart() fails, there is just no > use to wait and retry. > > This looks scary because I found no docs explaining the differences in > interruption handling "timing" between iOS versions. And the number feels > completely random. > > Does anyone have any pointers? > > Thanks, > Beinan > > > On Mon, Jan 19, 2015 at 4:36 PM, Douglas Scott <[email protected]> > wrote: > >> Just as a starting point: if you grep that error in the public audio >> headers, you will find it is: >> >> AVAudioSessionErrorCodeCannotStartPlaying = '!pla', /* 0x21706C61, >> 561015905 */ >> >> >> with description: >> >> @constant AVAudioSessionErrorCodeCannotStartPlaying >> The app is not allowed to start recording and/or playing, usually because >> of a lack of audio key in >> its Info.plist. This could also happen if the app has this key but >> uses a category that can't record >> and/or play in the background (AVAudioSessionCategoryAmbient, >> AVAudioSessionCategorySoloAmbient, etc.). >> >> On Jan 19, 2015, at 12:11 PM, Beinan Li <[email protected]> wrote: >> >> Hi CoreAudio, >> >> Our app used to handle interruption correctly with the registered >> interruption listener. >> Now on iOS 8 under kAudioSessionCategory_AmbientSound category, >> whenever we reject a phone call, the call to AudioOutputUnitStart() for >> resuming the >> audio pipeline always returns: >> >> ERROR: [0x3afe09dc] 1230: AUIOClient_StartIO failed (561015905) >> >> And our apps will have no sound as a result. >> >> We set it to retry on fails but it would always fail on retries. >> >> We were we missing? >> >> Thanks, >> Beinan >> >> _______________________________________________ >> Do not post admin requests to the list. They will be ignored. >> Coreaudio-api mailing list ([email protected]) >> Help/Unsubscribe/Update your Subscription: >> >> https://lists.apple.com/mailman/options/coreaudio-api/douglas_scott%40apple.com >> >> This email sent to [email protected] >> >> >> >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com This email sent to [email protected]
