Add one-command install script and stability fixes
- Add install.sh for automated setup - Add all component files (wrapper, service, config, verify) - Add stability fixes section (WiFi PowerSave disable + Watchdog) - Update README with new installation instructions
This commit is contained in:
24
03-darkice-wrapper.sh
Executable file
24
03-darkice-wrapper.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
MAX_WAIT_SEC=90
|
||||
SLEEP_STEP=2
|
||||
DARKICE_CMD="/usr/bin/darkice -c /home/pi/darkice.cfg"
|
||||
|
||||
log() { echo "[$(date '+%H:%M:%S')] $*" >&2; }
|
||||
|
||||
log "⏳ Waiting for ALSA card 0 (USB audio)..."
|
||||
|
||||
elapsed=0
|
||||
while ! arecord -l 2>/dev/null | grep -q "^card 0:"; do
|
||||
if (( elapsed >= MAX_WAIT_SEC )); then
|
||||
log "💥 FATAL: No card 0 after ${MAX_WAIT_SEC}s"
|
||||
arecord -l || true
|
||||
exit 1
|
||||
fi
|
||||
sleep "${SLEEP_STEP}"
|
||||
elapsed=$((elapsed + SLEEP_STEP))
|
||||
done
|
||||
|
||||
log "✅ Card 0 ready! Launching DarkIce."
|
||||
exec ${DARKICE_CMD}
|
||||
Reference in New Issue
Block a user