It's not clear why the number of the owning sub-devices in the created
aggregate device is less than 2, after setting sub devices from input
and output sides via AggregateDevice::set_sub_devices_sync. The
sub-devices should be set synchronously when the above function is
called. Maybe kAudioObjectPropertyOwnedObjects is not synchronous or
symmetric to kAudioAggregateDevicePropertyFullSubDeviceList, which is
the property set in AggregateDevice::set_sub_devices_sync.
If the sub devices are less than 2 (we should have at least one input
and one output) in AggregateDevice::activate_clock_drift_compensation,
the AggregateDevice::new should bail out with an error returned. Then
the cubeb stream can follow the fallback mechanism to create a duplex
stream without using an aggregate-device.
This works around the crash in BMO 1677766.
It's not clear why the number of the owning sub-devices in the created aggregate device is less than 2, after setting sub devices from input and output sides via
AggregateDevice::set_sub_devices_sync
. The sub-devices should be set synchronously when the above function is called. MaybekAudioObjectPropertyOwnedObjects
is not synchronous or symmetric tokAudioAggregateDevicePropertyFullSubDeviceList
, which is the property set inAggregateDevice::set_sub_devices_sync
.If the sub devices are less than 2 (we should have at least one input and one output) in
AggregateDevice::activate_clock_drift_compensation
, theAggregateDevice::new
should bail out with an error returned. Then the cubeb stream can follow the fallback mechanism to create a duplex stream without using an aggregate-device.