LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-31-2020, 03:39 AM   #1
flyingv2
LQ Newbie
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware Current
Posts: 25

Rep: Reputation: 3
Current and jack real-time scheduling


Hi,

I'm using up to date slackware current (stock kernel 5.4.28) and when I started jackd via qjackctl I see in the messages window the following text:

Cannot use real-time scheduling (RR/10) (1: Operation not permitted)
AcquireSelfRealTime error


After some googling I put "threadirqs" kernel flag in lilo.conf and I created /etc/initscript with

Code:
ulimit -l unlimited
ulimit -r 65
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

# Execute the program.
eval exec "$4"
after reboot i get:

Code:
bash-5.0$ ulimit -l
unlimited
bash-5.0$ ulimit -r
65
bash-5.0$
but when I stert jack the error "Cannot use real-time scheduling" persist... How can I fix this? I want to setup things most optimal with stock kernel.

All text in qjackctl messages window:

Code:
10:30:44.683 Statistics reset.
10:30:44.685 ALSA connection change.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
10:30:44.724 ALSA connection graph change.
10:30:58.485 JACK is starting...
10:30:58.485 /usr/bin/jackd -dalsa -r44100 -p256 -n2 -D -Chw:CODEC -Phw:CODEC
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
10:30:58.491 JACK was started with PID=2384.
jackdmp 1.9.14
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2019 Filipe Coelho.
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
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio2
creating alsa driver ... hw:CODEC|hw:CODEC|256|2|44100|0|0|nomon|swmeter|-|32bit
configuring for 44100Hz, period = 256 frames (5.8 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 2 periods for playback
Cannot use real-time scheduling (RR/10) (1: Operation not permitted)
AcquireSelfRealTime error
10:31:00.568 JACK connection change.
10:31:00.568 Server configuration saved to "/home/anze/.jackdrc".
10:31:00.569 Statistics reset.
10:31:00.572 Client activated.
10:31:00.572 Patchbay deactivated.
10:31:00.582 JACK connection graph change.
Some additional info: when i run guitarix this error occurs:

Code:
Pitch Tracker *** Error creating realtime thread - tuner not started
I'm using uphoria audio interface.

Thanks...
 
Old 03-31-2020, 04:48 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Did you compile jack, qjackctl and guitarix yourself? If so, where did you get the SlackBuild scripts? Works for me, using my own packages on Slackware64-current.
Code:
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
11:37:24.308 ALSA verbindingen aangepast.
Tue Mar 31 11:37:24 2020: Starting jack server...
Tue Mar 31 11:37:24 2020: JACK server starting in realtime mode with priority 10
Tue Mar 31 11:37:24 2020: self-connect-mode is "Don't restrict self connect requests"
Tue Mar 31 11:37:24 2020: Acquired audio card Audio0
Tue Mar 31 11:37:24 2020: creating alsa driver ... hw:0|hw:0|256|2|44100|0|0|nomon|swmeter|soft-mode|32bit
Tue Mar 31 11:37:24 2020: configuring for 44100Hz, period = 256 frames (5.8 ms), buffer = 2 periods
Tue Mar 31 11:37:24 2020: ALSA: final selected sample format for capture: 32bit integer little-endian
Tue Mar 31 11:37:24 2020: ALSA: use 2 periods for capture
Tue Mar 31 11:37:24 2020: ALSA: final selected sample format for playback: 32bit integer little-endian
Tue Mar 31 11:37:24 2020: ALSA: use 2 periods for playback
Tue Mar 31 11:37:24 2020: graph reorder: new port 'system:capture_1'
Tue Mar 31 11:37:24 2020: New client 'system' with PID 0
Tue Mar 31 11:37:24 2020: graph reorder: new port 'system:capture_2'
Tue Mar 31 11:37:24 2020: graph reorder: new port 'system:playback_1'
Tue Mar 31 11:37:24 2020: graph reorder: new port 'system:playback_2'
Tue Mar 31 11:37:24 2020: New client 'PulseAudio JACK Sink' with PID 1725
Tue Mar 31 11:37:24 2020: Connecting 'PulseAudio JACK Sink:front-left' to 'system:playback_1'
Tue Mar 31 11:37:24 2020: Connecting 'PulseAudio JACK Sink:front-right' to 'system:playback_2'
Tue Mar 31 11:37:24 2020: New client 'PulseAudio JACK Source' with PID 1725
Tue Mar 31 11:37:24 2020: Connecting 'system:capture_1' to 'PulseAudio JACK Source:front-left'
Tue Mar 31 11:37:24 2020: Connecting 'system:capture_2' to 'PulseAudio JACK Source:front-right'
Tue Mar 31 11:37:25 2020: Saving settings to "/home/eha/.config/jack/conf.xml" ...
11:37:26.530 JACK verbindingen aangepast.
 
Old 03-31-2020, 05:40 AM   #3
gattocarlo
Member
 
Registered: Jan 2020
Posts: 61

Rep: Reputation: Disabled
Quote:
Originally Posted by flyingv2 View Post
Hi,

I'm using up to date slackware current (stock kernel 5.4.28) and when I started jackd via qjackctl I see in the messages window the following text:

Cannot use real-time scheduling (RR/10) (1: Operation not permitted)
AcquireSelfRealTime error


After some googling I put "threadirqs" kernel flag in lilo.conf and I created /etc/initscript with

Code:
ulimit -l unlimited
ulimit -r 65
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

# Execute the program.
eval exec "$4"
after reboot i get:

Code:
bash-5.0$ ulimit -l
unlimited
bash-5.0$ ulimit -r
65
bash-5.0$
I would suggest not to use /etc/initscript since this is going to give unlimited resources to every user.

Since you are using current I'd suggest to try PAM (available in testing) and add this file:

Code:
/etc/security/limits.d/audio.conf:

@audio   -  rtprio     95
@audio   -  memlock    unlimited
Then logoff and login back. Now jackd should be starting with real-time priority. This is the way I'm using it (and jackdbus is my default server, with pulseaudio running as a jack client).

As far as I remember (but I could be wrong) I used to use "ulimit -Hl" and "ulimit -Hr" to set the hardware limits. But I then switched to PAM so I'm not sure if this is going to fix you problem.

Hope this helps,
andrea

EDIT: for the solution I'm suggesting the user must belong to the audio group.

EDIT II: did you set the capabilities of /usr/bin/jackd? (that was implicit in AlienBOB's question):

Code:
/sbin/setcap cap_ipc_lock,cap_sys_nice=ep /usr/bin/jackd
Using "ulimit" is not going to be enough. This is not needed if you use PAM.

Last edited by gattocarlo; 03-31-2020 at 05:48 AM.
 
Old 03-31-2020, 05:44 AM   #4
flyingv2
LQ Newbie
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware Current
Posts: 25

Original Poster
Rep: Reputation: 3
Quote:
Did you compile jack, qjackctl and guitarix yourself? If so, where did you get the SlackBuild scripts? Works for me, using my own packages on Slackware64-current.
Yes, slackbuilds from SlackBuilds.org but even when I installed your packages the result is the same...
 
Old 03-31-2020, 05:51 AM   #5
gattocarlo
Member
 
Registered: Jan 2020
Posts: 61

Rep: Reputation: Disabled
Quote:
Originally Posted by flyingv2 View Post
Yes, slackbuilds from SlackBuilds.org but even when I installed your packages the result is the same...
Are you using a PAM enabled slackware installation? If so you need to use the "/etc/security/limit.d/audio.conf" solution. setcap doesn't work with PAM.
 
Old 03-31-2020, 06:08 AM   #6
flyingv2
LQ Newbie
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware Current
Posts: 25

Original Poster
Rep: Reputation: 3
Quote:
EDIT II: did you set the capabilities of /usr/bin/jackd? (that was implicit in AlienBOB's question):
Yes -> slackbuild takes care of that

Code:
if [ -x /sbin/setcap ]; then
    # Give all binaries in the package realtime capabilities:
    JACKBINS=( $(cd $PKG/usr/bin ; find . -type f -printf '%P\n') )
    for EXE in \${JACKBINS[@]}; do
      /sbin/setcap cap_ipc_lock,cap_sys_nice=ep usr/bin/\$EXE
    done
fi
Quote:
Are you using a PAM enabled slackware installation?
No, if it is not necessary I don't want install additional software...
 
Old 03-31-2020, 07:54 AM   #7
gattocarlo
Member
 
Registered: Jan 2020
Posts: 61

Rep: Reputation: Disabled
Quote:
Originally Posted by flyingv2 View Post

No, if it is not necessary I don't want install additional software...
It is not necessary but handy, otherwise you'll have to use setcap for every jack client (and some, like pulseaudio, ardour or carla, are tricky).

Anyway the last thing I can think about is that maybe you are using a file system which does not support capabilities, but ext4, the slackware default, should.

Try with:

Code:
/sbin/getcap /usr/bin/jackd
you should get something like:

Code:
/usr/bin/jackd = cap_ipc_lock,cap_sys_nice+ep
 
Old 03-31-2020, 01:40 PM   #8
flyingv2
LQ Newbie
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware Current
Posts: 25

Original Poster
Rep: Reputation: 3
Code:
bash-5.0# getcap /usr/bin/jackd
/usr/bin/jackd = cap_ipc_lock,cap_sys_nice+ep
bash-5.0# getcap /usr/bin/qjackctl 
/usr/bin/qjackctl = cap_ipc_lock,cap_sys_nice+ep
Now i really dont know what to look at next...
 
Old 03-31-2020, 05:00 PM   #9
0XBF
Member
 
Registered: Nov 2018
Distribution: Slackware
Posts: 765

Rep: Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862
Try one of the solutions provided here:

https://github.com/jackaudio/jackaud...m/wiki/Cgroups

I had a real-time kernel on my machine for audio work but I was curious so I played around with getting the generic kernel to work in a non-PAM system. With 'threadirqs' and an initscript setting 'ulimit -l unlimited' and 'ulimit -r 90' I was getting the same error as you.

I found that webpage after some digging. Slackware's kernel does have the config option CONFIG_RT_GROUP_SCHED=y so I tried solution 1, editing /etc/cgconfig.conf and running '/etc/rc.d/rc.cgconfig start'. This seems to have gotten rid of that error and realtime starts normally now.

Hope this helps, good luck!
 
1 members found this post helpful.
Old 04-01-2020, 02:51 AM   #10
gattocarlo
Member
 
Registered: Jan 2020
Posts: 61

Rep: Reputation: Disabled
cgroups are an unneeded complication I think, but I tried this solution and I found it was working nicely... I'm not sure it is working any longer since ConsoleKit2 is no longer linked to cgmanager (I'm sure about the PAM enabled version, but not about the version included in current), but I could be wrong. See my post here:

https://www.linuxquestions.org/quest...0/#post6089880

After thinking a bit about it I recalled that I didn't use "ulimit -r" in my /etc/initscript, because setcap does the job. I only used "ulimit -Hl unlimited" for memory locking. Try removing "ulimit -r".

I really suggest you to go the PAM way if you are using your system for music production. Everything is in "testing" and you need just to change a line in /etc/slackpkg/slackpkg.con:

Code:
PRIORITY=( patches %PKGMAIN extra pasture testing )

to

PRIORITY=( testing patches %PKGMAIN extra pasture )
You need to manually install cracklib libpwquality pam,then slackpkg upgrade-all and you are done. No need to mess with setcap, and everything works really smootly.
 
Old 04-01-2020, 02:43 PM   #11
flyingv2
LQ Newbie
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware Current
Posts: 25

Original Poster
Rep: Reputation: 3
Ok, no more jack errors with pam... Can I expect now any pam related problems?

Thanks
 
Old 04-02-2020, 08:54 AM   #12
gattocarlo
Member
 
Registered: Jan 2020
Posts: 61

Rep: Reputation: Disabled
Quote:
Originally Posted by flyingv2 View Post
Ok, no more jack errors with pam... Can I expect now any pam related problems?

Thanks
After some initial problems, easily debugged, no issues with PAM here. Glad you solved your problem with jack.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [JACK/ALSA] Timidity++ not producing any sound under Jack using its ALSA output since a "current" upgrade. Geist Slackware 2 09-10-2017 02:02 AM
[SOLVED] What's the differences between CFS and real-time scheduling songcaidao Linux - Kernel 8 10-04-2013 11:47 PM
Need some detail information on Hard Real-Time Systems and Soft real-Time Systems. LinuxInfo General 3 09-22-2008 03:25 AM
problem in assigning real time scheduling to pthread in linux jasdeep_js Linux - Kernel 1 09-07-2008 01:44 AM
Real-time Round-Robin Scheduling cttran Programming 2 05-06-2005 04:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration