Realtime scheduling for non-root users
From FreeBoB
On standard distributions, normal users are not allowed to request realtime scheduling for their programs. Due to system safety issues (denial of service), only root can request this priority. However it is not a good idea to run normal applications as root. To allow ordinary users to request realtime scheduling, you have to install some extra packages.
realtime_lsm (not recommended for new kernels)
From Danni Coy danni . coy at gmail dot com
To get rid of the pops you really need to be running Jack in realtime mode. On debian based systems the easiest way to do this is to install the realtime_lsm package. Download the source from SourceForge (http://sourceforge.net/project/showfiles.php?group_id=106645) Also note that latency is really bad in Freewheeling prior to version 0.52... This has nothing to do with Jack or Freebob. version 0.52 and 0.52a are lot easier to use. with Realtime LSM installed I use jackd -R -P80 -dfreebob -r96000 -p128 (or -p256) fweelin + firebox is quite usuable on these settings.
rtlimits
realtime_lsm is replaced by a rtlimits/PAM approach in more recent kernels. The following is copied from the Linux Audio Users' Guide at http://lau.linuxaudio.org/faq/index.php/Capabilities.
Recent 2.6.x kernel versions have integrated realtime capabilities into the ulimit mechanism. These are known as rt-limits. If you have a system equipped with such a kernel and a recent release of libPAM that knows how to make use of this, then setting up your system is as easy as changing some lines in
/etc/security/limits.conf
Add these lines (assuming all users that should be able to use memlock and realtime scheduling are in the group "priv":
@priv - rtprio 99 @priv - memlock 512000 @priv - nice -19
The first line allows users to run realtime processes with a priority up to 99. The second line allows users to mlock memory up to 512mb and the third line allows them to run programs with a negative nice level.
If your distro's libPAM is not enabled to assign realtime priorities, such as on Slackware, you can still use set_rlimits.
You have to edit the configuration file /etc/set_rlimits.conf like this:
@group path_to_software nice rtprio memlock @audio /usr/bin/jackd nice=-10 rtprio=95 memlock=250000
Assuming your user belongs to group Audio, you can then start every program you have added to this list with set_rlimits:
set_rlimits jackd -d alsa
In this scenery, if you want to start JACK with the excellent QJackCtl you have to do 2 more things:
* Add QJackCtl to set_rlimits.conf * Modify QJackCtl options and use "set_realtime jackd" as Server Path
And obviously remember to start QJackCtl as:
set_rlimits qjackctl
