[linux-audio-user] Re: Latency with ALSA

Norbert Wolff norbert_wolff at t-online.de
Wed Apr 2 06:30:59 EST 2003


On 01 Apr 2003 22:57:28 -0500
Nick <nicktsocanos at charter.net> wrote:

> I am writing audio applications that are real-time.
> I had been using Port Audio which is really very good, even without root
> priviledges, it does a very good job. I want to support other sound
> drivers, in case someone doesn't have Port Audio or can't get it to
> work.
> 
> I have just built my ALSA driver, it works ok, but I am getting terrible
> latency problems and buffer underruns. The thing is it is a real-time
> application, it must get audio to the card as soon as possible.  Why is
> it that OSS with Port Audio works so well, and my ALSA setup is
> suffering?
> 
> Is there something I need to do to ALSA to get near real-time
> performance from it? I have heard people mention patching their kernel
> for low latency. I have Jack but I have not started working with it yet.
> Should I dump ALSA and just go for Jack? Is there something I need to do
> to my kernel to get better performance? I would get Planet CCRMA if it
> supported my OS, but it doesn't, so I have to tweak my box manually.

High Nick !

At the moment there are two different approaches for low-latency in the
linux-kernel.

The first is from Ingo Molnar; it's quite simple but efficient (conditional
scheduling at critical places).
You can get it at
 http://people.redhat.com/mingo/lowlatency-patches/lowlatency-2.4.0-test7-A0

The second is made by Robert Love, it makes real heavy Changes in the Kernel
which have a noticeable negative impact on overall System-througput, but the
results are quite amazing !

The Patch is integrated int the 2.5-Kernel (CONFIG_PREEMPT), patches for 2.4
are available at
 ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/

I use Robert's patch with the 2.5-Kernel since half a year without Problems;
The interactive response of the Sytem under high loads is now MUCH better.
Lacking real real-time Software i don't know if it helps there too.

If the low-latency patches for the Kernel don't cure your Problem, consider
testing a new 2.5.6x-Kernel; the scheduler was really improved in the last
months ...




More information about the Linux-audio-user mailing list