jackd "cannot lock down memory area"

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

jackd "cannot lock down memory area"

Post by ^rooker »

[PROBLEM]
On Ubuntu Oneiric, I've started jack (using qjackctl) and it says its running happily, but in "Messages" I get the following error:
Cannot lock down memory area (Cannot allocate memory)
Everything seemed fine (according to QJackCtl's GUI), but when I tried to start a new session in Ardour, it crashed (or froze): the session handling window stayed there forever and I had to kill Ardour's process :(

[SOLUTION]
When installing the "jackd2" package, it usually asks you if it should allow real-time priority to Jackd. Even if you did say "yes" to that question, the user you're starting qjackctl (and therefore jackd) as, might not be in the group "audio".

So, in order to fix this, do the following:
a) Make sure that the jackd2 package adds a security rule to enable real-time and memory-lock:

Code: Select all

sudo dpkg-reconfingure -p high jackd2
b) Now, make sure your user is in the "audio" group (usually on Xubuntu Oneiric, only the user "pulse" is).
c) Restart, in order for all privilege and security settings to apply.
d) Check if everything went fine:

Code: Select all

ulimit -l -r
The output should look as follows:
max locked memory (kbytes, -l) unlimited
real-time priority (-r) 95
If it does: fine! Try to start jackd - and the problem should be gone :)
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Re: jackd "cannot lock down memory area"

Post by ^rooker »

Things to check if it's still not working:
a) Check the file "/etc/security/limits.d/audio.conf". It should exist and contain the following:

Code: Select all

# Provided by the jackd package.
#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
#    dpkg-reconfigure -p high jackd

@audio   -  rtprio     95
@audio   -  memlock    unlimited
#@audio   -  nice      -19
b) Check your current group assignment, by running the "groups" command.
The output could look somewhat like this:
<your_username> adm dialout cdrom audio plugdev lpadmin admin sambashare
("<your_username>" will, of course, contain your actual username. I've used it as a placeholder here)

Important is, that the group "audio" is listed in there. If it's not, check "/etc/group":

Code: Select all

cat /etc/group | grep audio
Which should look like this:
audio:x:29:pulse,<your_username>
If it doesn't: add your username and then reboot and check again.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply