• 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
Accessing AudioUnit API too quickly on iOS ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accessing AudioUnit API too quickly on iOS ?


  • Subject: Accessing AudioUnit API too quickly on iOS ?
  • From: Arnaud Chanu <email@hidden>
  • Date: Mon, 10 Aug 2015 18:34:17 +0000
  • Thread-topic: Accessing AudioUnit API too quickly on iOS ?

Hi CoreAudio,

I’m still quite new to Core Audio and iOS programming in general so please be merciful if this seems trivial :)  

I have an app that correctly initializes, starts and use the remoteIO audio unit when the application starts (iOS 8.3). Eventually, when either leaving the active state (through the app delegate applicationWillResignActive) or upon receiving a ‘ begin’ interruption notification (FaceTime call for example), the app stops and uninitializes the remoteIO audio unit. When the app becomes active again (through the app delegate applicationDidBecomeActive) or when the ‘end’ interruption notification is received, the remoteIO audio unit is re initialized and started. 

Everything works as expected when using this uninitialize/initialize sequence using PlayAndRecord or Playback audio session categories,  but when I use either ambient or solo ambient category, I always receive errors on the Xcode console : ERROR:     [0x19946c310] >aurioc> 806: failed: '!pla' (enable 2, outf< 2 ch,  32000 Hz, Float32, non-inter> inf< 2 ch,      0 Hz, Float32, non-inter>) when calling the AudioUnitInitialize() method on my audio unit during the ‘end’ interruption notification re initialization sequence before receiving the delegate call applicationDidBecomeActive().

After some trials and errors I’ve found that if I add a 500ms delay just before the call to AudioUnitInitialize(), everything is fine suddenly no matter what audio session is used. I’m not exactly sure why this delay is required in my case, and why this is only an issue with Ambient/Solo Ambient. I initially taught this might be related to the ability for app using only PlayAndRecord/Playback audio session to be able to use background audio support but here the app never enters background mode during the ‘begin’ and ‘end’ interruptions, it only switches between active and inactive states.

Is there any known restrictions concerning calling AudioUnit API too quickly after an interruption notification or during an app inactive state when using certain audio session categories ? I tried to look in the CoreAudio API for some way to ‘know’ if it’s ready to be used at a given time but came out empty handed.

Thanks in advance,

Arnaud

 _______________________________________________
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

  • Prev by Date: Output unit's input callback: concurrency?
  • Next by Date: mp3 stream -> uncompressed file??
  • Previous by thread: Output unit's input callback: concurrency?
  • Next by thread: mp3 stream -> uncompressed file??
  • Index(es):
    • Date
    • Thread