From 4e171ab12f8d716241cda30947ee7fa698ba9ce0 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 15 May 2025 10:55:48 +0200 Subject: [PATCH] Update 99-run.sh --- birdnet-go/rootfs/etc/cont-init.d/99-run.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/birdnet-go/rootfs/etc/cont-init.d/99-run.sh b/birdnet-go/rootfs/etc/cont-init.d/99-run.sh index e4100ff3f..67b869a4f 100755 --- a/birdnet-go/rootfs/etc/cont-init.d/99-run.sh +++ b/birdnet-go/rootfs/etc/cont-init.d/99-run.sh @@ -9,6 +9,15 @@ set -e bashio::log.info "ALSA_CARD option is set to $(bashio::config "ALSA_CARD"). If the microphone doesn't work, please adapt it" echo " " +# Adjust microphone volume if needed +if command -v amixer >/dev/null 2>/dev/null; then + current_volume="$(amixer sget Capture | grep -oP '\[\d+%\]' | tr -d '[]%' | head -1 2>/dev/null || echo "100")" || true + if [[ "$current_volume" -eq 0 ]]; then + amixer sset Capture 70% + bashio::log.warning "Microphone was off, volume set to 70%." + fi || true +fi + ######################## # CONFIGURE birdnet-go # ########################