Am 03.02.2017 um 16:12 schrieb Mac:
My question is what SHOULD i be doing in my code to
prevent this?
It depends.
(Obviously, I can start JACK in my code if it's
not running...but, I've
not found any info on checking for JACK and starting it from python.
AND, how do, or can, I get JACK to start after this
occurs without a reboot?
There are two common ways to start JACK:
a) Simply as a subprocess of your user session or a program using JACK.
b) By starting jack-dbus and then configuring and starting JACK via the
DBUS interface.
To make solution a) (supposedly) more convenient, if a program tries to
connect to JACK, it can specify to have the JACK process automatically
started. However this can lead to problems and confusion*, if JACK is
normally run via method b). Luckily there's an environment variable to
disable this behaviour: JACK_NO_START_SERVER. Because I use jack-dbus, I
have the line "export JACK_NO_START_SERVER=1" in my ~/.bashrc, so
programs using JACK never try to automatically start JACK.
So I prefer solution b) and I have written a small Python application,
which lets me control jack-dbus from a small toolbar applet:
https://github.com/SpotlightKid/jack-select
This application contains a Python module to communicate with jack-dbus
via (surprise!) DBUS called "jackcontrol.py".
You can use it like this:
import dbus
from jackselect.jackcontrol import JackCtlInterface, get_jack_controller
bus = dbus.SessionBus()
jackdbus = get_jack_controller(bus)
jackctl = JackCtlInterface(jackdbus)
if jackctl.is_started():
print("JACK already running!")
else:
jackctl.start_server()
HTH, Chris
* Just search the mailing list on this topic and you'll find endless
threads ;)