Re: resetting audio engine after NaN in audio buffer
Re: resetting audio engine after NaN in audio buffer
- Subject: Re: resetting audio engine after NaN in audio buffer
- From: Christian Rober <email@hidden>
- Date: Thu, 14 May 2015 09:05:21 -0400
Without looking at any code/off the top of my head:
This seems like an AVAudioSession state issue. I too have seen interesting behavior where other apps can reset the AVAudioSession, especially when they change the category or options (ex: Mix with others). I have seen arbitrary volume jumps and IAA callbacks suddenly break when the session changes or is reset, for example.
I would experiment with setting the session to inactive, then setting it to active again, for starters. I think of AVAudioSession as a local handle to a device-wide process. In other words, all apps running on an iOS device actually share the same AVAudioSession, and your app is given a specific API to access that shared state.
You probably need to listen to notifications from the AVAudioSession as well. I could see passing a NaN value to the audio engine causing an AVAudioSession reset. In that case you should set a breakpoint on your callbacks from these notifications and see what the state is at that point. Start with the documentation:
Also, If you are using an AUGraph and/or using the RemoteI/O audio unit, you may need to turn them off temporarily (i.e. stop pulling audio buffers), re-set properties/ASBD's, then restart them. There are some WWDC videos that talk about handling an AVAudioSession reset using audio units. Note that the order of enabling AVAudioSession, AUGraphs and the Remote I/O unit matters, but I defer to the documentation and code samples that apple provides to illustrate this ordering.
--Christian
_______________________________________________
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