Files
raspberry-pi-mixer/scripts/jack-route-default
T
shawn 9cd8292acc
Lint & Validate / lint (push) Has been cancelled
Phase 1-4: Audio stack, mixer engine, MIDI, and network API
P2-R1: ALSA + JACK2 low-latency config (scripts, quirks, tuning)
P2-R2: Carla integration (build scripts, 8ch rack config, NAM LV2 support)
P2-R3: Plugin manager, categories, blacklist, NAM model support
P3-R1: Mixer DSP engine (channel strip, routing matrix, bus mgr, automation)
P4-R1: MIDI engine (learn mode, clock sync, HID discovery, mapping store)
P4-R2: Network API (OSC server, FastAPI REST, WebSocket, auth, rate limiter)
P5-R1: Touchscreen UI evaluation + main entry point
docs: Audio stack, Carla integration, MIDI support, UI evaluation
tests: Full test suite (292 passing)
2026-05-19 20:39:17 -04:00

41 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# jack-route-default — auto-connect JACK system captures to playbacks
# Run after JACK is started. Creates a 1:1 through-patch for direct monitoring.
jack_wait -w
# Get available ports
captures=$(jack_lsp -c system | grep capture || true)
playbacks=$(jack_lsp -c system | grep playback || true)
if [ -z "$captures" ] || [ -z "$playbacks" ]; then
echo "No system capture or playback ports found. Is JACK running?"
echo "Check: jack_lsp -c system"
exit 1
fi
# Route capture -> playback in pairs
# Assumes matching channel counts; pairs capture_1->playback_1, etc.
MAX_CHANNELS=18
for i in $(seq 1 $MAX_CHANNELS); do
CAP_PORT="system:capture_${i}"
PB_PORT="system:playback_${i}"
if jack_lsp -c system | grep -q "^${CAP_PORT}$" && \
jack_lsp -c system | grep -q "^${PB_PORT}$"; then
jack_connect "$CAP_PORT" "$PB_PORT" 2>/dev/null && \
echo " Connected: $CAP_PORT -> $PB_PORT" || \
echo " Already connected: $CAP_PORT -> $PB_PORT"
fi
done
# Optional: start a2jmidid for MIDI bridging
if command -v a2j_control &> /dev/null; then
if ! pgrep -x a2jmidid > /dev/null; then
a2j_control start 2>/dev/null && echo " MIDI bridge (a2jmidid) started"
fi
fi
echo "Routing complete."