• 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: timestamps for usb audio device
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: timestamps for usb audio device


  • Subject: Re: timestamps for usb audio device
  • From: Jeff Moore <email@hidden>
  • Date: Wed, 19 May 2010 09:04:24 -0700

That error means that a clock that is supposed to be delivering time stamps representing a relatively constant rate (which USB devices are by default) has delivered a time stamp that is more than a millisecond earlier than what the HAL was expecting based on previous time stamps.

In other words, the HAL is flagging that time stamp as being significantly out of line with what had come previously. When this happens, it cause the HAL to rsynch to the new time line anchored by this time stamp. This often, but not always, will result in a glitch.

--

Jeff Moore
Core Audio
Apple


On May 19, 2010, at 7:52 AM, Jeff Schindler wrote:

> Hi Jeff - we ended up mirroring the code from the AppleUSBAudio driver for timestamp generation and seem to be getting fairly decent timestamps now, but we are seeing a periodic glitch (just over every 2 seconds).  I'm trying to glean some info on the glitch from HALLab - it is correlating with the glitch by reporting a bad/early (red) entry with the same period, but I'm having trouble placing any meaning on its output.  We get entries like enclosed - can you help with deciphering that?
>
> Thanks,
> Jeff
>
> <hallab.tiff>
>
>
> On May 12, 2010, at 3:06 PM, Jeff Moore wrote:
>
>> You really need to be generating your time stamps based on the interrupt times for the USB frame edges. Otherwise, you will have more noise than signal in your time stamps from the scheduling latency. If I remember right, the driver for the controller stashes the host time for the frame edge somewhere in it's data structures. I'm not a USB expert, so you'd probably need to dig through the documentation and headers to find out more info about where to look for the value.
>>
>> But once you know the time for the frame edges, you can build up an interpolator to get a good estimate for the time when the ring buffer wraps from the middle of a frame. Of course, if you can arrange to have your ring buffer occupy a whole number of USB frames, so much the easier.
>

 _______________________________________________
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

References: 
 >timestamps for usb audio device (From: Jeff Schindler <email@hidden>)
 >Re: timestamps for usb audio device (From: Jeff Moore <email@hidden>)

  • Prev by Date: Re: Does OS X limit USB audio devices to 16 bits of resolution?
  • Next by Date: Deploying an AU on ppc
  • Previous by thread: Re: timestamps for usb audio device
  • Next by thread: Re: timestamps for usb audio device
  • Index(es):
    • Date
    • Thread