Preventing SC from automatically starting JACK

A sometimes frustrating thing about scsynth on Linux is that it tries to automatically start a JACK server if none seems to be running, and that JACK server will shut down when SC does. This isn’t really SC’s fault since this behavior is the default when creating a client in the JACK API.

JACK clients can disable this behavior by setting the JackNoStartServer flag when initializing the client, but this would entail patching SC’s source. I was excited to find this bit in the JACK docs:

[JackNoStartServer] is always selected if $JACK_NO_START_SERVER is defined in the calling process environment.

So you can prevent all JACK client apps from starting JACK servers automatically by setting the environment variable JACK_NO_START_SERVER=1 (e.g. by adding export JACK_NO_START_SERVER=1 to ~/.profile, then logging out and back in again). Really stoked to discover this since it’s a minor inconvenience that’s bugged me for years now.

Or:

"JACK_NO_START_SERVER".setenv("TRUE");

s.boot;

Booting server 'localhost' on address 127.0.0.1:57110.
Found 380 LADSPA plugins
could not initialize audio.
Server 'localhost' exited with exit code 0.

So a script can disable JACK auto-launch by itself, without any dependency on the user’s profile.

hjh