diff --git a/birdnet-go/CHANGELOG.md b/birdnet-go/CHANGELOG.md index 58f2e23de5..d7a86bc0bf 100644 --- a/birdnet-go/CHANGELOG.md +++ b/birdnet-go/CHANGELOG.md @@ -1,3 +1,6 @@ +## nightly-20260525-2 (26-05-2026) +- Suppress noisy startup logs: silence `chmod /dev/snd` errors on the read-only HA mount, and hide unavailable ALSA plugins (JACK, OSS, dsnoop) from device enumeration so libjack and pcm_oss/dsnoop probes no longer print at launch. ALSA overrides are written to `/root/.asoundrc` (since `/etc/asound.conf` is read-only in this environment). +- Allow advanced users to override the ALSA config by dropping a custom `asound.conf` into the addon config folder. - Add LOG_MAX_SIZE_MB and LOG_MAX_AGE_DAYS addon options to manage log storage size - Automatically trim log files exceeding configured age on startup diff --git a/birdnet-go/Dockerfile b/birdnet-go/Dockerfile index 857ad5801e..c5664ed3cf 100644 --- a/birdnet-go/Dockerfile +++ b/birdnet-go/Dockerfile @@ -36,6 +36,13 @@ ENV S6_CMD_WAIT_FOR_SERVICES=1 \ COPY rootfs/ / RUN find . -type f \( -name "*.sh" -o -name "run" -o -name "finish" \) -print -exec chmod +x {} \; +# Silence "chmod: Read-only file system" noise from upstream entrypoint: +# Home Assistant mounts /dev/snd read-only, so the chmod is a no-op and the +# stderr output is just noise. The "|| true" already absorbs the exit code. +RUN if [ -f /usr/bin/entrypoint.sh ]; then \ + sed -i 's#chmod -R a+rw /dev/snd || true#chmod -R a+rw /dev/snd 2>/dev/null || true#' /usr/bin/entrypoint.sh; \ + fi + # Uses /bin for compatibility purposes # hadolint ignore=DL4005 RUN if [ ! -f /bin/sh ] && [ -f /usr/bin/sh ]; then ln -s /usr/bin/sh /bin/sh; fi && \ diff --git a/birdnet-go/config.yaml b/birdnet-go/config.yaml index d4b0656194..5c5d5ad94a 100644 --- a/birdnet-go/config.yaml +++ b/birdnet-go/config.yaml @@ -122,4 +122,4 @@ slug: birdnet-go udev: true url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-go usb: true -version: "nightly-20260525" +version: "nightly-20260525-2" 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 4e4c02d093..9c81589d8f 100755 --- a/birdnet-go/rootfs/etc/cont-init.d/99-run.sh +++ b/birdnet-go/rootfs/etc/cont-init.d/99-run.sh @@ -8,6 +8,20 @@ set -e echo " " +# Allow advanced users to supply their own ALSA config (e.g. to enable JACK +# or a custom dsnoop chain) by dropping asound.conf into the addon config +# folder. Written to /root/.asoundrc because /etc/asound.conf is read-only. +if [ -f /config/asound.conf ]; then + if [ -r /config/asound.conf ]; then + bashio::log.info "Using user-provided /config/asound.conf, overriding addon defaults" + if ! cp /config/asound.conf /root/.asoundrc; then + bashio::log.warning "Failed to copy /config/asound.conf; continuing with bundled /root/.asoundrc defaults" + fi + else + bashio::log.warning "/config/asound.conf exists but is not readable; continuing with bundled /root/.asoundrc defaults" + fi +fi + # Check if alsa_card is provided CONFIG_LOCATION="/config/config.yaml" if bashio::config.true "homeassistant_microphone"; then diff --git a/birdnet-go/rootfs/root/.asoundrc b/birdnet-go/rootfs/root/.asoundrc new file mode 100644 index 0000000000..3a7d1d5119 --- /dev/null +++ b/birdnet-go/rootfs/root/.asoundrc @@ -0,0 +1,35 @@ +# Home Assistant addon: birdnet-go +# +# Shipped at /root/.asoundrc because /etc/asound.conf is read-only in this +# environment. ALSA loads ~/.asoundrc as an additive layer on top of the +# system config, so the overrides below take effect for the birdnet-go process +# (which runs as root, HOME=/root). +# +# Replace ALSA PCM plugins whose backends are not available in the addon +# container (JACK server, OSS /dev/dsp) with type "null" and hide them from +# snd_device_name_hint(). Without this, miniaudio's capture-device enumeration +# probes every PCM hint at startup, triggering noisy errors like: +# - "Cannot connect to server socket" / "jack server is not running" (libjack) +# - "ALSA lib pcm_oss.c: Cannot open device /dev/dsp" +# - "ALSA lib pcm_dsnoop.c: unable to open slave" +# BirdNET-Go itself never opens these PCMs; only the enumeration probe does. + +pcm.!jack { + type null + hint.show off +} + +pcm.!oss { + type null + hint.show off +} + +pcm.!dsp { + type null + hint.show off +} + +pcm.!dsnoop { + type null + hint.show off +}