From 78b47f535555a26f2cfe288b127429f43e03b619 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 27 May 2026 08:25:53 +0000 Subject: [PATCH] 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