I have an app that plays audio using AVPlayer. I have enabled background audio by setting the audio category to AVAudioSessionCategoryPlayback and added the required UIBackgroundModes setting to audio in the info.plist.
On iOS 5, when you press the home button, the app goes in the background and audio still plays for a bit, but when I double tap the home button the whole device locks up for 10 seconds or so and the audio eventually stops.
The application is still running, however, because I can launch it and see the app’s state just like it was. Unfortunately the audio system seems to be borked, because any subsequent operation usually causes a crash.
When the audio stops, I see the following in the device’s console:
Jun 26 12:39:28 unknown SpringBoard[15] <Warning>: Unable to deliver SBApplicationNotificationStateChanged notification to port com.apple.springboard.appstatechanged: (ipc/send) timed out
Jun 26 12:39:53 unknown mediaserverd[25406] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received to terminate [25406] with reason 'fig rpc timeout -- FigSharedRemote_VolumeCategoryForAudioCategory'
Jun 26 12:39:53 unknown ReportCrash[25468] <Notice>: Saved crashreport to /Library/Logs/CrashReporter/mediaserverd-2012-06-26-123953.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Jun 26 12:39:53 unknown mediaserverd[25406] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received; stackshot generated
Jun 26 12:39:53 unknown mediaserverd[25406] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: TERMINATING our process [25406]
Jun 26 12:39:53 unknown com.apple.launchd[1] <Notice>: (com.apple.mediaserverd) Exited: Killed: 9
Jun 26 12:39:54 unknown com.apple.mediaserverd[25469] <Notice>: 2012-06-26 12:39:54.083477 PM [AirTunes] HAL plugin started
Jun 26 12:39:54 unknown kernel[0] <Debug>: launchd[25469] Builtin profile: mediaserverd (sandbox)
Jun 26 12:39:54 unknown mediaserverd[25469] <Error>: 12:39:54.317795 com.apple.AVConference: /SourceCache/GameKitServices/GameKitServices-344.21/AVConference.subproj/Sources/AVConferenceServer.m:1867: AVConferenceServerStart
This seems to only affect iOS 5.
Turns out this was an issue in my code by sharing more than one
AVPlayerinstance, which caused the audio system to crash at times. Removing the 2nd player fixed this bug. /sigh