Page MenuHomeSolus

Jack Daemon doesn't start
Closed, ResolvedPublic

Tokens
"Burninate" token, awarded by michaelkisiel."Dat Boi" token, awarded by fatalbanana."Love" token, awarded by michaeltintiuc."Burninate" token, awarded by K0baz."Burninate" token, awarded by usillos.
Assigned To
Authored By
fluffymadness, Dec 13 2016

Description

I tried a few things to get jack working, but it doesn't start.
Starting jack with qjackctl gave me the following errors:

14:57:36.761 D-BUS: Service not available (org.jackaudio.service aka jackdbus).
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed

Running via commandline

Running with realtime mode (default)

jackd -R -dalsa

gave me:
JACK is running in realtime mode, but you are not allowed to use realtime scheduling.

Adding this line to /etc/security/limits.conf didn't change anything besides that the message that I should add it to this file has dissapeared
@audio - rtprio 99

Running without realtime mode

sudo jackd -r -dalsa -dhw:PCH -r48000 -p1024 -n2 (dhw:PCH is specific to my soundcard device)

starts jack successfully but I sadly still have no chance to connect with bitwig studio

Event Timeline

DataDrake triaged this task as Normal priority.Dec 25 2016, 12:43 AM
DataDrake moved this task from Backlog to Package Fixes on the Software board.
usillos added a subscriber: usillos.
aenemic removed a subscriber: aenemic.
aenemic added a subscriber: aenemic.
Timalex added a subscriber: Timalex.Aug 5 2017, 5:47 PM
K0baz awarded a token.Aug 6 2017, 7:45 AM
K0baz added a subscriber: K0baz.Aug 6 2017, 8:05 AM

Looks like adding "@audio - rtprio 99" to /etc/security/limits.conf does nothing, "ulimit -r" still says it's 0, even after restart. My user is in the audio group.

K0baz added a comment.Aug 7 2017, 12:12 PM

Finally found why setting rtprio in limits.conf was not working.
pam_limits.so must be added to /etc/pam.d/lightdm like this:

session   required pam_limits.so

After restart, ulimit -a looks like this:

$ ulimit -a
-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          unlimited
-s: stack size (kbytes)             8192
-c: core file size (blocks)         0
-m: resident set size (kbytes)      unlimited
-u: processes                       29848
-n: file descriptors                1024
-l: locked-in-memory size (kbytes)  unlimited
-v: address space (kbytes)          unlimited
-x: file locks                      unlimited
-i: pending signals                 29848
-q: bytes in POSIX msg queues       819200
-e: max nice                        0
-r: max rt priority                 99
-N 15:                              unlimited

max rt priority is 99 and jack finally works in realtime mode! :)

Can you guys add pam_limits.so in /etc/pam.d/lightdm by default so we have full realtime support out of the box?

Maybe when an user installs jack you could automatically add his user to the audio group and add

@audio          -       rtprio          99
@audio          -       memlock         unlimited

to /etc/security/limits.conf

Most of us who use jack is because of the realtime audio stuff.

I noticed /etc/pam.d/ already has pam_limits.so added in some files. Why does it not work until explicitly added to lightdm?

