From 05cbe751d58f1fa75efe58de03522b9f6da827a3 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 26 May 2026 16:23:20 +0000 Subject: [PATCH] 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 +}