From e39c1cedec4f213b5b29378f697c3ee9b49ca9a9 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 19 Aug 2025 16:02:12 -0400 Subject: [PATCH] Finally figure out why volume adjustment wasn't happening first thing, it was in the wrong file. This should finally be resolved once and for all. --- pi4/files/etc/profile.d/stormux_first_boot.sh | 30 +++++++++++++++++++ pi4/files/usr/local/bin/configure-stormux | 29 +----------------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/pi4/files/etc/profile.d/stormux_first_boot.sh b/pi4/files/etc/profile.d/stormux_first_boot.sh index ee17001..1bdc2a5 100755 --- a/pi4/files/etc/profile.d/stormux_first_boot.sh +++ b/pi4/files/etc/profile.d/stormux_first_boot.sh @@ -12,6 +12,35 @@ if ! [[ -x /usr/local/bin/configure-stormux ]]; then return fi +# Volume calibration FIRST +echo "Setting up audio volume..." +volume=50 +wait=0 + +# Wait for pipewire to become available +while [[ $wait -lt 30 ]]; do + if pgrep pipewire &> /dev/null ; then + break + else + sleep 1 + ((wait++)) + fi +done + +# Volume calibration - this should be the VERY FIRST interactive part +while [[ $volume -le 130 ]]; do + clear + echo "Volume calibration (current: ${volume}%)" + pactl set-sink-volume @DEFAULT_SINK@ "${volume}%" 2>/dev/null + spd-say "If this is loud enough, press enter." + if read -t4 ; then + echo "Volume set to ${volume}%" + break + else + ((volume+=5)) + fi +done + # For audible sudo prompts: unset sudoFlags if [[ -x /etc/audibleprompt.sh ]]; then @@ -19,6 +48,7 @@ if [[ -x /etc/audibleprompt.sh ]]; then export sudoFlags=("-A") fi +clear cat << "EOF" Hello, and welcome to Stormux! diff --git a/pi4/files/usr/local/bin/configure-stormux b/pi4/files/usr/local/bin/configure-stormux index 08e755f..35e106e 100755 --- a/pi4/files/usr/local/bin/configure-stormux +++ b/pi4/files/usr/local/bin/configure-stormux @@ -24,34 +24,7 @@ if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then exit 0 fi -# Wait for pipewire to become available and set volume -echo "Waiting for audio system to initialize..." -volume=50 -wait=0 - -while [[ $wait -lt 30 ]]; do - if pgrep pipewire &> /dev/null ; then - echo "Audio system ready. Setting up volume..." - break - else - sleep 1 - ((wait++)) - fi -done - -# Volume calibration - this should be the first interactive part -while [[ $volume -le 130 ]]; do - clear - echo "Volume calibration (current: ${volume}%)" - pactl set-sink-volume @DEFAULT_SINK@ "${volume}%" 2>/dev/null - spd-say "If this is loud enough, press enter." - if read -t4 ; then - echo "Volume set to ${volume}%" - break - else - ((volume+=5)) - fi -done +# Volume calibration is now handled in stormux_first_boot.sh export DIALOGOPTS='--insecure --no-lines --visit-items'