AVAudioEngine Aggregate Device Crash
AVAudioEngine Aggregate Device Crash
- Subject: AVAudioEngine Aggregate Device Crash
- From: Christopher Baine <email@hidden>
- Date: Fri, 09 Feb 2018 14:53:24 -0500
Hello all,
I am having an issue with AVAudioEngine starting with an Aggregate Device
as the default output device. Below is my sample code, which works fine
with any other output card selected. When I select an aggregate as my
default device in the System Preferences, it crashes on the
engine.connect() call. I am on 10.13.1, and am having the same issue on
10.12.6
import Cocoa
import AVFoundation
class ViewController: NSViewController {
let engine = AVAudioEngine()
let player = AVAudioPlayerNode()
override func viewDidLoad() {
super.viewDidLoad()
addPlayer()
startEngine()
}
func addPlayer() {
engine.attach(player)
engine.connect(player, to: engine.outputNode, format: nil)
}
func startEngine() {
do {
try engine.start()
}
catch {
print("ERROR", error)
}
}
Here is the log:
*2018-02-09 13:53:53.014046-0500 TEST_AVEngineAggregate[18127:655111]
[DDAgg] DefaultDeviceAggregate.cpp:58:GetPreferredStereoChannels: Error
getting preferred stereo channels from device 206: 'who?'*
*2018-02-09 13:53:53.014208-0500 TEST_AVEngineAggregate[18127:655111]
[DDAgg] DefaultDeviceAggregate.cpp:108:GetPreferredChannelLayout: Error
getting preferred channel layout from device 206: 'who?'*
*2018-02-09 13:53:53.015634-0500 TEST_AVEngineAggregate[18127:655111]
[avae] AVAEInternal.h:69:_AVAE_Check: required condition is false:
[AUInterface.mm:678:EnableIO: (isInput ? auv3().canPerformInput :
auv3().canPerformOutput)]*
*2018-02-09 13:53:53.017059-0500 TEST_AVEngineAggregate[18127:655111]
[General] An uncaught exception was raised*
*2018-02-09 13:53:53.017075-0500 TEST_AVEngineAggregate[18127:655111]
[General] required condition is false: isInput ? auv3().canPerformInput :
auv3().canPerformOutput*
*...*
I have tried checking to see if the preferedChannelLayout, or the
preferredStereoChannels is an issue, via:
func getOutputCardPrefferedChannels(id: AudioObjectID) {
var propAddress = AudioObjectPropertyAddress(mSelector:
kAudioDevicePropertyPreferredChannelsForStereo, mScope:
kAudioObjectPropertyScopeOutput, mElement: kAudioObjectPropertyElementMaster
)
var prop: Array<UInt32> = Array(repeating: 0, count: 2)
var propertySize: UInt32 = UInt32(MemoryLayout.size(ofValue: prop))
let err = AudioObjectGetPropertyData(id, &propAddress, 0, nil,
&propertySize, &prop)
print(err, prop)
}
func getOutputCardPrefferedChannelLayout(id: AudioObjectID) {
var propAddress = AudioObjectPropertyAddress(mSelector:
kAudioDevicePropertyPreferredChannelLayout, mScope:
kAudioObjectPropertyScopeOutput, mElement: kAudioObjectPropertyElementMaster
)
var prop: AudioChannelLayout = AudioChannelLayout()
var propertySize: UInt32 = UInt32(MemoryLayout.size(ofValue: prop))
let err = AudioObjectGetPropertyData(id, &propAddress, 0, nil,
&propertySize, &prop)
print(err, prop)
}
Which prints:
****** AGGREGATE *********
*Aggregate Device*
*0 [1, 2]*
*0 AudioChannelLayout(mChannelLayoutTag: 0, mChannelBitmap:
__C.AudioChannelBitmap(rawValue: 0), mNumberChannelDescriptions: 4,
mChannelDescriptions: __C.AudioChannelDescription(mChannelLabel:
4294967295, mChannelFlags: __C.AudioChannelFlags(rawValue: 0),
mCoordinates: (0.0, 0.0, 0.0)))*
******* BUILT IN OUTPUT *********
*Built-in Output*
*0 [1, 2]*
*0 AudioChannelLayout(mChannelLayoutTag: 0, mChannelBitmap:
__C.AudioChannelBitmap(rawValue: 0), mNumberChannelDescriptions: 2,
mChannelDescriptions: __C.AudioChannelDescription(mChannelLabel:
4294967295, mChannelFlags: __C.AudioChannelFlags(rawValue: 0),
mCoordinates: (0.0, 0.0, 0.0)))*
These don't throw any errors.
The aggregate consists of the Built In Output, and SoundFlower 2ch. (So 4ch
output total) I have also tried making an aggregate with only the built-in
output as well as aggregates with other output cards, but it also crashes.
Any help or thoughts on where to begin troubleshooting this would be
greatly appreciated!
Thanks,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden