AVAudioEngine outputNode crash

I have a very simple audio graph, using AVAudioEngine, with a single AVAudioPlayerNode.

The setup is rather straightforward :


- alloc/init the engine

- alloc/init the audio player node

- attach the player node to the graph

- connect the player node to the engine's output node


This last step constatly crashes whenever the system audio output is a mutiple output device or an aggregate audio device.

The exception logs this in the console :


[General] An uncaught exception was raised
[General] required condition is false: isInput ? auv3().canPerformInput : auv3().canPerformOutput


Anyone knows how to handle this ?

The crash occurs when the code try to access the engine's output node (which is created in the process)


You can reproduce this in a playground with 3 lines of code, after creating an aggregate device, and selecting it for audio output.


import AVFoundation
let engine = AVAudioEngine()
let output = engine.outputNode



Thanks for any tips

Accepted Reply

Just to follow up on this:


Using an aggregate device in an AVAudioEngine node graph isn't supported. The fact that it crashes instead of giving you an error message can be regarded as a bug. Your bug report #42652556 is tracking the issue.

Replies

It would be very helpful if you could create a bug report for this, and post the bug number here for reference.

So did I !

Bug report #42652556

Just to follow up on this:


Using an aggregate device in an AVAudioEngine node graph isn't supported. The fact that it crashes instead of giving you an error message can be regarded as a bug. Your bug report #42652556 is tracking the issue.

Alright.

Apple updated the bug report, saying it's a duplicate of bug #35592572

I can't reproduce this crash anymore under macOS beta 10.14.1 (18B73a).

Although I still can't hear anything, this is a lot better.

Why isn't that supported? What is it that make aggregate devices more complex in AVAudioEngine?