In the middle of making my iPad application universal, ran into a crash on my iPhone 4 running iOS 5 (cocos2d 1.0.1). Not seeing the same problem in my iPad2 running iOS 5.
General sequence of events:
- Start application, loads scene with background music playing
- put app to background, wait over a minute
- resume the app, app seems hung, then crashes (is terminated) about 10 seconds later
It's not 100% repeatable, but happens a lot.
I set the following:
[[CDAudioManager sharedManager] setResignBehavior:kAMRBStopPlay autoHandle:YES];
On resign active I see (note I added a bit of debug output):
Oct 17 14:29:41 unknown MyApp[6397] <Warning>: cocos2d: Frame interval: 15
Oct 17 14:29:41 unknown MyApp[6397] <Warning>: Denshion::CDAudioManager - resign active called
Oct 17 14:29:41 unknown MyApp[6397] <Warning>: Denshion::CDAudioManager - Attempt to set Audio session category AVAudioSessionCategoryAmbient
Oct 17 14:29:41 unknown MyApp[6397] <Warning>: Denshion::CDAudioManager - Audio session set category AVAudioSessionCategoryAmbient succeeded
Oct 17 14:29:41 unknown MyApp[6397] <Warning>: Denshion::CDAudioManager - audio source was playing <CDLongAudioSource: 0x3411b0>
Oct 17 14:29:41 unknown MyApp[6397] <Warning>: Denshion::CDAudioManager - handled resign active
Then on become active:
Oct 17 14:32:38 unknown MyApp[6397] <Warning>: cocos2d: Frame interval: 15
Oct 17 14:32:38 unknown MyApp[6397] <Warning>: cocos2d: Frame interval: 1
Oct 17 14:32:38 unknown MyApp[6397] <Warning>: Denshion::CDAudioManager - become active called
Oct 17 14:32:38 unknown MyApp[6397] <Warning>: Denshion::CDAudioManager - Other audio is not playing audio will be exclusive
Oct 17 14:32:38 unknown MyApp[6397] <Warning>: Denshion::CDAudioManager - Attempt to set Audio session category AVAudioSessionCategorySoloAmbient
Oct 17 14:32:47 unknown MyApp[6397] <Error>: 14:32:47.932 <0x3f807ce8> AudioSessionSetProperty posting message to kill mediaserverd (6317)
Oct 17 14:32:47 unknown mediaserverd[6317] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received to terminate [6317] with reason 'AudioSessionSetProperty'
Oct 17 14:32:48 unknown ReportCrash[6400] <Error>: Saved crashreport to /Library/Logs/CrashReporter/mediaserverd-2011-10-17-143248.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Oct 17 14:32:48 unknown mediaserverd[6317] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received; stackshot generated
Oct 17 14:32:48 unknown mediaserverd[6317] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: TERMINATING our process [6317]
Oct 17 14:32:48 unknown com.apple.launchd[1] <Notice>: (com.apple.mediaserverd) Exited: Killed: 9
Oct 17 14:32:48 unknown MyApp[6397] <Warning>: Denshion::CDAudioManager - Audio session set category AVAudioSessionCategorySoloAmbient succeeded
Oct 17 14:32:48 unknown MyApp[6397] <Warning>: Denshion::CDAudioManager - audio source was system paused <CDLongAudioSource: 0x3411b0>
Oct 17 14:32:48 unknown kernel[0] <Debug>: launchd[6401] Builtin profile: mediaserverd (sandbox)
Oct 17 14:32:49 unknown mediaserverd[6401] <Error>: 14:32:49.368387 com.apple.AVConference: /SourceCache/GameKitServices/GameKitServices-344.3/AVConference.subproj/Sources/AVConferenceServer.m:1867: AVConferenceServerStart
Oct 17 14:32:49 unknown SpringBoard[15] <Warning>: com.domain.MyApp failed to resume in time
Oct 17 14:32:49 unknown SpringBoard[15] <Warning>: Forcing crash report of MyApp[6397]...
Oct 17 14:32:49 unknown SpringBoard[15] <Warning>: Finished crash reporting.
Oct 17 14:32:49 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.domain.MyApp[0x678d]) Exited: Killed: 9
Oct 17 14:32:49 unknown SpringBoard[15] <Warning>: Application 'My App' exited abnormally with signal 9: Killed: 9
Looks like I am getting stuck in audioSessionSetCategory ...
Anyone have tips on where to start looking (or what additional information would be useful)?