JACK (JACK Audio Connection Kit) is a low-latency audio server with a patchable client graph. It fits when you want deterministic routing between apps, multiple ALSA devices via bridges, or JACK-native clients/plugins. On many desktops PipeWire already covers similar use cases and exposes a JACK-compatible API; see PipeWire multi-channel routing first.
Context: WO-06 Audio playout · T1.3
Ubuntu / Debian (example):
sudo apt update
sudo apt install jackd2 qjackctl
Optional:
| Package | Role |
|---|---|
qjackctl |
Patchbay, connections, JACK start/stop GUI. |
carla |
Plugin host / advanced routing (optional). |
alsa-utils |
aplay -l for device IDs — see ALSA enumeration. |
jackd)Pick one ALSA playback device to be the master clock for JACK (from aplay -l: card N, often device 0).
Example: card 1, 48 kHz, 256 frames/period, 2 periods (adjust for stability vs latency):
jackd -R -d alsa -d hw:1 -r 48000 -p 256 -n 2
| Flag | Meaning |
|---|---|
-R |
Realtime scheduling (often needs limits.conf / audio group). |
-d alsa |
ALSA backend. |
-d hw:1 |
ALSA card index (not hw:1,3—JACK ALSA driver uses card; use separate tools for subdevices if needed). |
-r 48000 |
Sample rate (match Caspar / broadcast chain). |
-p 256 |
Period size in frames. |
-n 2 |
Periods in the buffer (latency ∝ p * n). |
Run in a terminal or via qjackctl → Setup → Parameters → Start. Stop with Ctrl+C or qjackctl.
Exclusive access: while jackd holds hw:N, other apps (including Caspar FFmpeg -f alsa hw:N to the same device) may fail with “device busy”. Plan one owner of the hardware or use bridges below.
alsa_in / alsa_outWhen you need more than one ALSA card (e.g. USB + onboard), JACK can expose extra devices via:
alsa_in — ALSA capture → JACK inputs (e.g. line in on another card).alsa_out — JACK outputs → ALSA playback on a second device.Typical pattern: JACK master on card A; route mix through JACK to card B with alsa_out:
alsa_out -d hw:2,0 -j mon_out
Flags vary by version; use alsa_out --help. Connect JACK ports to mon_out in qjackctl Graph.
This is how you achieve CasparCG → (ALSA or Pulse) → … → JACK → multiple hardware outputs: Caspar does not speak JACK natively; you either:
alsa_in, orqpwgraph, or-f jack (uncommon in stock Caspar builds—verify ffmpeg -formats | grep jack).For many CasparCG deployments, direct ALSA hw: or Pulse/PipeWire sinks are simpler than a full JACK graph. Use JACK when you specifically need its graph + multi-card bridges or JACK-only clients; otherwise PipeWire/ALSA is often enough.
qjackctl workflowalsa_out ports).jackd vs PipeWire JACK layerjackd (depends on install: pipewire-jack, pw-jack).-f alsa or -f pulse.hw: from Caspar and jackd.| Issue | What to check |
|---|---|
jackd won’t start |
Wrong hw: card; device in use; try larger -p. |
| Xruns (red in qjackctl) | Increase period; close other apps; CPU governor. |
| No permission for realtime | User in audio group; /etc/security/limits.d/ rtprio / memlock. |
| Second interface silent | alsa_out / graph not wired; wrong -d hw:. |