[Jack-Devel] Cannot use real-time scheduling (RR/89)(1: Operation not permitted)

PrevNext  Index
DateWed, 26 Jun 2013 15:51:26 +0100
From James Dunn <[hidden] at 4thharmonic dot com>
To[hidden] at lists dot jackaudio dot org
Follow-Up[hidden] at trellis dot ch Re: [Jack-Devel] Cannot use real-time scheduling (RR/89)(1: Operation not permitted)
Follow-UpBob van Loosen Re: [Jack-Devel] Cannot use real-time scheduling (RR/89)(1: Operation not permitted)
I'm trying to start jackd with a systemd script on Arch Linux but I'm 
having a problem with RT scheduling.

When I start jack from the command line it works fine:

$ /usr/bin/jackd -R -P89 -dalsa -dhw:0 -r44100 -p128 -n3
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
no message buffer overruns
no message buffer overruns
no message buffer overruns
JACK server starting in realtime mode with priority 89
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|128|3|44100|0|0|nomon|swmeter|-|32bit
configuring for 44100Hz, period = 128 frames (2.9 ms), buffer = 3 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 3 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 3 periods for playback
^CJack main caught signal 2
Released audio card Audio0
audio_reservation_finish

But if try to start it with a systemd script that contains the same 
command it runs, but with the following error (which makes it sound 
really bad!):

$ sudo systemctl status jack
jack.service - JACK
Loaded: loaded (/usr/lib/systemd/system/jack.service; disabled)
Active: active (running) since Wed 2013-06-26 14:44:33 BST; 1s ago
Main PID: 4491 (jack)
CGroup: name=systemd:/system/jack.service
├─4491 /bin/sh /usr/lib/systemd/scripts/jack
└─4492 /usr/bin/jackd -R -P89 -dalsa -dhw:0 -r44100 -p128 -n3

Jun 26 14:44:34 instrument jack[4491]: audio_reservation_init
Jun 26 14:44:34 instrument jack[4491]: Acquire audio card Audio0
Jun 26 14:44:34 instrument jack[4491]: creating alsa driver ... 
hw:0|hw:0|128|3|44100|0|0|nomon|swmeter|-|32bit
Jun 26 14:44:34 instrument jack[4491]: configuring for 44100Hz, period = 
128 frames (2.9 ms), buffer = 3 periods
Jun 26 14:44:34 instrument jack[4491]: ALSA: final selected sample 
format for capture: 16bit little-endian
Jun 26 14:44:34 instrument jack[4491]: ALSA: use 3 periods for capture
Jun 26 14:44:34 instrument jack[4491]: ALSA: final selected sample 
format for playback: 32bit integer little-endian
Jun 26 14:44:34 instrument jack[4491]: ALSA: use 3 periods for playback
Jun 26 14:44:34 instrument jack[4491]: Cannot use real-time scheduling 
(RR/89)(1: Operation not permitted)
Jun 26 14:44:34 instrument jack[4491]: AcquireSelfRealTime error

It is run as a user that is assigned to the audio group, not as root. 
Also, the user has the following permissions in 
/etc/security/limits.d/99-audio.conf:

@audio - rtprio 99
@audio - memlock unlimited

How can I enable real-time scheduling from a systemd script?

thanks
James
PrevNext  Index

1372258298.1138_0.ltw:2,a <51CAFFEE.7040009 at 4thharmonic dot com>