Re: Core Audio maximum clock error (Mark Moore)
Re: Core Audio maximum clock error (Mark Moore)
- Subject: Re: Core Audio maximum clock error (Mark Moore)
- From: Mark Moore <email@hidden>
- Date: Wed, 16 Jan 2013 17:36:40 +0100
Hi Gordon,
The driver is using implicit feedback. It is generating the correct output rate, based on USB traces and based on debug code that logs that output sample rate. The clock is propagated to the application HAL layer via takeTimeStamp(), and the timestamps appear to be accurate (code based on AppleUSBAudio's USB timing).
However, once per IO buffer wrap, the HAL seems to skip ahead as if catching up, though no actual errors are logged in the HALLab telemetry (which, incidentally, seems to be missing from Xcode 4...).
I seem to be able to work-around the problem in the USB driver by calling IOAudioEngine::hardwareSampleRateChanged() with the new calculated rate. Doing so causes a brief pause in the stream so I only want to do this as a last resort.
So I guess the questions are:
- is there a limit on the maximum clock error that CoreAudio supports?
- is takeTimeStamp() sufficient to synchronise user/kernel space clocks?
Thanks,
-- Mark
On 14 Jan 2013, at 22:28, Gordon Rankin <email@hidden> wrote:
> Mark,
>
> I do a ton of async USB audio stuff.
>
> Mark, if you advertise 48Khz and Adaptive then it is up to you to create a PLL or other moving Master Clock that matches the computer. That is how the flow control for adaptive works. What you want to do is either enumerate at 50KHz & adaptive or use Asynchronous USB Audio (see class 1 specification on USB.org) and make sure your feedback pipe fills at a rate that keeps your buffers filled at the endpoint. If you have a fixed Master Clock = 50KHz sampling then Async is your best bet.
>
> Thanks,
> Gordon
> Wavelength Audio
_______________________________________________
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