0

I'm getting some long input audio dropouts after plugging in headphones on an iOS 8 device. That is, AudioUnitRender() succeeds as usual on the I/O audio unit, but has intermittent digital silence for a few seconds. It's a predictable pattern of three one-second periods of silence, a shorter one, and then normal input audio again.

I'm not sure where to go from here because no error is indicated. Has anyone run into a problem like this?

Luke
  • 7,110
  • 6
  • 45
  • 74
  • That could simply be the time it takes the hardware to switch connections or configurations. The iOS RemoteIO audio unit might have no data to send you if the hardware isn't ready, so fills the buffers with zeros. – hotpaw2 Feb 27 '15 at 19:53
  • Do you know if there's a way to confirm that's what's happening? And it seems unfortunate that it would stutter in and out in that case. – Luke Feb 27 '15 at 20:18
  • You could try using a TSI with Apple developer support. But they release almost no public info on the internals of the iOS audio hardware or drivers. – hotpaw2 Feb 27 '15 at 20:27

1 Answers1

1

When plugging or unplugging headphones, this action constitutes an Audio Route Change, and must be responded to and handled to prevent dropouts. For reference, the "Factory" apple apps, will pause upon unplugging, but continue to play upon plugging-in.

To debug your problem, I recommend:

  • verifying that you're listening to route changes (AVAudioSessionRouteChangeNotification)
  • Implement methods to be invoked upon a route change. This will allow you to confirm that route change issues are the cause of the dropouts, or at least allow you to pause execution in the route change handler to check the state of your audio buffer lists and I/O unit.

enter image description here

ruoho ruotsi
  • 1,283
  • 14
  • 13