mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-05 15:15:58 +02:00
Merge pull request #2519 from alexbelgium/copilot/fix-icecast-pulse-server-issue
Fix BirdNET-PiPy Icecast failing to connect to PulseAudio on HAOS
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
- Fix Icecast service failing to connect to PulseAudio on HAOS by respecting PULSE_SERVER env var and setting up socket symlink and auth cookie for icecast2 user
|
||||||
|
|
||||||
## 0.5.4 (2026-02-21)
|
## 0.5.4 (2026-02-21)
|
||||||
- Update to latest version from Suncuss/BirdNET-PiPy (changelog : https://github.com/Suncuss/BirdNET-PiPy/releases)
|
- Update to latest version from Suncuss/BirdNET-PiPy (changelog : https://github.com/Suncuss/BirdNET-PiPy/releases)
|
||||||
|
|||||||
@@ -93,5 +93,5 @@ schema:
|
|||||||
ssl: bool?
|
ssl: bool?
|
||||||
slug: birdnet-pipy
|
slug: birdnet-pipy
|
||||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pipy
|
url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pipy
|
||||||
version: "0.5.4"
|
version: "0.5.4-2"
|
||||||
webui: "[PROTO:ssl]://[HOST]:[PORT:80]"
|
webui: "[PROTO:ssl]://[HOST]:[PORT:80]"
|
||||||
|
|||||||
@@ -14,8 +14,32 @@ if [ -n "${SND_GID}" ] && getent group audio >/dev/null 2>&1; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for u in root nginx www-data; do
|
for u in root nginx www-data icecast2; do
|
||||||
if id "${u}" >/dev/null 2>&1; then
|
if id "${u}" >/dev/null 2>&1; then
|
||||||
usermod -aG audio "${u}" 2>/dev/null || true
|
usermod -aG audio "${u}" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Create /run/pulse/native symlink if the PulseAudio socket is elsewhere
|
||||||
|
# (e.g. HAOS provides it at /run/audio/pulse.sock)
|
||||||
|
PULSE_SOCK="${PULSE_SERVER:-}"
|
||||||
|
PULSE_SOCK="${PULSE_SOCK#unix:}"
|
||||||
|
if [ -n "${PULSE_SOCK}" ] && [ -S "${PULSE_SOCK}" ] && [ ! -S /run/pulse/native ]; then
|
||||||
|
mkdir -p /run/pulse
|
||||||
|
ln -sf "${PULSE_SOCK}" /run/pulse/native
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy PulseAudio cookie for the icecast2 user so it can authenticate
|
||||||
|
if id icecast2 >/dev/null 2>&1; then
|
||||||
|
ICECAST_HOME="$(getent passwd icecast2 | cut -d: -f6)"
|
||||||
|
if [ -n "${ICECAST_HOME}" ]; then
|
||||||
|
for cookie in /config/.config/pulse/cookie /root/.config/pulse/cookie; do
|
||||||
|
if [ -f "${cookie}" ]; then
|
||||||
|
mkdir -p "${ICECAST_HOME}/.config/pulse"
|
||||||
|
cp "${cookie}" "${ICECAST_HOME}/.config/pulse/cookie"
|
||||||
|
chown icecast2 "${ICECAST_HOME}/.config/pulse" "${ICECAST_HOME}/.config/pulse/cookie"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
#!/usr/bin/with-contenv bashio
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export PULSE_SERVER=unix:/run/pulse/native
|
export PULSE_SERVER="${PULSE_SERVER:-unix:/run/pulse/native}"
|
||||||
gosu icecast2 /usr/local/bin/start-icecast.sh
|
gosu icecast2 /usr/local/bin/start-icecast.sh
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export PYTHONPATH=/app
|
export PYTHONPATH=/app
|
||||||
export PULSE_SERVER=unix:/run/pulse/native
|
export PULSE_SERVER="${PULSE_SERVER:-unix:/run/pulse/native}"
|
||||||
bashio::net.wait_for 5002 127.0.0.1 300
|
bashio::net.wait_for 5002 127.0.0.1 300
|
||||||
cd /app
|
cd /app
|
||||||
exec python3 -m core.main
|
exec python3 -m core.main
|
||||||
|
|||||||
Reference in New Issue
Block a user