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 # ########################