Jack

(audio connection kit)

Netjack2

jackdbus master (start/stop script)


#!/bin/bash

JCTL=/usr/bin/jack_control
A2JMIDID=/usr/bin/a2jmidid
JLOAD=/usr/bin/jack_load
JUNLOAD=/usr/bin/jack_unload
PERIOD=${2:-128}
SLEEP=/bin/sleep

start() {
  "$JCTL" ds alsa
  "$JCTL" dps device hw:U192k
  "$JCTL" dps rate 48000
  "$JCTL" dps nperiods 2
  "$JCTL" dps period "$PERIOD"
  "$JCTL" start

  "$SLEEP" 3

  "$JLOAD" netmanager -i -c

  "$SLEEP" 3

  "$A2JMIDID" -e &
}

stop() {
  "$JUNLOAD" netmanager

  "$SLEEP" 3

  killall a2jmidid

  "$SLEEP" 3

  "$JCTL" stop
}

status() {
  "$JCTL" status
}

info() {
  "$JCTL" dp
}

case "$1" in
  'start') start ;;
  'stop') stop ;;
  'status') status ;;
  'info') info ;;
esac

exit 0

jackdbus slave (start/stop script)


#!/bin/bash

JCTL=/usr/bin/jack_control
MIP="192.168.xxx.xxx"

start() {
  "$JCTL" ds net
  "$JCTL" dps multicast-ip "$MIP"
  "$JCTL" start
}

stop() {
  "$JCTL" stop
}

status() {
  "$JCTL" status
}

info() {
  "$JCTL" dp
}

case "$1" in
  'start')  start ;;
  'stop')   stop ;;
  'status') status ;;
  'info')   info ;;
esac

exit $?

jackd (Master)

The master is configured like a normal setup with the addition of starting the netmanager subsystem

The netmanager has to be started after the jack server is already running. You can enter the command 'jack_load netmanager' on the command line or automate it with qjackctl (see left).

Slave

The slave has to be started with the 'net' subsystem.

Command line

sh# jackd -R -S -s -d net -l 2 | logger -t 'jackd' &

-R : enable realtime

-S : enable sync mode

-s : enable soft mode

-l : set the network latency to 1 cycle

QjackCtl

Connecting Pulse Audio to Jack

sh$ pactl load-module module-jack-source
sh$ pactl load-module module-jack-sink
sh$ pacmd set-default-sink jack_out

Virtual Midi Controller (virmidi)

sh# modprobe snd_virmidi snd_index=0 midi_devs=4
#!/bin/bash

/usr/bin/jackd -R -S -s -d net -l 2 | /usr/bin/logger -t 'jackd' &

sleep 3

/usr/bin/a2jmidid | /usr/bin/logger -t 'a2jmidid' &
/usr/bin/pactl load-module module-jack-source
/usr/bin/pactl load-module module-jack-sink

exit 0

Multimidicast (Midi over Ethernet)

  • http://llg.cubic.org/tools/multimidicast/
sh# wget http://llg.cubic.org/tools/multimidicast/multimidicast-1.3.tar.gz
sh# apt install libasound2 libasound2-dev
sh# tar xvf multimidicast-1.3.tar.gz && cd multimidicast-1.3
sh# make
g++ -Wall -O2   -c -o multimidicast.o multimidicast.cpp
g++  -o multimidicast multimidicast.o -lasound
sh# ./multimidicast -h
multimidicast v1.3 (c) 2005..2011 by Dirk Jagdmann <doj@cubic.org>
options: -i <interface> - use specific network interface
         -h - display this text
         -q - quiet, don't show MIDI and network events
         -b <bytes> - set MIDI buffer size, default: 250000 bytes
  • libasound2
  • libasound2-dev