You are here

commandline syntax problems

When i try to start jackd with qjackctl i have no luck, but when i start jackd outside of qjackctl it works no problem because of this:

11:58:30.321 /usr/local/bin set_rlimits jackd -v -R -dalsa -dhw:0 -r48000 -p1024 -n2
11:58:30.326 Could not start JACK. Sorry.

And if you need me to spell it out: "/usr/local/bin" should not be in front of the commandline string
and when i drop it jackd works fine. Don't know why qjackctl would be adding said error in front of commandline string and was not able to get qjackctl to drop it when i checked the preferences and configuration files which is why i am writing to see if anyone would know what the solution to this problem is. I've used qjackctl before and have not had this probem. I am using linux on an intel p4
system (lfs-6.2)

Forums: 
rncbc's picture

I guess you need to call set_rlimits to get realtime scheduling privileges and thus allows you to run jackd in realtime mode (-R). What exact server path are you specifying in the qjackctl setup/settings/server? It seems you have a blank before set_rlimits prefix. Take also note that set_rlimits must not be a shell script, qjackctl expects to run the server path as a plain executable binary. OTOH, you should specify the complete absolute path unless found on the current search PATH. If you still fail to make it through, try the other way around, start `set_rlimits qjackctl`instead and leave jackd as the plain server path.

HTH

yes the path was a problem, i just specified it in the configuration script, still no go. Here is what i get:

11:52:23.379 Patchbay deactivated.
11:52:23.380 Statistics reset.
11:52:23.394 ALSA connection graph change.
11:52:23.591 ALSA connection change.
11:52:26.827 Startup script...
11:52:26.827 artsshell -q terminate
11:52:27.281 Startup script terminated with exit status=256.
11:52:27.282 JACK is starting...
11:52:27.282 /usr/bin/jackd -v -R -dalsa -dhw:0,0 -r48000 -p256 -n2
Unknown option character
jackd 0.116.1
Copyright 2001-2005 Paul Davis and others.
jackd 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
usage: jackd [ --realtime OR -R [ --realtime-priority OR -P priority ] ]
[ --name OR -n server-name ]
[ --no-mlock OR -m ]
[ --unlock OR -u ]
[ --timeout OR -t client-timeout-in-msecs ]
[ --port-max OR -p maximum-number-of-ports]
[ --debug-timer OR -D ]
[ --verbose OR -v ]
[ --clocksource OR -c [ c(ycle) | h(pet) | s(ystem) ]
[ --replace-registry OR -r ]
[ --silent OR -s ]
[ --version OR -V ]
[ --nozombies OR -Z ]
-d backend [ ... backend args ... ]
The backend can be `alsa', `coreaudio', `dummy',
`freebob', `oss', `sun', or `portaudio'.
11:52:27.292 JACK was started with PID=4236.
jackd -d backend --help
to display options for each backend
11:52:27.295 JACK was stopped with exit status=255.
11:52:27.296 Post-shutdown script...
11:52:27.296 killall jackd
jackd: no process killed
11:52:27.703 Post-shutdown script terminated with exit status=256.
11:52:29.404 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.

Now when i copy and paste : /usr/bin/jackd -v -R -dalsa -dhw:0,0 -r48000 -p256 -n2
in a terminal i have no problems, but when i try to fire it up in qjackctl no go with or without realtime priority. Seems a bit odd. Maybe you can help me on this one. And as for realtime limits i managed to solve that problem with PAM (i had to patch PAM and recompile and reinstall it and the shadow package as well) or set_rlimits.
in case you are interested this is the PAM patch:

--- modules/pam_limits/pam_limits.c.orig 2005-07-06 09:05:32.000000000 +0100
+++ modules/pam_limits/pam_limits.c 2006-03-05 12:37:56.000000000 +0000
@@ -30,6 +30,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/resource.h>
+#include <asm/resource.h>
#include <limits.h>

#include <utmp.h>

and also /etc/security/limits.conf must be edited as well
Anyway if you have any ideas on this one please let me know.

rncbc's picture

Please, make sure you have only `jackd` as the server path, and nothing more. One other suggestion would be for you to start all over from scratch with factory defaults, by (re)moving away the global configuration file (~/.config/rncbc.org/QjackCtl.conf), while qjackctl is not running and then restart.

hth

looks like you were right. Deleting $HOME/.config/rncbc.org/QjackCtl.conf did the trick. All i had to do was specify set_rlimits and jackd without any path indication (as it was already in my $PATH) and that did the trick. Now all i have to do is figure out why jack will not restart sometimes when i have to stop it so another application (that is not readily compatible with jack) can use the sound system. If you have any suggestions on this please let me know.

rncbc's picture

Actually, JACK needs and takes exclusive control of the sound device, so while jackd is up and running you cannot have that device to any other use.

The other way around is also true: jackd won't start if any one single application is still using the same device for sound.

There's one trick in ALSA that let's you get away with this blockade: the dmix device may come to the rescue, so that you can have jackd and other plain ALSA applications share a sound device through software mixing. There's some caveats with this dmix thing, but you can try whether it works or is acceptable for you.

Follow this suggested instructions:

1) Edit or add the following to your ~/,asoundrc file:

pcm.!default {
    type plug
    slave.pcm "plugdmix"
}

pcm.plugdmix  {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 44100
    }
    bindings {
        0 0
        1 1
    }
}

pcm.dsp0
{
    type plug
    slave.pcm "plugdmix"
}

ctl.plugdmix {
    type hw
    card 0
}

2) Now use the new plugdmix pseudo device as your playback device (ie. Output Device in QjackCtl server settings). You can set your previous device name hw:0 as your capture device (ie. Input Device).

3) Make sure you use 44100 as your sample rate (rate) and 1024 as your frames per period (period_size).

Try it out :)

Add new comment