Thanks for responding Tamas. I will definitely report the bug. Would there be any work-arounds to this issue? Is there a way to change the default device if it is an aggregate prior to instantiating an AVAudioEngine? Chris
On Fri, Feb 9, 2018 at 2:58 PM, Tamas Nagy <[email protected]> wrote: > This is a known issue - at least DTS confirmed this is an AVFoundation bug > - , exists from 10.10 Yosemite if I can recall. Please report it at > bugreporter.apple.com. I’ve reported it around 6 months ago, but nothing > really happened since then. The more bug reports to more chance this will > be fixed in 10.14. > > Thanks! > > > On 2018. Feb 9., at 20:53, Christopher Baine <[email protected]> > wrote: > > 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: kAudioObjectProperty > ElementMaster) > 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: kAudioObjectPropertySc > opeOutput, 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 protected]) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/coreaudio-api/ > tamas.lov.nagy%40gmail.com > > This email sent to [email protected] > > >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com This email sent to [email protected]
