• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Aggregate question device
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aggregate question device


  • Subject: Re: Aggregate question device
  • From: Stéphane Letz <email@hidden>
  • Date: Tue, 17 Nov 2009 10:10:08 +0100


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">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...

Thanks for the help.

Stéphane Letz
 _______________________________________________
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

  • Follow-Ups:
    • Re: Aggregate question device
      • From: Jeff Moore <email@hidden>
  • Prev by Date: Re: AU Presets for multiple plugins
  • Next by Date: Re: AU Presets for multiple plugins
  • Previous by thread: Re: Aggregate question device
  • Next by thread: Re: Aggregate question device
  • Index(es):
    • Date
    • Thread