[LAU] JACK recovery

Christopher Arndt chris at chrisarndt.de
Fri Feb 3 15:37:14 UTC 2017


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 ;)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 993 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-user/attachments/20170203/ebe009c4/attachment.pgp>


More information about the Linux-audio-user mailing list