# how to start jackd with -R (realtime) as a regular user (non root)



## marcelbonnet (Jan 30, 2013)

Hi, folks.

The jackd man page affirms that is possible to start  jackd with realtime scheduling "in several ways" [1].

So, does anybody knows some way to do it without being root or, at least, to start it as root but in a way a regular user can connect its clients to that instance?

If I start jackd with realtime as root, like above:
[CMD=""]# /usr/local/bin/jackd -R -doss -r44100 -p1024 -n3 -w16 -C/dev/dsp2.1 -P/dev/dsp2.1[/CMD]
then a regular user running a simple app like [CMD=""]$ jack_lsp[/CMD] is noticed that "JACK server not running".

Otherwise, if try to start jackd with the same params above as a regular user, it says I do not have enough privileges:



> JACK compiled with System V SHM support.
> cannot use real-time scheduling (FIFO at priority 10) [for thread 675300096, from thread 675300096] (1: Operation not permitted)
> cannot create engine



I realized a big latency reduction running jackd with realtime scheduling, but when I did it I had to start all clients (like ardour and linuxsampler) as root too, which is no good!

Thanks in advance.

1. From:
[CMD=""]man jackd[/CMD]


> -R, --realtime
> Use realtime scheduling (default = true).  This  is  needed  for
> reliable  low-latency performance.  On many systems, it requires
> jackd to run with special scheduler and memory allocation privi-
> leges, which may be obtained in several ways.


----------



## marcelbonnet (Jan 31, 2013)

*doing some testing*

Hello.

I don't know if I'm on the right direction, but here is my thought:

After [CMD=""]$ man 2 mkfifo[/CMD], I was wondering if the problem was only permissions relative to the FIFO.

[CMD=""]# fstat | grep jackd [/CMD]

USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W
root     jackd       4256 text /usr        782 -r-xr-xr-x   19188  r
root     jackd       4256 ctty /dev        172 crw--w----   pts/2 rw
root     jackd       4256   wd /         23562 drwxr-xr-x    2048  r
root     jackd       4256 root /             2 drwxr-xr-x     512  r
root     jackd       4256    0 /dev        172 crw--w----   pts/2 rw
root     jackd       4256    1 /dev        172 crw--w----   pts/2 rw
root     jackd       4256    2 /dev        172 crw--w----   pts/2 rw
root     jackd       4256    3* pipe c5610af0 <-> c5610bac      0 rw
root     jackd       4256    4* pipe c5610bac <-> c5610af0      0 rw
root     jackd       4256    5* local stream c5817a14
root     jackd       4256    6* local stream c5fd3560
root     jackd       4256    7 /tmp      17798 prw-r--r--       0 rw
root     jackd       4256    8 /tmp      17799 prw-r--r--       0 rw
root     jackd       4256    9 /dev        176 crw-rw-rw-  dsp2.1 rw


[CMD=""]# sockstat | grep jackd [/CMD]

USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS      
root     jackd      4256  5  stream /tmp/jack-0/default/jack_0
root     jackd      4256  6  stream /tmp/jack-0/default/jack_ack_0


So, I tried to change the permissions to that files, expecting that maybe a regular user could connect to that jack server instance:

[CMD=""]# cd /tmp/jack-0/default[/CMD]
[CMD=""]# chmod a+wrx *[/CMD]

As root, it still working:
[CMD=""]# jack_lsp [/CMD]
system:capture_1
system:capture_2
systemlayback_1
systemlayback_2

But as regular user, nothing changed:
[CMD=""]$ jack_lsp[/CMD]
JACK server not running

Any suggestion, please?


----------

