systemd services: midi-bridge, pd-synth-onboard, led-matrix-viz + install script
This commit is contained in:
+21
-18
@@ -1,27 +1,30 @@
|
||||
#!/bin/bash
|
||||
# install.sh — Install system dependencies on the Uno Q
|
||||
# Run this on the board: ssh arduino@uno-q.local 'bash -s' < install.sh
|
||||
|
||||
# install-services.sh — Deploy systemd services to board
|
||||
set -euo pipefail
|
||||
|
||||
echo "[INSTALL] Updating packages..."
|
||||
sudo apt update -qq
|
||||
REPO="/home/arduino/uno-q-audio-synth"
|
||||
SERVICES=(midi-bridge pd-synth-onboard led-matrix-viz)
|
||||
|
||||
echo "[INSTALL] Installing Pure Data..."
|
||||
sudo apt install -y -qq puredata alsa-utils
|
||||
for svc in "${SERVICES[@]}"; do
|
||||
sudo cp "$REPO/system/$svc.service" /etc/systemd/system/
|
||||
done
|
||||
|
||||
echo "[INSTALL] Installing USB gadget config..."
|
||||
sudo cp system/configure-usb-audio.sh /usr/local/bin/
|
||||
sudo chmod +x /usr/local/bin/configure-usb-audio.sh
|
||||
sudo cp system/asound.conf /etc/asound.conf
|
||||
# Fix UCM bug (must survive OS updates)
|
||||
FILE=/usr/share/alsa/ucm2/codecs/qcom-lpass/rx-macro/HeadphoneEnableSeq.conf
|
||||
if grep -q "RX HPH Mode" "$FILE" 2>/dev/null; then
|
||||
sudo sed -i '/RX HPH Mode/d' "$FILE"
|
||||
echo "[OK] UCM HeadphoneEnableSeq patched"
|
||||
fi
|
||||
|
||||
echo "[INSTALL] Installing systemd services..."
|
||||
sudo cp system/usb-gadget-audio.service /etc/systemd/system/
|
||||
sudo cp system/pd-synth.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
echo "[INSTALL] Enabling services..."
|
||||
sudo systemctl enable usb-gadget-audio
|
||||
sudo systemctl enable pd-synth
|
||||
# Stop/mask old conflicting services
|
||||
sudo systemctl stop pd-synth pd-synth-auto pd-synth-i2s 2>/dev/null || true
|
||||
sudo systemctl disable pd-synth pd-synth-auto pd-synth-i2s 2>/dev/null || true
|
||||
sudo systemctl mask pd-synth pd-synth-auto pd-synth-i2s 2>/dev/null || true
|
||||
|
||||
echo "[INSTALL] Done. Reboot with: sudo reboot"
|
||||
for svc in "${SERVICES[@]}"; do
|
||||
sudo systemctl enable "$svc"
|
||||
done
|
||||
|
||||
echo "[OK] Services installed and enabled"
|
||||
|
||||
Reference in New Issue
Block a user