Hi all,
I'm fighting with RT settings for audio applications... below is a resume of settings I applied following the suggestions of realTimeConfigQuickScan.pl.
It seems all right, but there's no way of get rtprio working.
Somebody have a clue ? A missing kernel config / package installed or misconfigured..,
Thanks.
Googling a little more I've solved this trouble.
The way is to disable one modern kernel feature, that disallows standard operations with SCHED_FIFO with unprivileged user.
Hi, i am sort of having the same problem. My installation is Debian squeeze i686. After installing jack, and let it configure the real time thing by creating the /etc/security/limits.d/audio.conf i restart the machine but when i do ulimit -l keeps telling me 64 when should be unlimited.
I thought this last post would be my answer but actually i have that option disable in the kernel so is actually not.
This what i get from ulimit -a:
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 31847
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 31847
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
I have unsuccessfully tried to edit /etc/security/limits.conf and the above mentioned file. I mean, is so simple, just add those lines right?
@audio - rtprio 95
@audio - memlock unlimited
, and obviously add my user to the audio group, in which he already is, but for some reason i do not know it just does not work.
I can start jack and get this in the messages window:
20:35:53.515 JACK está iniciándose...
20:35:53.516 /usr/bin/jackd -P89 -dalsa -dhw:0,0 -r44100 -p512 -n2 -m
Cannot connect to server socket err = No existe el fichero o el directorio
Cannot connect to server socket
jack server is not running or cannot be started
20:35:53.532 JACK se inició con PID=2442.
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
jackdmp 1.9.6
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2010 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
JACK server starting in realtime mode with priority 89
Cannot lock down memory area (Cannot allocate memory)
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0,0|hw:0,0|512|2|44100|0|0|nomon|swmeter|-|32bit
Using ALSA driver HDA-Intel running on card 0 - HDA Intel at 0xfebf8000 irq 22
configuring for 44100Hz, period = 512 frames (11.6 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/89)(1: Operation not permitted)
AcquireSelfRealTime error
20:35:55.643 Configuración del servidor salvada en "/home/kyoku/.jackdrc".
20:35:55.645 Reiniciar estadísticas.
20:35:55.656 Cliente activado.
20:35:55.673 Cambios en las conexiones JACK.
20:35:55.674 Cambió el gráfico de conexiones de JACK.
Cannot lock down memory area (No se pudo asignar memoria)
(Is in spanish but you get the idea)
It does start but of course when i start ardour is telling me about my memlock size and bla, bla..
Why does the system not pick up the configuration?, thanks.
hi kyokurider,
well, all the stuff about user limits rely on pam_limits, a module of pam, the autentication stack, check if your installation has it.
also, I have edited /etc/security/limits.conf, the main configuration file.
my ulimit -a says:
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 30
file size (blocks, -f) unlimited
pending signals (-i) 38912
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 99
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 38912
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
kyokurider wrote:...and let it configure the real time thing by creating the /etc/security/limits.d/audio.conf...
Hello kyokurider,
kyokurider wrote:I have unsuccessfully tried to edit /etc/security/limits.conf and the above mentioned file. I mean, is so simple, just add those lines right?
Yes, but you should only edit /etc/security/limits.d/audio.conf and leave /etc/security/limits.conf untouched.
With -m you disable memlocking while want it to be unlimited.
kyokurider wrote:Cannot use real-time scheduling (RR/89)(1: Operation not permitted)
You can't run JACK with prio 89. JACK's watchdog thread always runs +10 above the prio of JACK's primary thread. That would be 99 in your case. But you've set rtprio to 95 so JACK can't start up the watchdog thread now.
kyokurider wrote:It does start but of course when i start ardour is telling me about my memlock size and bla, bla..
That is because you disabled memlocking while Ardour prefers memlock to be set to unlimited.
kyokurider wrote:Why does the system not pick up the configuration?, thanks.
I think it does pick up the configuration. Try unticking 'No Memory Lock' in QjackCtl or omit the -m option and try running JACK at a prio no higher than 70.
Hi, thanks for the input, well, actually it does not pick up, all i have to do is check the ulimit -a command to see that is not correct, the only way to do this would be to as root:
ulimit -l unlimited
ulimit -r 99
and then also as root start qjackctl, then when i start jack i get this in the messages window:
18:57:50.372 JACK está iniciándose...
18:57:50.372 /usr/bin/jackd -dalsa -dhw:0 -r44100 -p128 -n2
18:57:50.374 JACK se inició con PID=2132.
no message buffer overruns
no message buffer overruns
jackdmp 1.9.6
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2010 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
JACK server starting in realtime mode with priority 10
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|128|2|44100|0|0|nomon|swmeter|-|32bit
Using ALSA driver HDA-Intel running on card 0 - HDA Intel at 0xfebf8000 irq 22
configuring for 44100Hz, period = 128 frames (2.9 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
18:57:52.454 Configuración del servidor salvada en "/root/.jackdrc".
18:57:52.455 Reiniciar estadísticas.
18:57:52.460 Cliente activado.
18:57:52.464 Cambios en las conexiones JACK.
18:57:52.466 Cambió el gráfico de conexiones de JACK.
Which i believe is correct. However for some reason my use can not modify this properties. I think it has to do with pam. So more of a permissions issue with my user, i am googleing now to see where it actually fails this..
I think that "man pam_limits" gives a clue. At the end it reads:
EXAMPLES
For the services you need resources limits (login for example) put
the following line in /etc/pam.d/login as the last line for that
service (usually after the pam_unix session line):
#%PAM-1.0
#
# Resource limits imposed on login sessions via pam_limits
#
session required pam_limits.so
Replace "login" for each service you are using this module.
I use gdm as my login manager. I have not done nothing special. I am in ubuntu karmic. I see this in /etc/pam.d/gdm:
Dude you are everywhere , thanks!, it does look that is the issue. I normally use gdm, but i am in the process of trying differente options, awesome, openbox, and as the login manager using slim right now.
Lots of hand work but worth the effort, even though you come across this kind of things.
One of my colleagues at work pointed me out about the pam issues, and he actually mentioned about the gdm thing so it looks like this could be very much the reason why.
I am not at home so i could probably not test it until tomorrow, but learnt a lot in the process, i am actually excited about having my own audio recording system all build with open source, this is gonna be good times.
I will try that tomorrow and see if i can dig as into what is the root cause, and how to solve it. And maybe do a blog with the suffering details he.
man, i knew Pablo's comment would sorted and wasn't that right
Ok, basically as well as you have this gdm file under the /etc/pam.d/ directory will also be needed one for slim, which maybe should be created by default when you install the login manager, the actual post that gave me the clue was this bug summited at bugs.debian.org http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476248
From the link:
While this does not affect the main SLiM functionality, if the
pam.d/slim file is not provided PAM will use the fallback "others"
file, which is definitely not the desired behaviour for a login
program.
It was so easy but spend so much time figuring why until i found the right path to look for, i am a happy man now.
Hi there. After updating to ubuntu 12.04 (precise pangolin) i check realTimeConfigQuickScan.pl and i am running again into the rtprio problem. Basically, the message it shows is
chrt: failed to set pid 0's policy: Operation not permitted
I am using alesio's 3.2.0-23-realtime kernel, as far as I know irq threading is activated, audio.limits is ok...
Is it necessary to disable the modern kernel feature, that disallows standard operations with SCHED_FIFO with unprivileged user? If so, how do u do that? Recompiling the kernel?
Could you post the contents of /etc/security/limits.d/audio.conf ? And you're sure you're in the audio group? And I'd suggest compiling your own RT kernel as described here: http://wiki.linuxmusicians.com/doku.php ... n#manually
Alessio's RT kernel packages are based on an older release that contains quite some bugs, I uninstalled it because I had too much issues with it.
thanks for the reply, and sorry for the late feedback. I am busy now with some programming stuff, but i'll try to compile the kernel when i am a bit more free (in a month or so).
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
And I had a similar error message ( chrt: failed to set pid 0's policy: Operation not permitted ) when issuing: