Simulator crashing with iOS < 14. Started happening since Big Sur

I can no longer run my app in the simulator with a version lower than iOS14.
I tried iOS12, iOS12.4, iOS13.7 and they all crash with the same error.

This only started since upgrading to Big Sur. Nothing has changed in my code base.

This is the code that crashes:
Code Block  //6.
    // Provide callback audio rendering function on the unit
    // Set input callback
    AURenderCallbackStruct callbackStruct;
    callbackStruct.inputProc = playbackCallback;
    callbackStruct.inputProcRefCon = self;
    status = AudioUnitSetProperty(_audioUnit,
kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Input,
kOutputBus,
&callbackStruct,
sizeof(callbackStruct)
);
    NSAssert1(status == noErr, @"Error setting callback: %d", (int)status);
    //start audio
    AudioOutputUnitStart(_audioUnit);


The error "Thread 1: signal SIGABRT" occurs at the last line...
Code Block
AudioOutputUnitStart(_audioUnit);


And the errors in the console are:

Code Block 2020-11-25 15:17:34.228802-0800 PolyNome[20602:879922] Error loading /Library/Audio/Plug-Ins/HAL/JackRouter.plugin/Contents/MacOS/JackRouter:  dlopen(/Library/Audio/Plug-Ins/HAL/JackRouter.plugin/Contents/MacOS/JackRouter, 262): no suitable image found.  Did find:
/Library/Audio/Plug-Ins/HAL/JackRouter.plugin/Contents/MacOS/JackRouter: mach-o, but not built for iOS simulator
2020-11-25 15:17:34.229006-0800 PolyNome[20602:879922] Cannot find function pointer New_JackRouterPlugIn for factory <CFUUID 0x600003f11a80> 7CB18864-927D-48B5-904C-CCFBCFBC7ADD in CFBundle/CFPlugIn 0x7fbe247a7390 </Library/Audio/Plug-Ins/HAL/JackRouter.plugin> (bundle, not loaded)
2020-11-25 15:17:34.461372-0800 PolyNome[20602:880389] [AudioHAL_Client] HALB_IOBufferManager.cpp:226:GetIOBuffer:  HALB_IOBufferManager::GetIOBuffer: the stream index is out of range
2020-11-25 15:17:34.461528-0800 PolyNome[20602:880389] [AudioHAL_Client] HALB_IOBufferManager.cpp:226:GetIOBuffer:  HALB_IOBufferManager::GetIOBuffer: the stream index is out of range
2020-11-25 15:17:34.474317-0800 PolyNome[20602:880389] [aqme] 254: AQDefaultDevice (1): output stream 0: null buffer
2020-11-25 15:17:34.475993-0800 PolyNome[20602:880389] [aqme] 1640: EXCEPTION thrown (-50): -
2020-11-25 15:17:43.424327-0800 PolyNome[20602:879922] RPCTimeout.mm:55:_ReportRPCTimeout: Start: Mach message timeout. Apparently deadlocked. Aborting now.
CoreSimulator 732.18.0.2 - Device: iPhone 8 Plus (796F538B-78DA-4FE7-9005-317621931E88) - Runtime: iOS 12.4 (16G73) - DeviceType: iPhone 8 Plus


As I said, the only thing that's changed since it last worked is that I upgraded to Big Sur.

It runs fine in the iOS Simulator, but not in simulators with a lower iOS version.

The Audio Output of the Simulator is set to Internal Speakers.

Any help is much appreciated.


The same happens to me
Hi,
I'm glad not to be the ony one with this issue.

I'm using AVAudioEngine from iOS 9 to iOS 14. Since Big Sur Update I can only use simuated devices with iOS 14. Elder stages of development don't work either since the Update. I do not experience the failure on real devices.

For my error stack I chose the same target as You( on iPhone 8 Plus simulator with iOS 11.4) and it seems to be pretty the same:

