AudioKit: Audiobus 'hwFormat' crash
I’m integrating Audiobus into my AudioKit-based app, and have followed the instructions here, but when I call Audiobus.start()
, the app will continue running for about a second, then I get some error output, followed by a crash:
2017-03-22 23:25:45.620918 Vulse[20369:7115604] [central] 54: ERROR: [0x16e167000] >avae> AVAudioIONodeImpl.mm:365: _GetHWFormat: required condition is false: hwFormat framerate: 23 2017-03-22 23:26:03.917219 Vulse[20369:7115604] *** Terminating app due to uncaught exception ‘com.apple.coreaudio.avfaudio’, reason: ‘required condition is false: hwFormat’
So, I got the FilterEffects example up and running to see if the issue was just in my app. (First I had to change the input
variable in viewDidLoad to a property, because it was deiniting too early and causing a crash.) But after fixing that, I unfortunately got the same error above.
Interestingly, for the second or two before the app crashes, everything seems to work properly: the app takes audio input from audiobus and I can hear it output with the reverb applied. Also (at least in my app) if I remove the Audiobus.start()
, but still try to instantiate an AKStereoInput, I get a similar message: SetOutputFormat: required condition is false: format.sampleRate == hwFormat.sampleRate
Do you get the same crash when trying this yourself, with the latest AudioKit release? I’m using Audiobus 2.3.3, on an iPhone 6s running iOS 10.2.1.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 29 (20 by maintainers)
Commits related to this issue
- Small fix found while trying to debug https://github.com/audiokit/AudioKit/issues/812 — committed to AudioKit/AudioKit by aure 7 years ago
- Discovered what appears to be a bug out of my control. https://github.com/audiokit/AudioKit/issues/812 refers. crashes when headphones are unplugged. Fixed missing file for character Laura. Appear t... — committed to jfosterdavis/Charles by jfosterdavis 7 years ago
Good news - apparently this should be fixed in the latest iOS 11.1 beta (b5, I presume)
If you can log a radar, I’ll email my contacts on the Core Audio team and give them a heads-up directly
I have seen this same crash frequently on an iPhone 7 while playing back mono source. Unplugging it from the computer via lightning connector did seem to reduce the frequency of crashes. The same code on a 5s runs perfectly every time.
We’re going to pull AudioKit out of the loop and go Straight AVAudioPlayer Kit playback for this one instance and see if we still experience problems.
@jconst The second half of this video shows how to use .xcodeproj file instead of the framework: https://vimeo.com/214224470
I just now got around to checking if the issue is resolved and I’m not seeing the crash anymore! In fact AudioBus integration seems to be working quite seamlessly now. Thanks for looking into this.
Well, the AudioBus 3 SDK won’t be released for a couple more days so I looked at this problem. I found one bug on the iPad and pushed that commit. Now it works on the iPad at least. But the iPad is stereo, and the iPhone6 is mono, so your bug may still persist. I don’t have mono phone (7 is stereo) to test…