What is Core Audio error 561015905 and why does it happen when I use the lock button?

情到浓时终转凉″ 提交于 2019-12-05 01:04:35

问题


Since upgrading to iOS 10 and Xcode 8, my iOS app has been throwing an error and crashing whenever I turn off the screen using the lock button. The error is:

*** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'error 561015905'

I'm not explicitly using Core Audio, or any audio at all. But I am using SceneKit, which I assume uses Core Audio.

Actually this behavior doesn't seem to be related to my code at all. It happens on a brand new untouched SceneKit template! It doesn't happen in the simulator, but it happens consistently testing with an iPhone 5. I haven't tried it with another model.

Steps to reproduce: Create a new project in Xcode 8.0 using the "Game" template with SceneKit. Set your team in the project editor for code signing. Connect an iPhone 5 for testing. Build and run the app. Once it starts (and you see the rotating plane), hit the lock button. The error occurs and the app won't return from the lock screen.

Google results for the error message all seem to be from people actually using Core Audio or trying to play sound, which doesn't apply here.

What is this error and what can be done about it?


回答1:


This is an Apple bug that has 2 workarounds while we wait for the fix in iOS 10.2:

(1) (worse) enable background audio

(2) (better) see Apple message below

message from Apple: This is a known issue that will be fixed in 10.2. In the meantime another simpler workaround should work: Trigger the audio engine creation yourself before entering the background (for example at setup). You can trigger this simply by getting the audio engine from the SCNView:

scnView.audioEngine;



来源:https://stackoverflow.com/questions/39568433/what-is-core-audio-error-561015905-and-why-does-it-happen-when-i-use-the-lock-bu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!