I hope this is the right place for this question. I would like to write a bash script which can start jack (or qjackctl; I'm not fussy) and set a bunch of connections. I know the commands to start jack or qjackctl and I know the commands to create JACK audio and ALSA MIDI connections.
The problem is the command to start jack does not finish (it runs as long as jack is running), so the following commands in my script don't execute. I can understand what's going on but I haven't a clue what to do about it. Is there a way in bash I can get a script to proceed past an unfinished command?
I think what you suggested has worked, but it just leads to a different problem: the JACK server has not finished initialising before the jack_connect commands run, so they fail.
I need to either find a kind of callback from the JACK initialisation to hook into, or look at using a post-startup script in qjackctl to set my connections (which I've failed miserably to do so far).
I think what you suggested has worked, but it just leads to a different problem: the JACK server has not finished initialising before the jack_connect commands run, so they fail.
I need to either find a kind of callback from the JACK initialisation to hook into, or look at using a post-startup script in qjackctl to set my connections (which I've failed miserably to do so far).
$ jack_wait --help
Usage: jack_wait [options]
Check for jack existence, or wait, until it either quits, or gets started
options:
-s, --server <name> Connect to the jack server named <name>
-n, --name <name> Set client name to <name>
-w, --wait Wait for server to become available
-q, --quit Wait until server is quit
-c, --check Check whether server is running
-t, --timeout Wait timeout in seconds
-h, --help Display this help message
For more information see http://jackaudio.org/
I've managed to get the post-startup script working from qjackctl now (I was blocked by the fact qjackctl gives you a GUI to choose a path to the script, then won't run it if it contains a space...)
I will bookmark this for all your helpful tips. Thanks!
Generally when running more than one command together, placing two ampersands between them means to wait until one command is completed before starting the next.
@bobby.calamari: Do you want to post your script here? I like to start things w/ a shell script too. I'm curious how you've set Jack connections via the command line.
I think what you suggested has worked, but it just leads to a different problem: the JACK server has not finished initialising before the jack_connect commands run, so they fail.
I need to either find a kind of callback from the JACK initialisation to hook into, or look at using a post-startup script in qjackctl to set my connections (which I've failed miserably to do so far).
$ jack_wait --help
Usage: jack_wait [options]
Check for jack existence, or wait, until it either quits, or gets started
options:
-s, --server <name> Connect to the jack server named <name>
-n, --name <name> Set client name to <name>
-w, --wait Wait for server to become available
-q, --quit Wait until server is quit
-c, --check Check whether server is running
-t, --timeout Wait timeout in seconds
-h, --help Display this help message
For more information see http://jackaudio.org/
@bobby.calamari: Do you want to post your script here? I like to start things w/ a shell script too. I'm curious how you've set Jack connections via the command line.
Oh, sure. I have a Focusrite Scarlett 18i8 soundcard, so lots of inputs:
I wasn't sure whether hardcoding numbers for the MIDI ports was a good idea, but it seems to work fine across number computer restarts. And hey, it's a file. It's easy to update.