From 05cbe751d58f1fa75efe58de03522b9f6da827a3 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 26 May 2026 16:23:20 +0000 Subject: [PATCH 1/4] birdnet-go: suppress noisy startup errors - Patch upstream entrypoint via sed so chmod on the read-only /dev/snd mount no longer prints "Read-only file system" lines. - Add /etc/asound.conf overriding the JACK, OSS, dsp, and dsnoop PCM plugins to type "null" with hint.show off. This hides them from snd_device_name_hint(), so miniaudio's device enumeration no longer probes them at launch and the corresponding libjack/pcm_oss/pcm_dsnoop errors disappear. --- birdnet-go/CHANGELOG.md | 3 +++ birdnet-go/Dockerfile | 7 +++++++ birdnet-go/config.yaml | 2 +- birdnet-go/rootfs/etc/asound.conf | 30 ++++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 birdnet-go/rootfs/etc/asound.conf diff --git a/birdnet-go/CHANGELOG.md b/birdnet-go/CHANGELOG.md index 2b79c1342e..d67237d084 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. + ## nightly-20260525 (26-05-2026) - Minor bugs fixed ## nightly-20260511-414-2 (22-05-2026) 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 7a340fa31c..a60d506cfd 100644 --- a/birdnet-go/config.yaml +++ b/birdnet-go/config.yaml @@ -118,4 +118,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/asound.conf b/birdnet-go/rootfs/etc/asound.conf new file mode 100644 index 0000000000..05ecb40f3e --- /dev/null +++ b/birdnet-go/rootfs/etc/asound.conf @@ -0,0 +1,30 @@ +# Home Assistant addon: birdnet-go +# +# 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 +} From 4975eca7c2c7c25e348253bc9caeb4e0ab6bc629 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 26 May 2026 19:47:05 +0000 Subject: [PATCH 2/4] birdnet-go: allow user-supplied /config/asound.conf override Advanced users who legitimately need JACK, a custom dsnoop chain, or any other ALSA setup can drop their own asound.conf into the addon config folder. The cont-init script copies it over /etc/asound.conf before launching the app, replacing the addon-shipped defaults. --- birdnet-go/CHANGELOG.md | 1 + birdnet-go/rootfs/etc/cont-init.d/99-run.sh | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/birdnet-go/CHANGELOG.md b/birdnet-go/CHANGELOG.md index d67237d084..f91494b64e 100644 --- a/birdnet-go/CHANGELOG.md +++ b/birdnet-go/CHANGELOG.md @@ -1,5 +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. +- Allow advanced users to override the addon's `/etc/asound.conf` by dropping a custom `asound.conf` into the addon config folder. ## nightly-20260525 (26-05-2026) - Minor bugs fixed 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..981d781a7e 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,13 @@ set -e echo " " +# Allow advanced users to supply their own /etc/asound.conf (e.g. to enable +# JACK or a custom dsnoop chain) by dropping it into the addon config folder. +if [ -f /config/asound.conf ]; then + bashio::log.info "Using user-provided /config/asound.conf, overriding addon defaults" + cp /config/asound.conf /etc/asound.conf +fi + # Check if alsa_card is provided CONFIG_LOCATION="/config/config.yaml" if bashio::config.true "homeassistant_microphone"; then From d6de19315d20519e4d0b988a31d6664a187d532b Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 27 May 2026 07:27:14 +0200 Subject: [PATCH 3/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- birdnet-go/rootfs/etc/cont-init.d/99-run.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 981d781a7e..6c780053f6 100755 --- a/birdnet-go/rootfs/etc/cont-init.d/99-run.sh +++ b/birdnet-go/rootfs/etc/cont-init.d/99-run.sh @@ -11,8 +11,14 @@ echo " " # Allow advanced users to supply their own /etc/asound.conf (e.g. to enable # JACK or a custom dsnoop chain) by dropping it into the addon config folder. if [ -f /config/asound.conf ]; then - bashio::log.info "Using user-provided /config/asound.conf, overriding addon defaults" - cp /config/asound.conf /etc/asound.conf + if [ -r /config/asound.conf ]; then + bashio::log.info "Using user-provided /config/asound.conf, overriding addon defaults" + if ! cp /config/asound.conf /etc/asound.conf; then + bashio::log.warning "Failed to copy /config/asound.conf; continuing with bundled /etc/asound.conf defaults" + fi + else + bashio::log.warning "/config/asound.conf exists but is not readable; continuing with bundled /etc/asound.conf defaults" + fi fi # Check if alsa_card is provided From 78b47f535555a26f2cfe288b127429f43e03b619 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 27 May 2026 08:25:53 +0000 Subject: [PATCH 4/4] birdnet-go: ship ALSA overrides at /root/.asoundrc /etc/asound.conf is read-only in the addon environment, so both the shipped overrides and the user-supplied override are now written to /root/.asoundrc (the app runs as root with HOME=/root). ALSA loads ~/.asoundrc as an additive layer on top of the system config, so the override behavior is unchanged. --- birdnet-go/CHANGELOG.md | 4 ++-- birdnet-go/rootfs/etc/cont-init.d/99-run.sh | 11 ++++++----- birdnet-go/rootfs/{etc/asound.conf => root/.asoundrc} | 5 +++++ 3 files changed, 13 insertions(+), 7 deletions(-) rename birdnet-go/rootfs/{etc/asound.conf => root/.asoundrc} (74%) diff --git a/birdnet-go/CHANGELOG.md b/birdnet-go/CHANGELOG.md index f91494b64e..639f5289e3 100644 --- a/birdnet-go/CHANGELOG.md +++ b/birdnet-go/CHANGELOG.md @@ -1,6 +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. -- Allow advanced users to override the addon's `/etc/asound.conf` by dropping a custom `asound.conf` into the addon config folder. +- 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. ## nightly-20260525 (26-05-2026) - Minor bugs fixed 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 6c780053f6..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,16 +8,17 @@ set -e echo " " -# Allow advanced users to supply their own /etc/asound.conf (e.g. to enable -# JACK or a custom dsnoop chain) by dropping it into the addon config folder. +# 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 /etc/asound.conf; then - bashio::log.warning "Failed to copy /config/asound.conf; continuing with bundled /etc/asound.conf 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 /etc/asound.conf defaults" + bashio::log.warning "/config/asound.conf exists but is not readable; continuing with bundled /root/.asoundrc defaults" fi fi diff --git a/birdnet-go/rootfs/etc/asound.conf b/birdnet-go/rootfs/root/.asoundrc similarity index 74% rename from birdnet-go/rootfs/etc/asound.conf rename to birdnet-go/rootfs/root/.asoundrc index 05ecb40f3e..3a7d1d5119 100644 --- a/birdnet-go/rootfs/etc/asound.conf +++ b/birdnet-go/rootfs/root/.asoundrc @@ -1,5 +1,10 @@ # 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