Realtime

From MusE Wiki

Jump to: navigation, search

There are several ways to get a good latency with the 2.6 linux kernel. I think that most of the audio folks is now jumping into 2.6 and due the lack of good documentation about how to install a realtime kernel i want to provide this here, not only for MusE related use.


Contents

Low latency patches from Ingo Molnar for 2.6 kernel

There you can also find some stuff on getting realtime priority for normal users and tune your hardware.

LSM module

This has been integrated into the linux kernel.org kernels for some time now and is working nearly out of the box. At least you don't have to install patches which is much more complicated compared to a single recompile.

We maintain a small installation guide here: Realtime-lsm_module

German manual:
http://gimpel.gi.funpic.de/Howtos/RTP_kernel/

Nice Gentoo documentation:
http://gentoo-wiki.com/HOWTO_Jack#About_the_JACK_use_flag

mail traffic

Here are some mails I've collected, maybe they give you some hints.

first mail

> i would like to take the chance to document what latency-methods are
> implemented and as far as i know it's:
> - libcaps (2.4 or 2.6 only?)
> - 2.4 preemptive patches (there is  a howto)
> - 2.6 lsm module

The libcap and lsm are not strictly for getting lowlatency but for allowing realtime threads from a program run by a normal user.

> is there more?
> i think a 2.6 preemptive patch is also being worked on lately.

Yes, even the standard (vanilla) kernel is catching up. I'm running the 2.6.10 with very good performance at this moment.

Though, I think what Erich is asking is only partly answered by this:

There are several kinds of latencies. The one described is the realtime latency between playing a sound and that it will reach the ear.

The other kind of latency is what happens when there are latencies introduced by different parts of the system. E.g. plugins can add latency.

MusE does not compensate for plugin latencies as far as I know. Recorded wav files I am unsure about. It has never been an issue for me.

If there is latency in the recording then it should be the same as the setting in Jack I think. buffersize*number_of_buffers

Mmm, this begs for some experimentation. How about recording the output of a softsynth to different tracks with different buffer setting, does this change the delay? I'll see if I can try that later.

/Robert

second mail

I realize I didn't quite answer the question as I wanted to.

About realtime:

libcap - realtime support for 2.4
suid binary - realtime support for 2.4 and 2.6
lsm-realtime - realtime support for 2.6 (best option)

About latency (this is a still a jungle...)

For 2.4 the standard kernel is not good enough. You need one of the patches, there are several, the ll-patch from Andrew Morton is the most used one. http://www.zipworld.com.au/~akpm/linux/schedlat.html

For 2.6 the standard kernel has since 2.6.10 been catching up and has very good lowlatency capabilities if 'desktop-preemption' is enabled.

There is also a patch from Ingo Molnar that supposedly gives _extreme_ reliability with a correctly tuned system though this seems black magic to set up. http://people.redhat.com/mingo/realtime-preempt/

I was hoping to find some more info in the alsa wiki but I wasn't really... http://alsa.opensrc.org/

Regards, Robert

Personal tools