• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call


  • Subject: Re: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call
  • From: Beinan Li <email@hidden>
  • Date: Wed, 21 Jan 2015 14:33:25 -0500

It is still not the right fix using "App plays audio" for the key "Require background mode" in info.plist.
AudioOutputUnitStart() may still fail on iOS 8.1.2 devices. 

Looking at AVAudioSessionErrorCodeCannotStartPlaying again, I see that with that info.plist option,
the AmbientSound mode still allows now background audio, correct?

I could still add sleep() to it, but this sounds too ad-hoc to be an acceptable solution for all the devices.

Should I file a bug report to Apple? Any thoughts?

Thanks,
Beinan


On Mon, Jan 19, 2015 at 5:23 PM, Beinan Li <email@hidden> wrote:
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@hidden> 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@hidden> 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@hidden> 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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call
      • From: Beinan Li <email@hidden>
References: 
 >iOS8: AudioOutputUnitStart() always fails after rejecting a phone call (From: Beinan Li <email@hidden>)
 >Re: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call (From: Douglas Scott <email@hidden>)
 >Re: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call (From: Beinan Li <email@hidden>)
 >Re: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call (From: Beinan Li <email@hidden>)

  • Prev by Date: Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button
  • Next by Date: Re: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call
  • Previous by thread: Re: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call
  • Next by thread: Re: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call
  • Index(es):
    • Date
    • Thread