mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-17 15:19:08 +02:00
Compare commits
2 Commits
d31ccfa21c
...
fix/birdne
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fdaaeb481 | ||
|
|
38423f4bff |
@@ -1,3 +1,8 @@
|
||||
## 2026.08.15 (15-08-2026)
|
||||
|
||||
- Fix: `ALSA_CARD` now really selects the microphone. Its value was copied as-is into `REC_CARD`, but BirdNET-Pi hands `REC_CARD` to `arecord -D` / `ffmpeg -f alsa -i`, which expect an ALSA PCM name: a card index such as `1` gave `Unknown PCM 1` and no recording at all. It is now converted to `plughw:CARD=<value>,DEV=0`, while a value that already is a PCM name (`dsnoop:CARD=Audio,DEV=0`, `default`, `null`, `pulse`, `pipewire`, ...) is used as provided
|
||||
- Fix: writing `REC_CARD` no longer detaches `birdnet.conf` from `/config`. `sed -i` replaced the `$HOME/BirdNET-Pi/birdnet.conf` symlink with a regular file, so later edits from the WebUI went to a different file than the one the add-on had written; it now edits `/config/birdnet.conf` with `--follow-symlinks`
|
||||
|
||||
## 2026.07.10-2 (10-07-2026)
|
||||
- Minor bugs fixed
|
||||
## 2026.07.10 (10-07-2026)
|
||||
|
||||
@@ -116,5 +116,5 @@ tmpfs: true
|
||||
udev: true
|
||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pi-zach
|
||||
usb: true
|
||||
version: 2026.07.10.2
|
||||
version: 2026.08.15
|
||||
video: true
|
||||
|
||||
@@ -66,12 +66,25 @@ fi || true
|
||||
|
||||
# Use ALSA CARD defined in add-on options if available
|
||||
if [ -n "${ALSA_CARD:-}" ]; then
|
||||
bashio::log.warning "ALSA_CARD is defined, the birdnet.conf is adapt to use device $ALSA_CARD"
|
||||
for file in "$HOME"/BirdNET-Pi/birdnet.conf /config/birdnet.conf; do
|
||||
if [ -f "$file" ]; then
|
||||
sed -i "/^REC_CARD/c\REC_CARD=$ALSA_CARD" "$file"
|
||||
fi
|
||||
done
|
||||
# REC_CARD is passed as-is to "arecord -D" (scripts/birdnet_recording.sh) and to
|
||||
# "ffmpeg -f alsa -i" (scripts/livestream.sh), so it must be an ALSA PCM name.
|
||||
# ALSA_CARD holds a card index (1) or a card id (Audio), which are not PCM names:
|
||||
# writing them as-is gives "Unknown PCM 1" and no recording at all. Build a PCM
|
||||
# name from them, and pass through a value that already is one (plughw:...).
|
||||
if [[ "$ALSA_CARD" == *:* ]] || [[ "$ALSA_CARD" =~ ^(default|null|pulse|pipewire)$ ]]; then
|
||||
REC_CARD="$ALSA_CARD"
|
||||
else
|
||||
REC_CARD="plughw:CARD=${ALSA_CARD},DEV=0"
|
||||
fi
|
||||
bashio::log.warning "ALSA_CARD is defined, the birdnet.conf is adapted to use device $REC_CARD"
|
||||
# --follow-symlinks : $HOME/BirdNET-Pi/birdnet.conf is a symlink to /config/birdnet.conf
|
||||
# (01-structure.sh), and sed -i would replace it with a regular file, detaching it from
|
||||
# the file the WebUI writes to. Only /config/birdnet.conf is updated directly, since the
|
||||
# home-path symlink is writable by the pi/caddy user and could be repointed before this
|
||||
# root-run script gets to it.
|
||||
if [ -f /config/birdnet.conf ]; then
|
||||
sed -i --follow-symlinks "/^REC_CARD/c\REC_CARD=$REC_CARD" /config/birdnet.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
# Define permissions for audio
|
||||
|
||||
Reference in New Issue
Block a user