Re: Speeding HAL plugin loop rate
Re: Speeding HAL plugin loop rate
- Subject: Re: Speeding HAL plugin loop rate
- From: Jeff Moore <email@hidden>
- Date: Mon, 19 Jan 2009 11:14:21 -0800
I don't know where to begin with what's wrong with what you are
proposing to do with the time stamps in the IO thread. Suffice to say,
doing what you describe (in essence, divorcing the IO thread from
reality) is basically breaking most of the promises an audio device
makes about how it deals with time.
Why don't we back up a bit and start off with what you are doing.
You've been asking questions on a few fronts and I'm not getting a
good sense of what you are trying to accomplish that would lead to
questions like this. Perhaps if I had a better idea, I could provide
better advice.
On Jan 19, 2009, at 5:54 AM, Mike Kluev wrote:
On Tue, 06 Jan 2009 12:31:00 Jeff Moore <email@hidden> wrote:
How are you measuring this? It sounds like you are just counting
time between calls to an IOProc, which is not the way to track the
time since those measurements would include any scheduling latency.
I measure time between calls and average this time over a period
of several seconds. The latency between calls is almost the same
and small variations to latencies should become close to zero by
averaging, no?
FWIW, the timing code the the SampleHardwarePlugin does all it's
math assuming a rate scalar of 1.0. You can see this in how
SHP_Device::TranslateTime is implemented.
I found that if I make small adjustments to the outNextWakeUpTime
within HP_Thread::CalculateNextWakeUpTime I can speed or slow down
the rate of I/O proc:
....
theSampleTime.mSampleTime -= myDeltaSamples;
mDevice->TranslateTime(theSampleTime, outNextWakeUpTime);
theSampleTime.mSampleTime += myDeltaSamples;
....
This works, but again, I haven't done thorough testing.
Is this a no-no for some reason?
--
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