badaix / snapcast

Synchronous multiroom audio player
GNU General Public License v3.0
6.14k stars 455 forks source link

Segfault on latest Alpine #1275

Closed rwjack closed 1 month ago

rwjack commented 1 month ago

Describe the bug Trying to rebuild my HA image in order to introduce the librespot credentials patch. Librespot runs fine on it's own, but Snapserver doesn't.

Steps to Reproduce

ARG BUILD_FROM=ghcr.io/hassio-addons/base:16.2.1 # alpine v3.20.2
FROM $BUILD_FROM

# Add env
ENV LANG C.UTF-8

# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN \
    apk add --no-cache \
        pulseaudio alsa-plugins-pulse bash \
    && rm -fr \
        /tmp/*

RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/ snapcast-server=0.28.0-r2

RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ librespot=0.4.2-r4

RUN \
    wget https://github.com/badaix/snapweb/releases/download/v0.8.0/snapweb.zip && \
    unzip -o snapweb.zip -d /usr/share/snapserver/snapweb/ && \
    rm snapweb.zip

# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh

CMD [ "/run.sh" ]
[server]
threads = -1
datadir = /data/snapserver/
[stream]
stream = spotify:///librespot?name=Spotify&devicename=HA_Snapcast&bitrate=320&volume=100&cache=/data/librespot&cache-size-limit=2G&autoplay=true&params=--disable-discovery
stream = tcp://0.0.0.0:4953?name=TTS&codec=pcm&mode=server
buffer = 1000
codec = flac
send_to_muted = false
sampleformat = 48000:32:2
[http]
enabled = true
bind_to_address = 0.0.0.0
doc_root = /usr/share/snapserver/snapweb/
[tcp]
enabled = true
[logging]
debug = false
root@local-snapcast-server-libspot:/$ librespot -c /data/librespot --cache-size-limit=2G --disable-discovery
[2024-08-21T13:23:49Z INFO  librespot] librespot 0.4.2 UNKNOWN (Built on 2023-08-01, Build ID: 1690865570, Profile: release)
[2024-08-21T13:23:49Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gue1.spotify.com:4070
[2024-08-21T13:23:49Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:443
[2024-08-21T13:23:49Z INFO  librespot_core::session] Connecting to AP "ap-gew1.spotify.com:4070"
[2024-08-21T13:23:49Z INFO  librespot_core::session] Authenticated as "X" !
[2024-08-21T13:23:49Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2024-08-21T13:23:49Z INFO  librespot_core::session] Country: "X"
[2024-08-21T13:23:49Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2024-08-21T13:23:49Z INFO  librespot_playback::audio_backend::rodio] Using Rodio sink with format S16 and cpal host: ALSA
[2024-08-21T13:23:49Z INFO  librespot_playback::audio_backend::rodio] Using audio device: default
root@local-snapcast-server-libspot:/$ snapserver -c /etc/snapserver.conf 
Segmentation fault (core dumped)

Environment details

Code is here: https://github.com/rwjack/addon-snapserver-spotify/

rwjack commented 1 month ago

This seems to have resolved the issue: https://github.com/rwjack/addon-snapserver-spotify/commit/e00310cc55a84b44580745da1bb64c6aca47dd20