Couple years back QJackCtl’s internal scripts stopped working properly for me, possibly broken by some update. This caused GUI crashing and I had to always manually set jack-sink as default audio output in order to make alsa/pulseaudio and jack work at the same time and run other things manually as well. Since music making on Linux can get quite modular with different software, scripts become eventually handy. So, I decided to fix these issues myself once and for all.
At first it is good to know that “&” makes following commands running on background. Otherwise they become executed only after previous processes are killed. The script requires at least following packages installed: qjackctl, jackd, a2jmidid (Ubuntu Studio OS or upgrade is recommended)
#ASS (Arello's Sound Script) 0.1
qjackctl -s & sleep 3 #Runs Jack immediately and waits for moment before next commands
pactl set-default-sink jack_out && a2jmidid -e #sets jack sink as default and runs a2j MIDI bridge
#Optionally after this it is possible to execute additional software, like: & software_name_or_location
Writing this as a text file script_name.sh and permitting it as executable makes this script usable. ATTENTION: At this point the script is not perfect though. It does not actually check whether jack transport is already running. In the code I only presume that under three seconds it is already running. For my purposes this is enough for now.
Pingback: My audio setup bash script (0.3) – Aeroll