Code Block xctest fehler 14:18:30.782598+0100 AudioHAL_Client HALB_IOBufferManager.cpp:226:GetIOBuffer: HALB_IOBufferManager::GetIOBuffer: the stream index is out of range
xctest fehler 14:18:30.782700+0100 AudioHAL_Client HALB_IOBufferManager.cpp:226:GetIOBuffer: HALB_IOBufferManager::GetIOBuffer: the stream index is out of range
xctest fehler 14:18:30.783822+0100 BoringSSL Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
xctest fehler 14:18:30.784329+0100 BoringSSL Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
xctest standard 14:18:30.784715+0100 <Beschreibung fehlt> TIC TCP Conn Event [1:0x7ffe4850b190]: 2
xctest standard 14:18:30.784950+0100 <Beschreibung fehlt> TIC TCP Conn Cancel [1:0x7ffe4850b190]
xctest standard 14:18:30.785512+0100 [1 swr-swr3.cast.ybrid.io:443 stream, pid: 11336, url: https://swr-swr3.cast.ybrid.io/swr/swr3/ybrid, traffic class: 500, tls] cancelled
[1.1 E5363C93-8B5F-4FE9-87AA-C4B1005A2FB6 582133952.53443<->'10 02 01 BB 3E 1B 3C 31 00 00 00 00 00 00 00 00']
Connected Path: satisfied (Path is satisfied), interface: en0
Duration: 10.228s, DNS @0.002s took 0.001s, TCP @0.006s took 0.026s, TLS took 0.069s
bytes in/out: 5604/630, packets in/out: 7/3, rtt: 0.023s, retransmitted packets: 0, out-of-order packets: 0
xctest fehler 14:18:30.795025+0100 aqme 254: AQDefaultDevice (1): output stream 0: null buffer
xctest standard 14:18:30.795265+0100 <Beschreibung fehlt> 505: buffer 0 ptr 0x0 size 4096 expected 4096
xctest fehler 14:18:30.795376+0100 aqme 1433: EXCEPTION thrown (-50): -
xctest standard 14:18:30.795319+0100 <Beschreibung fehlt> TIC TCP Conn Cancel [2:0x7ffe4850d2c0]
xctest standard 14:18:30.795969+0100 [2 swr-ybrid-edge-2004-fra-lg-cdn.cast.addradio.de:443 stream, pid: 11336, url: https://swr-ybrid-edge-2004-fra-lg-cdn.cast.addradio.de/swr/swr3/ybrid?_art=dj0yJmlwPTg4LjY5LjIxLjQ1JmlkPWljc2N4bC1jenNlMzJsbGImdD, traffic class: 500, tls] cancelled
[2.1 F1421CF8-56AF-4995-9744-9C4D6FAA20CE 582133952.53444<->'10 02 01 BB D4 7A 89 FC 00 00 00 00 00 00 00 00']
Connected Path: satisfied (Path is satisfied), interface: en0
Duration: 10.109s, DNS @0.001s took 0.041s, TCP @0.048s took 0.019s, TLS took 0.114s
bytes in/out: 202305/1062, packets in/out: 87/3, rtt: 0.349s, retransmitted packets: 0, out-of-order packets: 0
xctest fehler 14:18:30.797555+0100 <Beschreibung fehlt> Task <D405B35A-3E89-4D26-9ABC-EF9207FB4BB6>.<1> finished with error - code: -999
xctest fehler 14:18:36.572875+0100 aqme 177: timed out after 15.000s (0 1); suspension count=0 (IOSuspensions: )
xctest standard 14:18:36.573256+0100 aqme 390: AQME device AQDefaultDevice: client stopping after failed start: <CA_UISoundClientBase@0x7ffe4a2560f0>; running count now 0
xctest fehler 14:18:36.573558+0100 <Beschreibung fehlt> 239: CA_UISoundClientBase::StartPlaying: AddRunningClient failed (status = -66681).
xctest standard 14:18:36.577838+0100 aurioc 1366: Starting AURemoteIO(0x7ffe4d000a40)
output client: 2 ch, 44100 Hz, Float32, non-inter, output HW: 2 ch, 44100 Hz, Float32, non-inter
input client: 2 ch, 0 Hz, Int16, inter, input HW: 2 ch, 0 Hz, Int16, inter
xctest standard 14:18:36.578069+0100 aurioc 1376: work interval port 0x0
xctest standard 14:18:36.579318+0100 aqme 194: AQME device AQDefaultDevice: client starting: <RemoteIOClient@0x7ffe49813200(@0x7ffe498133e8); output; [11336]>; running count now 1
xctest standard 14:18:36.579504+0100 aqme 935: aqmeio@0x7ffe487b6700, device 0x58 (AQDefaultDevice), AudioDeviceStart (err 0)
xctest fehler 14:18:36.716367+0100 AudioHAL_Client HALB_IOBufferManager.cpp:226:GetIOBuffer: HALB_IOBufferManager::GetIOBuffer: the stream index is out of range
xctest fehler 14:18:36.716540+0100 AudioHAL_Client HALB_IOBufferManager.cpp:226:GetIOBuffer: HALB_IOBufferManager::GetIOBuffer: the stream index is out of range
xctest fehler 14:18:36.728912+0100 aqme 254: AQDefaultDevice (1): output stream 0: null buffer
xctest standard 14:18:36.729046+0100 <Beschreibung fehlt> 505: buffer 0 ptr 0x0 size 4096 expected 4096
xctest fehler 14:18:36.729125+0100 aqme 1433: EXCEPTION thrown (-50): -


Hope we can find a solution.
Florian
exactly same error on AudioOutputUnitStart(_audioUnit)


2020-12-04 16:49:56.178109+0600 SmartPTT Mobile POC[27425:428232] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.
2020-12-04 16:49:56.304682+0600 SmartPTT Mobile POC[27425:428630] AudioSession CONFIGURE
2020-12-04 16:49:56.587731+0600 SmartPTT Mobile POC[27425:428738] [AudioHALClient] HALBIOBufferManager.cpp:226:GetIOBuffer: HALBIOBufferManager::GetIOBuffer: the stream index is out of range
2020-12-04 16:49:56.588077+0600 SmartPTT Mobile POC[27425:428738] [AudioHAL
Client] HALBIOBufferManager.cpp:226:GetIOBuffer: HALBIOBufferManager::GetIOBuffer: the stream index is out of range
2020-12-04 16:49:56.604511+0600 SmartPTT Mobile POC[27425:428738] [aqme] 254: AQDefaultDevice (1): output stream 0: null buffer
2020-12-04 16:49:56.605534+0600 SmartPTT Mobile POC[27425:428738] [aqme] 1640: EXCEPTION thrown (-50): -



Same is happening with me for iOS 12.2. but it's running fine on iOS 14.3.
Code Block 2020-12-30 13:01:45.440277+0530 Easy Meditation[8040:217664] [AudioHAL_Client] HALB_IOBufferManager.cpp:226:GetIOBuffer: HALB_IOBufferManager::GetIOBuffer: the stream index is out of range
2020-12-30 13:01:45.440466+0530 Easy Meditation[8040:217664] [AudioHAL_Client] HALB_IOBufferManager.cpp:226:GetIOBuffer: HALB_IOBufferManager::GetIOBuffer: the stream index is out of range
2020-12-30 13:01:45.460926+0530 Easy Meditation[8040:217664] [aqme] 254: AQDefaultDevice (1): output stream 0: null buffer
2020-12-30 13:01:45.461163+0530 Easy Meditation[8040:217664] [aqme] 1640: EXCEPTION thrown (-50): -
2020-12-30 13:02:00.410118+0530 Easy Meditation[8040:217375] [aqme] 177: timed out after 15.000s (0 1); suspension count=0 (IOSuspensions: )
2020-12-30 13:02:00.412395+0530 Easy Meditation[8040:217375] 239: CA_UISoundClientBase::StartPlaying: AddRunningClient failed (status = -66681).
2020-12-30 13:02:00.493511+0530 Easy Meditation[8040:217900] [AudioHAL_Client] HALB_IOBufferManager.cpp:226:GetIOBuffer: HALB_IOBufferManager::GetIOBuffer: the stream index is out of range
2020-12-30 13:02:00.493689+0530 Easy Meditation[8040:217900] [AudioHAL_Client] HALB_IOBufferManager.cpp:226:GetIOBuffer: HALB_IOBufferManager::GetIOBuffer: the stream index is out of range
2020-12-30 13:02:00.505923+0530 Easy Meditation[8040:217900] [aqme] 254: AQDefaultDevice (1): output stream 0: null buffer
2020-12-30 13:02:00.506240+0530 Easy Meditation[8040:217900] [aqme] 1640: EXCEPTION thrown (-50): -
2020-12-30 13:02:15.458469+0530 Easy Meditation[8040:217895] [aqme] 177: timed out after 15.000s (1 2); suspension count=0 (IOSuspensions: )


No crash here but application grinds to a halt, using AVAudioSession and AVAudioPlayer.

App execution on iOS 12, 13 simulators immediately logs:

Code Block
2020-12-30 15:07:45.125612+0100 HALB_IOBufferManager_Client::GetIOBuffer: the stream index is out of range
2020-12-30 15:07:45.125793+0100 HALB_IOBufferManager_Client::GetIOBuffer: the stream index is out of range
2020-12-30 15:07:45.137752+0100 [aqme] AQME.h:254:IOProcFailure: AQDefaultDevice (1): output stream 0: null buffer
2020-12-30 15:07:45.137985+0100 AQMEIO_HAL.cpp:1774:IOProc: EXCEPTION thrown (-50): error != 0
2020-12-30 15:07:59.535460+0100 AQMEIO.cpp:179:AwaitIOCycle: timed out after 15.000s (0 1); suspension count=0 (IOSuspensions: )
2020-12-30 15:07:59.535868+0100 CA_UISoundClient.cpp:241:StartPlaying_block_invoke: CA_UISoundClientBase::StartPlaying: AddRunningClient failed (status = -66681).


After the 15 second timeout the app continues running until the next call to AVAudioSession or AVAudioPlayer.

On iOS 14, everything is fine. I hope this does not occur on real devices but could not test that.

Seeing this too. Any feedback from Apple on this?
No updates from Apple yet. I just keep revisiting this topic to see if anyone has any ideas.
I have the same issue on simulator, but works on real device.
Same symptoms as for SmartPTT and Wizfinger: playing audio freezes the app, same Console errors, happens on iOS < 14 on Simulator. I don't have test devices with older iOS, but some logging code I added to the app is reporting similar problems in live versions in the field.

This complaint shows up (with variants) all over the place. I am able to reproduce it in a from-scratch Xcode project, so I will be posting my code on Stackoverflow and asking DTS. I hope to have something more helpful to add here besides "Me too."
This has been acknowledged as a known issue by the Media Team in July 2020, more than 9 months ago (see link below)! No idea why this is still not fixed. Just because its only happening on the simulator doesn't mean this is not a serious issue. I don't have devices lying around with all previous iOS versions. Apple please take this seriously!

https://developer.apple.com/forums/thread/652852
Can't use iOS 13 simulator...
I had the same issue problem.
  • Test Environments

    • macOS : Catalina, BigSur OS

    • IDE : Xcode 12.4, 12.5 beta3

    • iOS 14+ device, simulator : fine

    • iOS 13 simulator : stuck

Still the same issue with XCode 12.5, why is this marked as solved??
Does it now crash with iOS 14.5 as well? Or I'm the only one so lucky?
Still having the grinding to a halt issue, using Xcode 12.5, testing on simulator running iOS 12.
Having the same issue. MacBook Air M1, Xcode 12.5, testing on simulator running iOS 14.5. How is this still not fixed? So many people are having issues with this! This is insane.

How can this still be an issue @Apple. Ever since Big Sur the backwards compatibility went to bits and pieces and required me to install Catalina on a different partition to test anything below below iOS 14. On top I can't run anything above 14.4 because of different issues. Its a mess.

Same story here. Simulators with iOS 12.2 crash and burn when initializing audio on

[AudioHAL_Client] HALB_IOBufferManager.cpp:226:GetIOBuffer: HALB_IOBufferManager::GetIOBuffer: the stream index is out of range

just like OP stated. I'm on Big Sur 11.6 and XCode 12.5.1

I downloaded the iOS 14.3 runtime and now it works. Not an acceptable solution and it's been 9 months since the OP. C'mon Apple, let's go.

Surprise, surprise! Yesterday I updated my macOS to Monterey Version 12.1. Today, with Xcode 13.1,

I can play audio in Simulators with iOS 12.4 as I described in this thread one year ago.

I suggest everybody to check if your problem is solved with macOS 12.1 as well.

Its Aug 2022 and this is still an issue. Our app needs to support iOS 12/13 and we have no way of effectively testing our app. So I guess the only way apple expects us to work is to feature flag our app and remove all audio components on app start via a launch argument? If anyone from apple will ever look here they will tell you, to create an issue report on their feedback site. The issue with that is that no is ever looking there either. Time is on their side, unfortunately for us devs who need to deal with these issues it is giant waste of time.

Simulator crashing with iOS &lt; 14. Started happening since Big Sur
 
 
Q