Perk user herb on 1 in /etc/pam.d
$ grep -R "limit" ./*
./lightdm:session   required pam_limits.so
./login:# Set resource limits for the user
./login:session   required    pam_limits.so
./systemd-user:session  required pam_limits.so

On my gentoo system, it's not explicitly specified in lightdm and works just fine.

Crystal user herb on 3 in /etc/pam.d
$ grep -R "limit" ./*
./cron:session optional        pam_limits.so
./system-auth:session           required        pam_limits.so 
./system-services:session               required        pam_limits.so
fatalbanana added a subscriber: fatalbanana.
epifone added a subscriber: epifone.Aug 5 2018, 1:21 AM

I couldn't get the jackd to start with realtime permission problems despite following the various threads here until I noticed that @herbmillerjr had "session required pam_limits.so" in /etc/pam.d/systemd-user.

Once added there and logging out no more failures.

Thanks for including that grep @herbmillerjr.

DataDrake closed this task as Resolved.Oct 27 2018, 4:48 PM

Jack is now fixed in unstable.

Jacalz added a subscriber: Jacalz.Dec 30 2018, 11:32 AM

I don't think the changes to /etc/security/limits.conf are taking affect like they should. My jack server had this issue when installing it today and i had to add @audio - rtprio 99 to that file manually by myself...

Jacalz added a comment.EditedDec 30 2018, 11:36 AM

Okay, I get it now. It isn't in /etc/security/limits.conf, but it ideally should be...
It needs to be fixed, I will open an issue for this...
Had some trouble understanding how to do it.

Okay, I get it now. It isn't in /etc/security/limits.conf, but it ideally should be...
It needs to be fixed, I will open an issue for this...
Had some trouble understanding how to do it.

Nowadays it is preferred to set files in /etc/security/limits.d and to prefix them with a number which determines the order in which they are loaded (i.e.: /etc/security/limits.d/90-jack.conf)

I spent an entire hack-fest on this. Someone broke it and I'm livid.

Jacalz added a comment.EditedDec 30 2018, 1:57 PM

I have tested it and this is now unborked again, see:
https://dev.getsol.us/R1495:3286d31247746ebdcff566ae98391c804e1e76eb

Apparently it was @DataDrake who pointed it out, thanks both of you 👍

Not quite understand. So the problem is solved? I can not solve this problem, displays the same message "connect(2) call to /dev/shm/jack-1000/default/jack_0 failed"

@alexanderzhirov are you on unstable ?

Yes. Decided to use this server too, but at me at start displays such error. I installed packages with JACK and qjackctl

Weird, I copy pasted the new settings and that worked for me. You might need to log out and the back in again for it to take effect...

Weird, I copy pasted the new settings and that worked for me. You might need to log out and the back in again for it to take effect...

no, I just do not understand what to write and where to add.

Weird, I copy pasted the new settings and that worked for me. You might need to log out and the back in again for it to take effect...

no, I just do not understand what to write and where to add.

There shouldn’t be any reason to add it manually if you are in unstable and have updated the system with the JACK rebuild. But I was on stable and before the rebuild was done I changed the file /etc/security/limits.d/90-jack.conf to the changes made here:
https://dev.getsol.us/R1495:3286d31247746ebdcff566ae98391c804e1e76eb

alexanderzhirov added a comment.EditedDec 31 2018, 11:01 AM

Weird, I copy pasted the new settings and that worked for me. You might need to log out and the back in again for it to take effect...

no, I just do not understand what to write and where to add.

There shouldn’t be any reason to add it manually if you are in unstable and have updated the system with the JACK rebuild. But I was on stable and before the rebuild was done I changed the file /etc/security/limits.d/90-jack.conf to the changes made here:
https://dev.getsol.us/R1495:3286d31247746ebdcff566ae98391c804e1e76eb

What should be done? I have "/etc/security/limits.d/90-jack.conf" 2 lines:

@audio  - rtprio    99
@audio  - memlock   unlimited
Jacalz added a comment.EditedDec 31 2018, 11:08 AM

Weird, I copy pasted the new settings and that worked for me. You might need to log out and the back in again for it to take effect...

no, I just do not understand what to write and where to add.

There shouldn’t be any reason to add it manually if you are in unstable and have updated the system with the JACK rebuild. But I was on stable and before the rebuild was done I changed the file /etc/security/limits.d/90-jack.conf to the changes made here:
https://dev.getsol.us/R1495:3286d31247746ebdcff566ae98391c804e1e76eb

What should be done? I have "/etc/security/limits.d/90-jack.conf" 2 lines:

@audio  - rtprio    99
@audio  - memlock   unlimited

The issue is with the space between the words, remove what you have in your file and replace with this and it should work as expected:

@audio  - rtprio   99
@audio  - memlock  unlimited

Weird, I copy pasted the new settings and that worked for me. You might need to log out and the back in again for it to take effect...

no, I just do not understand what to write and where to add.

There shouldn’t be any reason to add it manually if you are in unstable and have updated the system with the JACK rebuild. But I was on stable and before the rebuild was done I changed the file /etc/security/limits.d/90-jack.conf to the changes made here:
https://dev.getsol.us/R1495:3286d31247746ebdcff566ae98391c804e1e76eb

What should be done? I have "/etc/security/limits.d/90-jack.conf" 2 lines:

@audio  - rtprio    99
@audio  - memlock   unlimited

The issue is with the space between the words, remove what you have in your file and replace with this and it should work as expected:

@audio  - rtprio   99
@audio  - memlock  unlimited

Yes, removed the gaps, as you said-the server began to run! Thank you!