Posts: 630
Eino
Joined: 12 Oct 2012
#1
Jack audio server will only run in real-time as root. I have tried a fix to no avail.

first fix was adding to limits.conf file
lines added

Code: Select all

@audio           hard    rtprio          65
@audio           hard    nice            10
@audio           hard    memlock         40000
also tried my user name

Code: Select all

@Eino           hard    rtprio          65
@Eino           hard    nice            10
@Eino           hard    memlock         40000
Jack works with muse, but I need to run them both as root for them to work.
I would like to find a workaround, so I can just open them from the menu.
Last edited by oldhoghead on 14 Jul 2013, 22:22, edited 1 time in total.
Reason: mark as solved
Posts: 630
Eino
Joined: 12 Oct 2012
#2
I already have a group name"audio"
So I just tried adding my self to the group by.

Code: Select all

usermod -a -G audio Eino


It still did not work.

Jack connection messages run a normal user.

Code: Select all

15:56:10.162 Patchbay deactivated.
15:56:10.193 Statistics reset.
15:56:10.197 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
15:56:10.224 ALSA connection graph chang
run as root.

Code: Select all

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
JACK server starting in realtime mode with priority 10
control device hw:0
control device hw:0
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|32000|0|0|nomon|swmeter|-|32bit
control device hw:0
configuring for 32000Hz, period = 1024 frames (32.0 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
15:57:51.127 JACK connection change.
15:57:51.144 Server configuration saved to"/root/.jackdrc".
15:57:51.146 Statistics reset.
15:57:51.160 Client activated.
15:57:51.204 JACK connection graph change.
Last edited by Eino on 07 Jul 2013, 20:19, edited 1 time in total.
Posts: 516
oldhoghead
Site Admin
Joined: 01 Oct 2007
#3
Enio,

Check this out,

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://wiki.archlinux.org/index.php/JACK_Audio_Connection_Kit"
linktext was:"https://wiki.archlinux.org/index.php/JA ... ection_Kit"
====================================

scroll to the bottom and start reading at:

Create a /etc/profile.d/jack.sh file containing:

cheers,
ohh
BitJam
Joined: 31 Aug 2009
#4
From the jackd man page:
-R, --realtime

Use realtime scheduling. This is needed for reliable low-latency performance. On most systems, it requires jackd to run with special scheduler and memory allocation privileges, which may be obtained in several ways. The simplest, and least-secure method is to run jackd with root privileges. This means that all JACK clients must also run as root. With a Linux 2.6 kernel, ordinary users can run jackd and its clients using options of the realtime LSM. Linux 2.4 kernels need"POSIX draft capabilities" enabled (see the <linux/capability.h> include file). Using that method, ordinary users who invoke the daemon using jackstart, can later launch JACK clients without running them as root. See
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://jackaudio.org/faq"
linktext was:"http://jackaudio.org/faq"
====================================
for more information.
Posts: 630
Eino
Joined: 12 Oct 2012
#5
I'm going to keep it simple and run it as root.
The only time I use it is when, I have my musical keyboard plugged in, and I'm making midi music.
Alanarchy
Posts 0
Alanarchy
#6
Taken from here:


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://linuxmusicians.com/viewtopic.php?f=4&t=2588&view=unread#p12107"
linktext was:"http://linuxmusicians.com/viewtopic.php ... ead#p12107"
====================================

Adding two lines to /etc/security/limits.conf and adding yourself to the audio group should suffice.

Code: Select all

@audio - rtprio 90       # maximum realtime priority
@audio - memlock unlimited  # maximum locked-in-memory address space (KB)
Posts: 630
Eino
Joined: 12 Oct 2012
#7
This is what i already have provided by jackd. I guess, I just need to join the audio group.

Code: Select all

# Provided by the jackd package.
#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
#    dpkg-reconfigure -p high jackd

@audio   -  rtprio     95
@audio   -  memlock    unlimited
@audio   -  nice      -19
Posts: 630
Eino
Joined: 12 Oct 2012
#8
I'm missing my audio group.
I tried to fix it wiih anxticc Manage users to add the group, and it failed. ..

Code: Select all

Eino@antiX1:~
$ groups Eino 
Eino : Eino lp dialout cdrom floppy sudo dip video plugdev users fuse netdev realtime
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#9
Edit: What I said before was wrong. It is true that you need to log in again for group changes like this to take effect. I was wrong when I said:
opening up a new terminal window or even just running the"bash" command in your current terminal window should do the trick.
Those WON'T work. You need to log out of X and log back in again.
Posts: 630
Eino
Joined: 12 Oct 2012
#10
i now have audio in my groups,I added the lines to /etc/security/limits.conf
But the audio server will still only run as root.
Maybe I'm missing something.

Code: Select all

Eino@antiX1:~
$ groups
Eino lp dialout cdrom floppy sudo dip video plugdev users fuse netdev realtime audio
Posts: 630
Eino
Joined: 12 Oct 2012
#11
Jack messages as a normal user.
12:30:57.760 Patchbay deactivated.
12:30:57.761 Statistics reset.
12:30:57.763 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
12:30:57.779 ALSA connection graph change.
12:31:02.842 JACK is starting...
12:31:02.842 /usr/bin/jackd -t2000 -dalsa -dhw:0,2 -r48000 -p1024 -n3
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
12:31:02.873 JACK was started with PID=5025.
jackdmp 1.9.9
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
JACK server starting in realtime mode with priority 10
control device hw:0
control device hw:0
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0,2|hw:0,2|1024|3|48000|0|0|nomon|swmeter|-|32bit
control device hw:0
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 3 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: got smaller periods 2 than 3 for capture
ALSA: cannot configure capture channel
Cannot initialize driver
JackServer::Open failed with -1
Failed to open server
12:31:03.258 JACK was stopped with exit status=255.
12:31:04.987 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
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
As root, without an instrument plugged in.
12:42:55.544 Patchbay deactivated.
12:42:55.551 Statistics reset.
12:42:55.555 ALSA connection change.
12:42:55.576 ALSA connection graph change.
12:43:00.214 JACK is starting...
12:43:00.214 /usr/bin/jackd -t1000 -m -dalsa -dhw:0 -r44100 -p1024 -n2 -Xseq -D -Phw:0
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
12:43:00.241 JACK was started with PID=6903.
jackdmp 1.9.9
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
JACK server starting in realtime mode with priority 10
control device hw:0
control device hw:0
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|44100|0|0|nomon|swmeter|-|32bit
control device hw:0
configuring for 44100Hz, period = 1024 frames (23.2 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
12:43:00.617 ALSA connection graph change.
port created: Midi-Through:midi/playback_1
port created: Midi-Through:midi/capture_1
port created: SB-Audigy-2--SB0350b-:midi/playback_1
port created: SB-Audigy-2--SB0350b-:midi/capture_1
port created: SB-Audigy-2--SB0350b-:midi/playback_33
port created: SB-Audigy-2--SB0350b-:midi/capture_33
port created: Emu10k1-WaveTable:midi/capture_1
port created: Emu10k1-WaveTable:midi/capture_2
port created: Emu10k1-WaveTable:midi/capture_3
port created: Emu10k1-WaveTable:midi/capture_4
12:43:02.435 JACK connection change.
12:43:02.438 Server configuration saved to"/root/.jackdrc".
12:43:02.439 Statistics reset.
12:43:02.450 Client activated.
12:43:02.491 JACK connection graph change.
Posts: 630
Eino
Joined: 12 Oct 2012
#12
I found the reason why jack was always needed to run as root. Without the Musical keyboard plugged in and running it will not start as a normal user.
All I needed to do is plugin the keyboard, and have it running before starting jack.
Problem solved.

I was always starting jack, then turning on the keyboard.