JACK-Matchmaker - new tool to autoconnect

Category: 

jack-matchmaker is a small command line utility that listens to JACK port registrations by clients and connects them when they match one of the port pattern pairs given on the command line at startup. jack-matchmaker never disconnects any ports.

The port name patterns are specified as pairs of positional arguments or read from a file and are interpreted as Python regular expressions, where the first pattern of a pair is matched against output (readable) ports and the second pattern of a pair is matched against input (writable) ports. Matching is done against the normal port names as well as any aliases they have.

Example which connects any output port ending in ':out_l' to the first default audio out and outputs ports ending in ':out_r' to the second audio out:

jack-matchmaker '.*:out_l' system:playback_1 \
'.*:out_r' system:playback_2

Port patterns can also be read from a file given with the -p/--pattern-file option. The file is re-read when the HUP signal is received.

Where to find it:

Requirements:

  • A version of Python 3 with a ctypes module (i.e. PyPy 3 works too).
  • JACK version 1 or 2.
  • Linux, OS X (untested) or Windows (untested, no signal handling)

Acknowledgements:

  • jack-matchmaker is written in Python and incorporates the jacklib module taken from falkTX's Cadence application.
  • It was inspired by jack-autoconnect, which also auto-connects JACK ports, but doesn't support port aliases.
  • The idea to read ports (patterns) from a file and re-read them on the HUP signal was "inspired" by aj-snapshot.