You are not logged in.

#1 2011-03-27 17:11:24

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,002
Website

realtime jackd on system without login manager:Operation not permitted

I'm trying to run jackd in realtime mode on my laptop (using the stock Arch kernel)
normally, this should just work as long as I have the right permissions in /etc/security/limits.conf
with one trick note (as per https://wiki.archlinux.org/index.php/Re … led_Login) that I need to enable pam_limits.so in the pam config for `su`, since I use `su` for autologin.
However, it just doesn't work (jack says operation not permitted). Interestingly, the output of `ulimit` suggests I have all privileges, at least AFAICT.

all of this can be seen below.

18:51:43 dieter@Gi ~ jackd -P89 -dalsa -dhw:1 -r48000 -p20480 -n4
jackd 0.120.1                                                
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details

could not open driver .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory

JACK compiled with System V SHM support.
loading driver ..
apparent rate = 48000
creating alsa driver ... hw:1|hw:1|20480|4|48000|0|0|nomon|swmeter|-|32bit
control device hw:1
configuring for 48000Hz, period = 20480 frames (426.7 ms), buffer = 4 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 4 periods for capture
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 4 periods for playback
cannot use real-time scheduling (FIFO at priority 99) [for thread -127027456, from thread -127027456] (1: Operation not permitted)
19:00:13 dieter@Gi ~ grep -v ^# /etc/security/limits.conf 
*               -       rtprio          0
*               -       nice            0
@audio          -       rtprio          90
@audio          -       nice           -10
@audio          -       memlock         unlimited
@audio          soft    cpu             unlimited
19:01:46 dieter@Gi ~ groups
wheel video audio dieter
19:01:59 dieter@Gi ~ cat /etc/pam.d/su
#%PAM-1.0
auth        sufficient    pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth        sufficient    pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth        required    pam_wheel.so use_uid
auth        required    pam_unix.so
account        required    pam_unix.so
session        required    pam_unix.so
session        required    pam_limits.so
19:00:11 dieter@Gi ~ ulimit -r
90
19:07:04 dieter@Gi ~ ulimit -f
unlimited
19:07:06 dieter@Gi ~ ulimit   
unlimited
19:03:36 dieter@Gi ~ cat /etc/inittab 
#
# /etc/inittab
#

#  Runlevels:
#    0    Halt
#    1(S)    Single-user
#    2    Not used
#    3    Multi-user
#    4    Not used
#    5    X11
#    6    Reboot

## Only one of the following two lines can be uncommented!
# Boot to console
#id:3:initdefault:
# Boot to X11
id:5:initdefault:

rc::sysinit:/etc/rc.sysinit
rs:S1:wait:/etc/rc.single
rm:2345:wait:/etc/rc.multi
rh:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p

# -8 options fixes umlauts problem on login
c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux
c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux
c3:2345:respawn:/sbin/agetty -8 38400 tty3 linux
c4:2345:respawn:/sbin/agetty -8 38400 tty4 linux
c5:2345:respawn:/sbin/agetty -8 38400 tty5 linux
c6:2345:respawn:/sbin/agetty -8 38400 tty6 linux
#x:5:respawn:/sbin/mingetty --autologin dieter tty1 linux # def has the realtime audio priv prob

# Serial Virtual Console for KVM and others VMs
#s0:2345:respawn:/sbin/agetty -8 9600 ttyS0 linux

# Hypervisor Virtual Console for Xen and KVM
#h0:2345:respawn:/sbin/agetty -8 38400 hvc0 linux

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

#x:5:once:/bin/su dieter -l -c '/usr/bin/startx >/dev/null 2>&1' # doesn't set locale/LANG properly
#x:5:once:/bin/su dieter -l -c '/bin/bash -c "/usr/bin/startx >/dev/null 2>&1"' # doesn't set locale/LANG properly
# sets locale/LANG properly, but probs with realtime audio privileges
x:5:once:/bin/su dieter -l -c '/bin/bash -l -c "/usr/bin/startx >/dev/null 2>&1"'

# Example lines for starting a login manager
#x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1

# End of file

Last edited by Dieter@be (2011-03-27 17:12:20)


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#2 2011-03-27 17:42:17

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,002
Website

Re: realtime jackd on system without login manager:Operation not permitted

figured it out. sortof...
strace output: http://pastie.org/1722771
sched_setscheduler is called and it tries to set prio to 99, which fails.
This is especially weird, since I launch jackd with `-P89` (`-P 89` doesn't help either).
With -P defined as:

-P, --realtime-priority int
              When running --realtime, set the scheduler priority to int.

I work around this issue by bumping my rtprio from 90 to 99, then it works :x

Last edited by Dieter@be (2011-03-27 17:42:57)


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#3 2011-03-28 00:04:34

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: realtime jackd on system without login manager:Operation not permitted

I don't know the answer but I had the same problem with the stock kernel. No problem with -bfs or -rt though.


neutral

Offline

#4 2011-03-28 09:33:30

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: realtime jackd on system without login manager:Operation not permitted

That is expected. rtprio = jackprio + 10.

Also, you may like to set maximum priority (at least 10 lower than system limits; the highest is for the device itself).

From: https://wiki.archlinux.org/index.php/Pro_Audio#JACK


I need real, proper pen and paper for this.

Offline

Board footer

Powered by FluxBB