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:

https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVAudioSession_ClassReference/index.html#//apple_ref/c/data/AVAudioSessionInterruptionNotification

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

On Tue, May 12, 2015 at 5:18 PM, ben kamen <[email protected]> wrote:

> I’ve been experimenting with some DSP C functions on iOS and have a couple
> times encountered an issue where NaN value gets sent into the output audio
> buffer.   (Obviously that indicates a bug!  but anyways….)
>
> When this occurs audio stops functioning though the rest of the app
> (usually) keeps on going as if nothing happened.
>
> That makes sense, but I can’t figure out the best way to recover after
> that — quitting/restarting the app doesn’t fix it, and audio in most other
> apps is silenced as well.
>
> The easiest solution I’ve found is to open up the app “Samplr” which
> apparently has something in it that resets core audio and allows everything
> to recover.  Any ideas what that would be?
>
> Thanks,
> Ben
>
>
>
>  _______________________________________________
> 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/recapitch%40gmail.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]

Reply via email to