time constraint policy and audio proc calls
time constraint policy and audio proc calls
- Subject: time constraint policy and audio proc calls
- From: Benjamin Golinvaux <email@hidden>
- Date: Fri, 16 Nov 2001 15:09:56 +0100
Hi,
There is something I don't understand regarding the time constraint
policy.
Let's say I have a CoreAudio thread which copies data from an internal
buffer to the audio buffer that's passed to the audioIOProc callback.
Each time an audio buffer is read by the hardware, this thread posts
a message to another thread that needs to fill this buffer (for example,
a thread that reads data off a disk file).
So, this secondary thread should also have high priority (higher than
Window Server) so that it doesn't block the coreaudio thread, which
means,
according to what I've read, it needs to be promoted to time constraint
scheduling policy.
But the time parameters of the thread ("period", "computation" and
"constraint") are specified using processor ticks. But this is not
exactly what we need : since this thread is synchronized with the
CoreAudio thread (it wakes up when the CoreAudio thread posts a message),
its period cannot be specified in processor ticks since there can be
a drift over time between the audio clock (audio hardware hardware clock)
and the processor clock.
How are we supposed to solve this problem ? Is there a way to re-trigger
the period at each thread wakeup ?
Thanks for some advice,
Benjamin Golinvaux
www.arboretum.com