• 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: hardware output latency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hardware output latency


  • Subject: Re: hardware output latency
  • From: Jeff Moore <email@hidden>
  • Date: Fri, 19 May 2006 12:08:51 -0700

The total latency for a given stream on the device is the sum of the device latency and the stream latency. This means that a given device can have different amounts of latency for each of it's streams.

From <CoreAudio/AudioHardware.h>:

@constant kAudioDevicePropertyLatency
A UInt32 containing the number of frames of latency in the AudioDevice. Note
that input and output latency may differ. Further, the AudioDevice's
AudioStreams may have additional latency so they should be queried as well.
If both the device and the stream say they have latency, then the total
latency for the stream is the device latency summed with the stream latency.



@constant kAudioStreamPropertyLatency
A UInt32 containing the number of frames of latency in the AudioStream. Note
that the owning AudioDevice may have additional latency so it should be
queried as well. If both the device and the stream say they have latency,
then the total latency for the stream is the device latency summed with the
stream latency.



On May 19, 2006, at 3:52 AM, Steve Checkoway wrote:

After rereading
http://lists.apple.com/archives/coreaudio-api/2004/Oct/msg00261.html
(and I can't believe that I remembered this post in the first place) and looking at my code, I realize that perhaps I misunderstood when I first wrote it. I was assuming that the out_hw_latency was the sum of the device latency and the stream latency. Looking at the numbers reported, this seems incorrect as they are the same.


Should I be using the sum, the max, or just one of them (in addition to the safety offset and buffer size, of course) in my latency calculation?

Actually, reading
http://lists.apple.com/archives/coreaudio-api/2004/Oct/msg00135.html
makes me wonder if I should even be using the safety offset in the latency calculation. That calculation is used for "start mixing sound x such that it will become audible exactly at time y."


I realize this has been beaten to death on this list over the past few years and I apologize. I'd like to just get this right and not worry about it any more. Frankly, I can't hear any differences that small, but that doesn't mean that no one can.


--

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
  • Follow-Ups:
    • Re: hardware output latency
      • From: Steve Checkoway <email@hidden>
References: 
 >hardware output latency (From: Steve Checkoway <email@hidden>)

  • Prev by Date: hardware output latency
  • Next by Date: Re: Problems setting sample rate
  • Previous by thread: hardware output latency
  • Next by thread: Re: hardware output latency
  • Index(es):
    • Date
    • Thread