AVAudioEngine: audio input does not work on iOS 17 simulator

Hello,

I'm facing an issue with Xcode 15 and iOS 17: it seems impossible to get AVAudioEngine's audio input node to work on simulator.

  • inputNode has a 0ch, 0kHz input format,
  • connecting input node to any node or installing a tap on it fails systematically.

What we tested:

  • Everything works fine on iOS simulators <= 16.4, even with Xcode 15.
  • Nothing works on iOS simulator 17.0 on Xcode 15.
  • Everything works fine on iOS 17.0 device with Xcode 15.

More details on this here: https://github.com/Fesongs/InputNodeFormat

Any idea on this? Something I'm missing?

Thanks for your help 🙏

Tom

PS: I filed a bug on Feedback Assistant, but it usually takes ages to get any answer so I'm also trying here 😉

Replies

Started facing the same issue today after updating simulator to iOS 17.0

This is what I get if I try to log the inputNode.outputFormat(forBus: 0)

<AVAudioFormat 0x6000022ca8a0:  2 ch,      0 Hz, Float32, deinterleaved>

I have not been able to test on an iOS 17 device yet. Will update.

Got the same problem when updating simulator to iOS 17.0.1. App crashed with a "SetProperty: RPC timeout. Apparently deadlocked. Aborting now." error. Code works fine on a 16.0 simulator.

Same issue. iPhone 15 Pro Max Simulator, iOS 17.0.1 - Deadlock when calling AudioUnitInitialize in tests. The app works fine on physical device with iOS 17. Also, the tests pass on iOS 16.4 Simulator. The deadlock is preceded with some warnings, here's how it looks like in console log:

2023-11-29 16:13:08.950085+0000 xctest[8838:88018] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x6000003f64e0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2023-11-29 16:13:09.013816+0000 xctest[8838:88068]             HALSystem.cpp:2216   AudioObjectPropertiesChanged: no such object
2023-11-29 16:13:09.014314+0000 xctest[8838:88068]         HALB_MachPort.cpp:174    HALB_MachPort::DestroyPort: not going to destroy anything this way
2023-11-29 16:13:18.014192+0000 xctest[8838:88036] [default] SetProperty: RPC timeout. Apparently deadlocked. Aborting now.

Did anyone of you ever find a solution to this or at least some feedback from Apple? :) This is drving me nuts. All my projects using ADM will get this deadlock and the REAL issue is that debugging on a live device after iOS 17 is unbearably slow, but the simulator is REALLY FAST making that my go-to nowadays...

You need to activate the AudioSession.

I have added the following line to your code sample from github

        try! AVAudioSession.sharedInstance().setActive(true)

after the setCategory line. Then it works for me on an iOS 17.2 simulator.

I can confirm that your code works on iOS 16.4 Simulator without setActive. Not sure why, as my understanding is it has always been the intended way of doing stuff using setActive.

  • Already had this line in my code, and moving it didn't effectuate anything -- what resolved the issue in my case was initiating any taps after setting the category and setting to active.

Add a Comment