Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -562,20 +562,20 @@ section "Speaker Volume"
# the volume button service.
if amixer -c seeed2micvoicec controls 2>/dev/null | grep -qi "speaker"; then
info "Setting WM8960 hardware speaker to 94% (fixed master level)..."
amixer -c seeed2micvoicec sset 'Speaker' 94% -q
amixer -c seeed2micvoicec cset numid=13 127,127 -q
success "Hardware speaker level set."
else
warn "Could not find Speaker control on seeed2micvoicec — skipping (card not loaded yet)."
warn "Audio init service will apply this on first boot."
fi

# Seed default per-stream software volumes if state files don't exist yet.
# TTS at 90%, media at 75% — voice slightly louder than music by default.
# TTS at 100%, media at 90% — voice slightly louder than music by default.
# Mic gain at 63% — maps to ALSA value 40 (0 dB on the WM8960 Capture PGA).
[ -f "$CURRENT_HOME/.smart-display-tts-volume" ] || echo "90" > "$CURRENT_HOME/.smart-display-tts-volume"
[ -f "$CURRENT_HOME/.smart-display-media-volume" ] || echo "75" > "$CURRENT_HOME/.smart-display-media-volume"
[ -f "$CURRENT_HOME/.smart-display-tts-volume" ] || echo "100" > "$CURRENT_HOME/.smart-display-tts-volume"
[ -f "$CURRENT_HOME/.smart-display-media-volume" ] || echo "90" > "$CURRENT_HOME/.smart-display-media-volume"
[ -f "$CURRENT_HOME/.smart-display-mic-gain" ] || echo "63" > "$CURRENT_HOME/.smart-display-mic-gain"
success "Default stream volumes seeded (TTS: 90%, Media: 75%, Mic: 63%)."
success "Default stream volumes seeded (TTS: 100%, Media: 90%, Mic: 63%)."

# Persist all ALSA mixer settings so they survive reboot.
# alsactl store writes to /var/lib/alsa/asound.state.
Expand Down Expand Up @@ -616,7 +616,7 @@ done
# This must be re-applied every boot because alsactl restore can be beaten by the
# driver resetting codec registers after enumeration. Keeping it here rather than
# in asound.state makes the intent explicit and self-documenting.
amixer -c seeed2micvoicec cset numid=13 122,122 -q 2>/dev/null || true
amixer -c seeed2micvoicec cset numid=13 127,127 -q 2>/dev/null || true

# Re-apply ALC settings explicitly. Enumerated controls (type=ENUMERATED) are
# not reliably restored by alsactl on all kernel/driver versions.
Expand Down Expand Up @@ -902,7 +902,7 @@ pkill wfbar || true
# This runs here in addition to smart-display-audio-init.service because the
# audio-init service fires early in boot before the codec registers have fully
# settled; by the time the desktop session starts the driver is stable.
amixer -c seeed2micvoicec cset numid=13 122,122 -q 2>/dev/null || true
amixer -c seeed2micvoicec cset numid=13 127,127 -q 2>/dev/null || true

# Hide the mouse cursor
unclutter --timeout 1 &
Expand Down
4 changes: 2 additions & 2 deletions mqtt-bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def on_connect(client, userdata, connect_flags, reason_code, properties):
client.publish(topic, json.dumps(payload), retain=True)

# Publish current state so HA sliders reflect actual values immediately
client.publish(state_topic("tts_volume"), str(_read_state(TTS_VOL_FILE, 90)), retain=True)
client.publish(state_topic("media_volume"), str(_read_state(MEDIA_VOL_FILE, 75)), retain=True)
client.publish(state_topic("tts_volume"), str(_read_state(TTS_VOL_FILE, 100)), retain=True)
client.publish(state_topic("media_volume"), str(_read_state(MEDIA_VOL_FILE, 90)), retain=True)
client.publish(state_topic("brightness"), str(_read_brightness_pct()), retain=True)
client.publish(state_topic("mic_gain"), str(_read_mic_gain_pct()), retain=True)

Expand Down