Ios 后台应用程序/双击主页按钮时音频崩溃

Ios 后台应用程序/双击主页按钮时音频崩溃,ios,ios5,avfoundation,avplayer,Ios,Ios5,Avfoundation,Avplayer,我有一个使用AVPlayer播放音频的应用程序。我已通过将音频类别设置为AVAudioSessionCategoryPlayback启用了背景音频,并在info.plist中将所需的UIBackgroundModes设置添加到audio 在iOS 5上,当你按下home(主页)按钮时,应用程序进入后台,音频仍会播放一段时间,但当我双击home(主页)按钮时,整个设备会锁定10秒钟左右,音频最终停止 但是,应用程序仍在运行,因为我可以启动它,并像以前一样查看应用程序的状态。不幸的是,音响系统似乎坏

我有一个使用AVPlayer播放音频的应用程序。我已通过将音频类别设置为
AVAudioSessionCategoryPlayback
启用了背景音频,并在info.plist中将所需的
UIBackgroundModes
设置添加到
audio

在iOS 5上,当你按下home(主页)按钮时,应用程序进入后台,音频仍会播放一段时间,但当我双击home(主页)按钮时,整个设备会锁定10秒钟左右,音频最终停止

但是,应用程序仍在运行,因为我可以启动它,并像以前一样查看应用程序的状态。不幸的是,音响系统似乎坏了,因为任何后续操作通常都会导致崩溃

当音频停止时,我会在设备控制台中看到以下内容:

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
Jun 26 12:39:28未知SpringBoard[15]:无法将SBApplicationNotificationStateChanged通知传递到端口com.apple.SpringBoard.appstatechanged:(ipc/send)超时
6月26日12:39:53未知mediaserverd[25406]:>FigPlayerRemoteServer\u KillAndForceCrashReport:RPCTimeout消息已收到,以终止[25406],原因为“FigRPC超时--FigSharedRemote\u VolumeCategory for Audiocategory”
Jun 26 12:39:53未知报告崩溃[25468]:已将崩溃报告保存到/Library/Logs/CrashReporter/mediaserverd-2012-06-26-123953.plist,使用uid:0 gid:0,synthetic\u euid:0 egid:0
6月26日12:39:53未知mediaserverd[25406]:>FigPlayerRemoteServer\u KillAndForceCrashReport:收到RPCTimeout消息;堆栈快照生成
6月26日12:39:53未知的mediaserverd[25406]:>FigPlayerRemoteServer\u KillAndForceCrashReport:终止我们的进程[25406]
6月26日12:39:53未知的com.apple.launchd[1]:(com.apple.mediaserverd)退出:被杀死:9
6月26日12:39:54未知com.apple.mediaserverd[25469]:2012-06-26 12:39:54.083477 PM[AirTunes]HAL插件已启动
Jun 26 12:39:54未知内核[0]:启动[25469]内置配置文件:mediaserverd(沙盒)
6月26日12:39:54未知mediaserverd[25469]:12:39:54.317795 com.apple.AVConference:/SourceCache/GameKitServices/GameKitServices-344.21/AVConference.subproj/Sources/AVConferenceServer.m:1867:AVConferenceServerStart

这似乎只影响iOS 5。

事实证明,这是我的代码中的一个问题,因为我共享了多个
AVPlayer
实例,这有时会导致音频系统崩溃。移除第二个玩家修复了这个错误/唉

原来这是我的代码中的一个问题,因为我共享了多个
AVPlayer
实例,这有时会导致音频系统崩溃。移除第二个玩家修复了这个错误/唉

我也有同样的问题,尽管我只是因为要做交叉淡入淡出而不得不使用2台AVP播放器。 在监测了这些工具的分配情况后,结果表明,玩家没有得到适当的释放(他们仍然“活着”)。
我不恰当地释放了他们。在我修复了这个问题并且他们被正确释放后,问题就消失了。

我也有同样的问题,尽管我只是因为要做交叉淡入淡出而不得不使用2个AVPlayer。 在监测了这些工具的分配情况后,结果表明,玩家没有得到适当的释放(他们仍然“活着”)。 我不恰当地释放了他们。在我解决了这个问题,他们得到了适当的释放后,问题就消失了