Files
stormux/x86_64/airootfs/usr/local/bin/init-pipewire-sound.sh
2025-11-19 03:26:25 -05:00

22 lines
532 B
Bash
Executable File

#!/usr/bin/env bash
# Initialize pipewire audio by attempting to play sound until it succeeds
# This ensures pipewire is fully ready before fenrir starts
maxAttempts=30
attempt=0
while [[ $attempt -lt $maxAttempts ]]; do
# Try to play a silent sound using sox
if play -qnV0 synth .1 whi norm -100 2>/dev/null; then
# Success! Pipewire is working
exit 0
fi
# Wait a moment before trying again
sleep 1
((attempt++))
done
# Even if we failed, exit successfully so we don't block boot
exit 0