RE: inOutputTime accuracy?
RE: inOutputTime accuracy?
- Subject: RE: inOutputTime accuracy?
- From: Jim Dolan <email@hidden>
- Date: Thu, 15 Aug 2002 15:55:50 -0400
Hi Jeff -
I am a little confused - The inOutputTime.mSampleTime should increment by
the sample frame size every cycle. It won't matter how long I wait to take
an anchor, because the sample time always increases with this regularity.
If this is not the case won't we wind up with gaps or overlaps? What you
are saying is that the latency is dependant on the driver and the hardware.
How can I ever be able to determine exactly when the first sample will be
played if I support multiple devices or systems?
Jimmy D
-----Original Message-----
From: Jeff Moore [
mailto:email@hidden]
Sent: Thursday, August 15, 2002 3:37 PM
To: CoreAudio (E-mail)
Subject: Re: inOutputTime accuracy?
You need to account for the latency of the hardware too. The output
time stamp passed in to your IOProc reflects the driver's safety
offset, but not the latency in the hardware.
One other thing I would do is to start the hardware and let it run for
a few cycles before taking your anchor point. The math in the HAL
really needs 2 time stamps from the driver before it can be locked on
to the true sample rate of the hardware. This makes the first go around
somewhat inaccurate by the difference between the nominal and the
actual sample rates.
On Thursday, August 15, 2002, at 07:08 AM, Jim Dolan wrote:
>
Hi -
>
>
My application needs to keep track of the sample position as it is
>
playing.
>
During the first output IOProc I take inOutputTime.mSampleTime and use
>
that
>
as an initialOffsetTime to the first sample that will be played.
>
Later when
>
I check for the sample position I ask the device for the current time
>
and if
>
the current time has passed the initialOffsetTime I know that we are
>
now
>
playing samples and can start incrementing the composition sample
>
position.
>
The sample position is roughly the currentTime - initialOffsetTime.
>
This
>
seems to work fine except that I do not think that the original
>
inOutputTime.mSampleTime is accurate. I am trying to sync audio to
>
video
>
and I notice that I need to substract 3k samples from that initial
>
offset to
>
get them to line up. As though the first sample is being played
>
earlier than
>
I was told in the IOProc. Once we begin, the relative accuracy from
>
IOProc
>
to IOProc is very good, but the start time seems wrong. I am using a
>
4096
>
sample frame size.
>
>
Is there a bug here or is there something that I am still not
>
accounting
>
for?
>
>
>
Thanks for your help...
>
>
Jimmy D.
>
_______________________________________________
>
coreaudio-api mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
>
Do not post admin requests to the list. They will be ignored.
>
>
--
Jeff Moore
Core Audio
Apple
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.