You are not logged in.

#1 2014-03-14 16:03:24

Zaphod
Member
Registered: 2014-03-14
Posts: 3

[SOLVED] pam_limits.so and jack realtime scheduling

Hi,

I'm trying to start jackd using realtime scheduling. Running:

$ jackd -R -dalsa 

I get:

jackdmp 1.9.9.5
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2012 Grame.
jackdmp 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
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
JACK server starting in realtime mode with priority 10
Cannot lock down 82274202 byte memory area (Cannot allocate memory)
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback
Cannot use real-time scheduling (RR/10)(1: Operation not permitted)
AcquireSelfRealTime error

Output of ulimit -f:

unlimited

Output of ulimit -r:

0

I have consulted the jack and realtime process management wikis (https://wiki.archlinux.org/index.php/JA … leshooting and https://wiki.archlinux.org/index.php/Realtime_for_Users) as well as followed the suggestions on the jack webpage (http://jackaudio.org/linux_rt_config) and two archforum posts (https://bbs.archlinux.org/viewtopic.php?id=115812 and https://bbs.archlinux.org/viewtopic.php?pid=387214) but I cannot get it to work.

As far as I can tell, the problem is that the module pam_limits.so is not loaded on login.

Output of grep pam_limits.so /etc/pam.d/*

/etc/pam.d/crond:session   required    pam_limits.so
/etc/pam.d/polkit-1:session         required        pam_limits.so
/etc/pam.d/system-auth:session   required  pam_limits.so
/etc/pam.d/system-services:session   required    pam_limits.so

When appending the following to /etc/pam.d/su I can get it to work if I open a terminal, su to my regular user, and then run jackd

 session    required    pam_limits.so

But I'm guessing there must be an easier way around this, namely, loading the pam module on login.

I've tried putting the above code in /etc/pam.d/login but that does not work.

Any suggestions?

I should add: I am not using a graphical login manager but log in from the console (and running startx); and yes, my user is in the audio group.

Cheers!

Last edited by Zaphod (2014-05-09 08:31:37)

Offline

#2 2014-03-29 10:40:57

Zaphod
Member
Registered: 2014-03-14
Posts: 3

Re: [SOLVED] pam_limits.so and jack realtime scheduling

I have still not been able to figure this one out. However, I have found out that if I run:

$ ulimit -r

outside of X, everything seems to be working just fine, i.e. I get the expected output 99.

So, it seems it is related to X, somehow, or some program run at X startup. My /.config/openbox/autostart:

## OPENBOX AUTOSTART ##

numlockx &

(sleep 1s && compton --config /home/user/My_Compton.conf) &

nitrogen --restore &

(sleep 2s && conky -c /home/user/Conky.txt) &

spacefm -d &

tint2 -c /home/user/My_tint2rc &

(sleep 1s && alsa-tray) &

My .xinitrc:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
 for f in /etc/X11/xinit/xinitrc.d/*; do
   [ -x "$f" ] && . "$f"
 done
 unset f
fi

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
/usr/bin/xscreensaver -no-splash &
exec openbox-session

Any ideas or suggestion on where to look or how I might go about trying to find a solution would really be much appreciated.

Cheers!

Offline

#3 2014-05-09 08:31:13

Zaphod
Member
Registered: 2014-03-14
Posts: 3

Re: [SOLVED] pam_limits.so and jack realtime scheduling

Ok, after some time playing around with this, I seem to have narrowed down the problem - and found a workable solution!

It turns out to be a problem with pam_limits.so not being set (I'm not sure about the appropriate terminology here) for my urxvt-terminal. More specifically, I'm running the urxvtd daemon and launching my terminals in Openbox using the keybind Super+t (set up according to this: https://wiki.archlinux.org/index.php/Rx … in_Openbox).

However, running ulimit -r from xterm and a regularly launched urxvt (that is, not urxvtc) gives the expected result (99) and jack starts with realtime scheduling smile

If anyone knows how to set up urxvtd with the appropriate pam_limits, please let me know.

Cheers!

Marking thread as SOLVED.

Offline

Board footer

Powered by FluxBB