Re: Aggregate question device
Re: Aggregate question device
- Subject: Re: Aggregate question device
- From: Jeff Moore <email@hidden>
- Date: Tue, 17 Nov 2009 08:35:45 -0800
Please file a bug about that. Thanks!
On Nov 17, 2009, at 1:10 AM, Stéphane Letz wrote:
>>
>> Message: 11
>> Date: Mon, 16 Nov 2009 17:21:45 -0800
>> From: Jeff Moore <email@hidden>
>> Subject: Re: Aggregate question device
>> To: CoreAudio API <email@hidden>
>> Message-ID: <email@hidden>
>> Content-Type: text/plain; charset=iso-8859-1
>>
>> Sigh. What was still wrong was a bug in the HAL (which I also wrote up) where the attributes for all the sub-devices were not getting transferred over as part of the aggregate device's creation.
>>
>> To work around this bug, you will need to enable drift correction on each sub-device that needs it after you create the aggregate. You do this by getting the sub-devices of the aggregate using the property, kAudioObjectPropertyOwnedObjects. Then you set the property, kAudioSubDevicePropertyDriftCompensation, on each sub-devce as needed.
>>
>> Here's some code that does just turns on the drift correction for all the sub-devices (again using PublicUtility code to make it look easy):
>>
>> void TurnOnDriftCompensation(AudioObjectID inAggregateDeviceID)
>> {
>> // iterate through the sub-devices and turn on drift compensation
>> CAHALAudioDevice theAggregateDevice(inAggregateDeviceID);
>> UInt32 theNumberSubDevices = theAggregateDevice.GetNumberOwnedObjects(kAudioSubDeviceClassID);
>> CAAutoFree<AudioObjectID> theSubDevices(theNumberSubDevices);
>> theAggregateDevice.GetAllOwnedObjects(kAudioSubDeviceClassID, theNumberSubDevices, theSubDevices);
>> for(UInt32 theSubDeviceIndex = 0; theSubDeviceIndex < theNumberSubDevices; ++theSubDeviceIndex)
>> {
>> CAHALAudioObject theSubDevice(theSubDevices[theSubDeviceIndex]);
>> CAPropertyAddress theAddress(kAudioSubDevicePropertyDriftCompensation);
>> UInt32 theDriftCompensationValue = 1;
>> theSubDevice.SetPropertyData(theAddress, 0, NULL, sizeof(UInt32), &theDriftCompensationValue);
>> }
>> }
>
>
> OK got it working... but it seems Audio Midi Setup is a bit buggy : it does not show the "resample activated" state until it get closed and opened again...
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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