Skip to content

Instantly share code, notes, and snippets.

@mtlynch
Forked from Overemployed/install.sh
Created October 25, 2022 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtlynch/d06fc600648a51cd0ddf2d3cda8a162f to your computer and use it in GitHub Desktop.
Save mtlynch/d06fc600648a51cd0ddf2d3cda8a162f to your computer and use it in GitHub Desktop.
Jacktrip running on PiKVM / Raspberry Pi with arch distro
# your personal machine running jacktrip
REMOTE_JACK_SERVER=nat.local
# change to any name to identify this jacktrip client
JOB_NAME=J1
BUFFER_SIZE=1024
# -d hw:1,0 for pikvm v3 hat
# -d hw:0,0 for others
AUDIO_DEVICE=-d hw:1,0
pacman -Sy
pacman -S jack2 jacktrip njconnect jack-example-tools
useradd -M -r jacktrip -G audio
cat > /etc/systemd/system/jack.conf <<EOF
JACK_NO_AUDIO_RESERVATION=1
JACK_OPTS=-d alsa $AUDIO_DEVICE -r 44100 -p $BUFFER_SIZE
JACKTRIP_OPTS=-C $REMOTE_JACK_SERVER -n 1 --remotename $JOB_NAME
EOF
cat > /etc/systemd/system/jackd.service <<EOF
[Unit]
Description=jackd
After=sound.target
[Service]
User=jacktrip
Type=simple
LimitRTPRIO=infinity
LimitMEMLOCK=infinity
LimitRTTIME=infinity
EnvironmentFile=/etc/systemd/system/jack.conf
ExecStart=/usr/bin/jackd $JACK_OPTS
Restart=always
RestartSec=2s
[Install]
WantedBy=multi-user.target
EOF
cat > /etc/systemd/system/jacktrip.service <<EOF
[Unit]
Description=jacktrip
Requires=jackd.service
After=network.target jackd.service
[Service]
User=jacktrip
Type=simple
LimitRTPRIO=infinity
LimitMEMLOCK=infinity
LimitRTTIME=infinity
EnvironmentFile=/etc/systemd/system/jack.conf
ExecStartPre=jack_wait -w -t 5
ExecStart=/usr/bin/jacktrip $JACKTRIP_OPTS
Restart=always
RestartSec=2s
[Install]
WantedBy=multi-user.target
EOF
systemctl enable jackd.service
systemctl enable jacktrip.service
systemctl start jackd.service
systemctl start jacktrip.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment