Skip to content

Commit

Permalink
MKAudio: handle RouteConfigurationChange in AudioSession route change…
Browse files Browse the repository at this point in the history
… callback.

This fixes the erroneous infinite restarting bug, which is seen
when running 'Mumble for iOS' 1.2.3 on iOS 7.1.

Something with the VPIO AudioUnit is causing the route change reason
kAudioSessionRouteChangeReason_RouteConfigurationChange to be emitted.
This seemingly happens when the VPIO AudioUnit is initialized, or
somewhere around it.

The MKAudio code didn't handle this change reason (it was introduced
in iOS 7.0). Because MKAudio didn't handle it, it was treated as a
'restart' reason, and thus MKAudio would restart both MKAudioInput
and MKAudioOutput when it received the RouteConfigurationChange reason.
This restart triggered the same change reason to be emitted, leaving
MumbleKit's audio subsystem in an infinite restart loop.
  • Loading branch information
mkrautz committed Mar 10, 2014
1 parent 3868c44 commit 0d753bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/MKAudio.m
Expand Up @@ -108,6 +108,9 @@ static void MKAudio_AudioRouteChangedCallback(MKAudio *audio, AudioSessionProper
case kAudioSessionRouteChangeReason_Override:
case kAudioSessionRouteChangeReason_CategoryChange:
case kAudioSessionRouteChangeReason_NoSuitableRouteForCategory:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
case kAudioSessionRouteChangeReason_RouteConfigurationChange:
#endif
NSLog(@"MKAudio: audio route changed, skipping; reason=%i", reason);
return;
}
Expand Down

0 comments on commit 0d753bc

Please sign in to comment.