Hello,

I am working with a group on PortAudio, a simple cross-platform open-source
audio API. We currently support Windows, Mac, BeOS, SGI, and, of course,
Unix.

Folks have been reporting audio glitches even with a buffer size equivalent
to 100 msec. I have experimented with setting my thread priority to the max
for SCHED_FIFO and that seems to eliminate the glitches. I can get down to
around 5 or 10 msec latency on RedHat 7.2, even without any low-latency
patches. But I have to run as superuser.

I have heard reports that SCHED_FIFO has several bugs. I have searched the
web and read many posts about this but there are still unanswered questions.

Q: Do the SCHED_FIFO bugs prevent a simple use of sched_setscheduler() to
bump the priority of a thread that is reading and writing to OSS? I want the
code to work on old systems as well as new.

Q: Does SCHED_RR work better than SCHED_FIFO? Fewer bugs?

Q: I have code that throttles back if I consume too much CPU time. Is that
sufficient?

Q: Can I safely use the value from sched_get_priority_max(SCHED_FIFO) or
should I use less?

Thanks,
Phil Burk
JSyn,pForth,DSP,ASIC - http://www.softsynth.com
Portable Audio I/O   - http://www.portaudio.com
Interaction Server   - http://www.transjam.com


Reply via email to