Page 1 of 1

jackd "cannot lock down memory area"

Posted: Sat Mar 31, 2012 10:55 pm
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 :)

Re: jackd "cannot lock down memory area"

Posted: Sun Apr 01, 2012 10:59 am
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.