Cannot use AVAudioPlayer in simulator in Xcode 12 beta 3

This might relate to a similar problem I had with the first beta, where trying to use an AVAudioPlayer caused the app to hang and spit out a lot of errors and not really work. This was resolved in beta 2 but beta 3 has reverted back to the old behaviour where trying to call prepareToPlay() or play() on a valid AVAudioPlayer instance causes lots of error output (and no sound).

Additionally, trying to call prepareToPlay() during an onAppear{ } block for the root view of a SwiftUI app appears to block the main thread while all of this error output is being spat out and causes a significant delay in app launch.

I've been able to reproduce this bug in a very simple example app. I have filed a feedback: FB8116155

This is an example of the sort of errors I'm getting:
https://gist.github.com/lukeredpath/e9485d0d83e6b5f7acea2eedb98e144c

Is anyone else able to reproduce this or having similar problems?
I can also confirm that this is still there in Beta 4. Audioplayer init causes these errors in the simulator.

Code Block language
Warning: Error creating LLDB target at path '/Users/MyDeveloperPath/Temp/Build/Homeseer-ffffjqolyjxrnlbnuhehzjfmpmws/Build/Products/Debug-iphonesimulator/HS4.app'- using an empty LLDB target which can cause slow memory reads from remote devices.
2020-08-09 20:53:24.798020-0400 HS4[19985:1381381] libMobileGestalt MobileGestaltCache.c:38: No persisted cache on this platform.
2020-08-09 20:53:30.748666-0400 HS4[19985:1380170] HALCADClient::ConnectToServer: failed to find the AHS sub-server port, Error: 0x10004003
2020-08-09 20:53:35.749000-0400 HS4[19985:1380170] HALCADClient::ConnectToServer: failed to find the AHS sub-server port, Error: 0x10004003
2020-08-09 20:53:35.749352-0400 HS4[19985:1380170] HALDefaultDevice::Initialize: couldn't add the default input device listener, Error: 268451843 (\^P)
2020-08-09 20:53:40.750540-0400 HS4[19985:1380170] HALCADClient::ConnectToServer: failed to find the AHS sub-server port, Error: 0x10004003
2020-08-09 20:53:40.750906-0400 HS4[19985:1380170] HALDefaultDevice::Initialize: couldn't add the default output device listener, Error: 268451843 (\^P)
2020-08-09 20:53:45.752149-0400 HS4[19985:1380170] HALCADClient::ConnectToServer: failed to find the AHS sub-server port, Error: 0x10004003
2020-08-09 20:53:45.752563-0400 HS4[19985:1380170] HALDefaultDevice::Initialize: couldn't add the default system output device listener, Error: 268451843 (\^P)
2020-08-09 20:53:50.753751-0400 HS4[19985:1380170] HALCADClient::ConnectToServer: failed to find the AHS sub-server port, Error: 0x10004003
2020-08-09 20:53:50.753981-0400 HS4[19985:1380170] HALDefaultDevice::Initialize: couldn't add the default shared output device listener, Error: 268451843 (\^P)
2020-08-09 20:53:50.754989-0400 HS4[19985:1380170] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600003634e60> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2020-08-09 20:53:50.756684-0400 HS4[19985:1380170] Error loading /Library/Audio/Plug-Ins/HAL/BartenderAudioPlugIn.plugin/Contents/MacOS/BartenderAudioPlugIn: dlopen(/Library/Audio/Plug-Ins/HAL/BartenderAudioPlugIn.plugin/Contents/MacOS/BartenderAudioPlugIn, 262): no suitable image found. Did find:
/Library/Audio/Plug-Ins/HAL/BartenderAudioPlugIn.plugin/Contents/MacOS/BartenderAudioPlugIn: mach-o, but not built for platform iOS-sim
2020-08-09 20:53:50.756915-0400 HS4[19985:1380170] [plugin] Cannot find function pointer New_SHP_PlugIn for factory <CFUUID 0x600003634500> 834FC054-C1CC-11D6-BD01-00039315CD46 in CFBundle/CFPlugIn 0x7fa565019c70 </Library/Audio/Plug-Ins/HAL/BartenderAudioPlugIn.plugin> (bundle, not loaded)
2020-08-09 20:53:50.757190-0400 HS4[19985:1380170] AudioObjectSetPropertyData: no object with given ID 0
2020-08-09 20:53:50.757379-0400 HS4[19985:1380170] 83: Failed to set processVolumeScalar on device. Error: 560947818
2020-08-09 20:53:55.924562-0400 HS4[19985:1382805] HALCADClient::ConnectToServer: failed to find the AHS sub-server port, Error: 0x10004003
2020-08-09 20:53:55.925082-0400 HS4[19985:1382805] HALCADClient::GetPropertyData: unknown property
2020-08-09 20:53:55.925347-0400 HS4[19985:1382805] [ddagg] AggregateDevice.mm:800 couldn't get default input device, ID = 0, err = 0!
2020-08-09 20:54:00.927012-0400 HS4[19985:1382805] HALCADClient::ConnectToServer: failed to find the AHS sub-server port, Error: 0x10004003
2020-08-09 20:54:00.927255-0400 HS4[19985:1382805] HALCADClient::GetPropertyData: unknown property
2020-08-09 20:54:00.927365-0400 HS4[19985:1382805] [ddagg] AggregateDevice.mm:800 couldn't get default output device, ID = 0, err = 0!
2020-08-09 20:54:00.927567-0400 HS4[19985:1382805] [aqme] 352: error -66680 finding/initializing Device.AQDefaultDevice
2020-08-09 20:54:00.927709-0400 HS4[19985:1382805] 111: * * * NULL AQIONode object
2020-08-09 20:54:00.927757-0400 HS4[19985:1380170] [aqme] 352: error -66680 finding/initializing Device.AQDefaultDevice
2020-08-09 20:54:00.927858-0400 HS4[19985:1382805] 848: Can't make UISound Renderer
2020-08-09 20:54:00.927847-0400 HS4[19985:1380170] [AQ] 1899: failed (-66680); will stop (12000/0 frames)
2020-08-09 20:54:00.928927-0400 HS4[19985:1380170] AudioDeviceStop: no device with given ID
2020-08-09 20:54:00.929094-0400 HS4[19985:1380170] [aqme] 352: error -66680 finding/initializing Device.AQDefaultDevice
2020-08-09 20:54:00.929225-0400 HS4[19985:1380170] [AQ] 1899: failed (-66680); will stop (12000/0 frames)
2020-08-09 20:54:00.997159-0400 HS4[19985:1382805] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
code-block


Please refresh my memory,

What is the official way of submitting a bug issue to Apple Dev?

Still a problem in beta 5, albeit with less verbose error output:

Code Block
2020-08-20 17:19:39.345417+0100 Poker Clock[4805:114176] libMobileGestalt MobileGestaltCache.c:38: No persisted cache on this platform.
2020-08-20 17:19:39.503469+0100 Poker Clock[4805:113574] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x6000027cd3a0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2020-08-20 17:19:51.054637+0100 Poker Clock[4805:114341] HALC_ProxyIOContext::IOWorkLoop: the server failed to start, Error: 0x6E6F7065
2020-08-20 17:20:06.055809+0100 Poker Clock[4805:114182] [aqme] 182: timed out after 15.000s (0 0); suspension count=0 (IOSuspensions: )
2020-08-20 17:20:06.056062+0100 Poker Clock[4805:114182] 244: CA_UISoundClientBase::StartPlaying: AddRunningClient failed (status = -66681).
2020-08-20 17:20:23.260456+0100 Poker Clock[4805:115401] HALC_ProxyIOContext::IOWorkLoop: the server failed to start, Error: 0x6E6F7065
2020-08-20 17:20:38.261055+0100 Poker Clock[4805:113574] [aqme] 182: timed out after 15.000s (0 0); suspension count=0 (IOSuspensions: )

Why is this still a problem. We recently tried to migrate our build machines to an m1 Mac mini and run into the exact problem with the sims. Its absolutely mind boggling that this issue is still around and there is ZERO acknowledgment from apple side. For us we had to disable all sounds / videos using AVFoundation to get our tests to run, which absolutely unacceptable.

Cannot use AVAudioPlayer in simulator in Xcode 12 beta 3
 
 
Q