Re: Multi-threading and glitchless audio
Re: Multi-threading and glitchless audio
- Subject: Re: Multi-threading and glitchless audio
- From: Kurt Revis <email@hidden>
- Date: Thu, 27 Feb 2003 16:01:40 -0800
On Thursday, February 27, 2003, at 11:48 AM, Amar wrote:
Yes, using pthread priority 63 over the time-constraint method does
appear
to improve the situation greatly in that glitches are fewer and farther
between, although they still occur. It appears to correlate mostly
with
screen redraws, excessive mouse activity, and disk activity. The
worst is
switching between windows of the application. Is it possible that
these
activities are causing the 63 thread to be late? Or do I still need
to use
one of mach APIs rather than the pthread API to properly handle the
thread
priorities?
I don't know exactly how the pthread priority API maps to the real
(Mach) thread priority API, but it's possible that pthread priority 63
is not doing everything you could do from Mach.
(The pthread source is available in the Libc project, which you can
download here:
http://www.opensource.apple.com/projects/darwin/6.0/projects.html
so you could easily check for yourself.)
The important thing is to turn off timesharing on your thread. This
makes the scheduler keep the thread's real priority constant, instead
of adjusting it dynamically. This tends to make much more of a
difference in practice than just changing the thread's priority. The
code I linked to earlier demonstrates how to do this.
--
Kurt Revis
email@hidden
_______________________________________________
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.