I have a strange issue where an iOS app that I have developed works fine when I build and run it from XCode on the device. However, on restarting the device and running the app, I get no audio at all. If I subsequently kill the app and restart it from the device, I start getting audio again. I initially thought it was an Interruption Handler issue, but am not sure any more. Any help would be appreciated!
Here's my interruption handler just in case.
static void MyInterruptionListener (void *inUserData,
UInt32 inInterruptionState) {
printf ("Interrupted! inInterruptionState=%ld\n", inInterruptionState);
pediViewController *pediController = (__bridge pediViewController*)inUserData;
switch (inInterruptionState) {
case kAudioSessionBeginInterruption:
CheckError (AudioOutputUnitStop (pediController.effectState.rioUnit),
"Couldn't start RIO unit");
case kAudioSessionEndInterruption:
// TODO: doesn't work!
CheckError(AudioSessionSetActive(true),
"Couldn't set audio session active");
CheckError (AudioOutputUnitStart (pediController.effectState.rioUnit),
"Couldn't start RIO unit");
break;
default:
break;
};
}
The issue went away on upgrading to iOS 6. I did some intensive debugging by commenting out each and every line of code in the audio callback and testing by restarting the iPad and running the app again 3 times each. Finally it was solved by updating to iOS 6 on the device and running on that. I also got a huge performance boost in doing so!