Can it be harmful to grant jackd realtime priority?
I am apt-get installing Ardour, a sound mixing program, just to try it out. Installing Ardour also installs JACK, a dependency. As part of the JACK installation script, I get the following dialog:
If you want to run jackd with realtime priorities, the user starting jackd needs realtime permissions. Accept this option to create the file /etc/security/limits.d/audio.conf, granting realtime priority and memlock privileges to the audio group.
Running jackd with realtime priority minimizes latency, but may lead to complete system lock-ups by requesting all the available physical system memory, which is unacceptable in multi-user environments.
Enable realtime process priority?
I'm installing on my laptop, which never has multiple simultaneous users. I still have concerns: is JACK something that'll be used by the system itself to play any sound (i.e. will it replace ALSA)? If so, does that mean that if I enable realtime priority for JACK, I'll run a slight risk of freezing the machine whenever any sound is played? Or is JACK only going to be used by Ardour for now (until I install some other JACK-dependent program)?
Solution 1:
Jackd does not normally replace ALSA. Jackd usually uses ALSA to provide it's output. What Jackd provides is a low-latency audio patching/routing network that other software can use. Only software designed to use Jackd will use JackD. Jackd only needs to be run when you are running software that uses it (e.g. Ardour, Rosegarden, Jack-rack). When you are not running a program that uses jackd, you don't have to run jackd.
The best program I have found for controlling jackd is qjackctl, which can be installed through the Ubuntu Software Center as Jack Control. It allows starting/stopping jackd, configuring how it is run, and setting up connections.
In order to get the lowest latency possible, jackd really would like to use real-time priority threads. Enabling real-time processing for jackd is good thing to do and should not hurt your system. (The machine I am typing on right now has had it enabled for 4 years under 2 different Linux distros and 2 different hardware incarnations without any lock-ups.)
BTW, once you start using some of the features of jackd, it gets pretty addictive. By starting up different effects racks (jack-rack instances), and setting up the connections, I can take take a stereo recording and create a real-time 4.2 output where I have different delays reverb/delay for the rear speakers, a custom center channel mix, and a sub-woofer output. (I am still trying to find a good octave doubler for that.)
Solution 2:
One approach to the realtime lockup problem is simply open a bash
terminal with a higher priority than jackd
. Use your high priority terminal to kill jackd
if you see signs of realtime CPU hogging. I used this to avoid total crashes before learning the art of irq fine tuning for pro audio. Steep learning curve, great rewards!