Files
david 163ad4145b add prometheus exporter + test suite
- prometheus-exporter.py: stdlib-only HTTP metrics on :9090/metrics
- Exposes: ALSA status, hw_ptr rate, service health, mixer controls
- MIDI counters: notes_on, notes_off, errors
- test-unit.py: 10-test suite covering full MIDI→Pd→Audio pipeline
- test-tone.pd, test-midi-log.pd: minimal debug patches
- systemd service for exporter
- install.sh/deploy updated to include exporter
2026-06-24 02:22:05 -07:00

38 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# test-audio.sh — Test audio output on the board
# Usage: ./scripts/test-audio.sh [board_ip] [duration]
set -euo pipefail
BOARD="${1:-192.168.9.167}"
DURATION="${2:-3}"
SSH_KEY="/home/david/.ssh/unoq_deploy_key"
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i $SSH_KEY"
echo "=== Audio Output Test ==="
echo "Board: $BOARD"
echo "Duration: ${DURATION}s"
# Check ALSA mixer levels
echo ""
echo "--- Mixer Levels ---"
ssh $SSH_OPTS "arduino@$BOARD" "amixer -c 0 contents 2>/dev/null | grep -A2 'HPHL\|HPHR\|Switch' | head -30"
# Check Pd is running on correct device
echo ""
echo "--- Pd Process ---"
ssh $SSH_OPTS "arduino@$BOARD" "ps aux | grep 'pd.*audiooutdev' | grep -v grep | awk '{print \$NF}'"
# Check audio device state
echo ""
echo "--- ALSA Device State ---"
ssh $SSH_OPTS "arduino@$BOARD" "cat /proc/asound/card0/pcm0p/sub0/status 2>/dev/null || echo 'No active playback'"
# Play test tone via speaker-test
echo ""
echo "--- Playing test tone (${DURATION}s) ---"
ssh $SSH_OPTS "arduino@$BOARD" "timeout $DURATION speaker-test -D hw:0,0 -t sine -f 440 -c 1 2>&1 | tail -3"
echo ""
echo "=== Audio Test Complete ==="
echo "If you heard a 440Hz tone, audio output is working."