[GH-ISSUE #1170] Playback stops when playlist ends #542

Closed
opened 2026-02-27 19:31:12 +03:00 by kerem · 9 comments
Owner

Originally created by @rwjack on GitHub (Jun 1, 2023).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1170

Describe the bug
It's almost as if this option (screenshot from spotify client) doesn't exist in librespot
image

Host (what you are running librespot on):

  • OS: Linux
  • Platform: Home Assistant Container
ARG BUILD_FROM
FROM $BUILD_FROM

# Add env
ENV LANG C.UTF-8

RUN \
    apk add --no-cache --virtual .build-dependencies \
        build-base=0.5-r3 \
        cargo=1.60.0-r2 \
        git \
        protobuf-dev=3.18.1-r3 \
        pulseaudio-dev=15.0-r2 \
    \
    && apk add --no-cache \
        pulseaudio=15.0-r2 \
    \
    && cargo install \
        --locked \
        --no-default-features \
        --features pulseaudio-backend \
        --root /usr \
        --bin librespot \
        --version 0.4.2 \
        --verbose \
        -- librespot \
    \
    && apk del --no-cache --purge .build-dependencies \
    && rm -fr \
        /tmp/* \
        ~/.cargo \
        /usr/.crates.toml \
        /usr/.crates2.json

#Install snapcast
RUN sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories && apk add --no-cache snapcast bash

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

CMD [ "/run.sh" ]
Originally created by @rwjack on GitHub (Jun 1, 2023). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1170 **Describe the bug** It's almost as if this option (screenshot from spotify client) doesn't exist in librespot ![image](https://github.com/librespot-org/librespot/assets/59068073/ce69d2a7-e5f8-47d9-ac90-dc2c3cb4e735) **Host (what you are running `librespot` on):** - OS: Linux - Platform: Home Assistant Container ``` ARG BUILD_FROM FROM $BUILD_FROM # Add env ENV LANG C.UTF-8 RUN \ apk add --no-cache --virtual .build-dependencies \ build-base=0.5-r3 \ cargo=1.60.0-r2 \ git \ protobuf-dev=3.18.1-r3 \ pulseaudio-dev=15.0-r2 \ \ && apk add --no-cache \ pulseaudio=15.0-r2 \ \ && cargo install \ --locked \ --no-default-features \ --features pulseaudio-backend \ --root /usr \ --bin librespot \ --version 0.4.2 \ --verbose \ -- librespot \ \ && apk del --no-cache --purge .build-dependencies \ && rm -fr \ /tmp/* \ ~/.cargo \ /usr/.crates.toml \ /usr/.crates2.json #Install snapcast RUN sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories && apk add --no-cache snapcast bash # Copy data for add-on COPY run.sh / RUN chmod a+x /run.sh CMD [ "/run.sh" ] ```
kerem 2026-02-27 19:31:12 +03:00
  • closed this issue
  • added the
    invalid
    label
Author
Owner

@eladyn commented on GitHub (Jun 1, 2023):

This might be the same issue as https://github.com/librespot-org/librespot/issues/1046.

<!-- gh-comment-id:1571989588 --> @eladyn commented on GitHub (Jun 1, 2023): This might be the same issue as https://github.com/librespot-org/librespot/issues/1046.
Author
Owner

@rwjack commented on GitHub (Jun 1, 2023):

Interesting. I sure would like to try out the dev branch, but I have no idea how to modify this Dockerfile in order to do so.

<!-- gh-comment-id:1571995315 --> @rwjack commented on GitHub (Jun 1, 2023): Interesting. I sure would like to try out the dev branch, but I have no idea how to modify this Dockerfile in order to do so.
Author
Owner

@eladyn commented on GitHub (Jun 1, 2023):

Oh, didn't notice that you are on 0.4.2. At this point, the autoplay option in the official client indeed doesn't affect librespot, and you need to turn --autoplay on manually.

<!-- gh-comment-id:1572001479 --> @eladyn commented on GitHub (Jun 1, 2023): Oh, didn't notice that you are on 0.4.2. At this point, the autoplay option in the official client indeed doesn't affect librespot, and you need to turn `--autoplay on` manually.
Author
Owner

@kingosticks commented on GitHub (Jun 1, 2023):

Interesting. I sure would like to try out the dev branch, but I have no idea how to modify this Dockerfile in order to do so.

The top few Google hits sound pretty promising, maybe:

&& cargo install \
        --locked \
        --no-default-features \
        --features pulseaudio-backend \
        --root /usr \
        --bin librespot \
        --git https://github.com/librespot-org/librespot \
        --branch dev \
        --verbose \
        -- librespot \
<!-- gh-comment-id:1572062027 --> @kingosticks commented on GitHub (Jun 1, 2023): > Interesting. I sure would like to try out the dev branch, but I have no idea how to modify this Dockerfile in order to do so. The [top few Google hits](https://duckduckgo.com/?t=ffab&q=cargo+install+from+git&atb=v351-1&ia=web) sound pretty promising, maybe: ``` && cargo install \ --locked \ --no-default-features \ --features pulseaudio-backend \ --root /usr \ --bin librespot \ --git https://github.com/librespot-org/librespot \ --branch dev \ --verbose \ -- librespot \ ```
Author
Owner

@rwjack commented on GitHub (Jun 1, 2023):

I'm building my container to start librespot with the --autoplay on flag. Let me see how it works

<!-- gh-comment-id:1572064506 --> @rwjack commented on GitHub (Jun 1, 2023): I'm building my container to start librespot with the `--autoplay on` flag. Let me see how it works
Author
Owner

@rwjack commented on GitHub (Jun 1, 2023):

And it did not seem to work...

It's Snapserver that actually starts up librespot, and here are the relevant log lines:

2023-06-01 13-46-44.492 [Info] (Snapserver) Version 0.27.0
2023-06-01 13-46-44.492 [Info] (Snapserver) Adding stream: spotify:///librespot?name=Spotify&username=xxx&password=xxx&devicename=HA_Snapcast&bitrate=320&volume=100&autoplay=on
2023-06-01 13-46-44.492 [Info] (Snapserver) Adding stream: tcp://0.0.0.0:4953?name=TTS&mode=server
2023-06-01 13-46-44.492 [Notice] (init) Settings file: "/data/snapserver/server.json"
2023-06-01 13-46-44.492 [Info] (Snapserver) Using HTTP host name: local-snapcast-server-libspot
2023-06-01 13-46-44.492 [Error] (Avahi) Failed to create client: Daemon not running
2023-06-01 13-46-44.492 [Info] (PcmStream) PcmStream: Spotify, sampleFormat: 44100:16:2
2023-06-01 13-46-44.493 [Info] (Server) Stream: {"fragment":"","host":"","path":"/librespot","query":{"autoplay":"on","bitrate":"320","chunk_ms":"20","codec":"flac","devicename":"HA_Snapcast","name":"Spotify","password":"xxx","sampleformat":"44100:16:2","username":"xxx","volume":"100"},"raw":"spotify:////librespot?autoplay=on&bitrate=320&chunk_ms=20&codec=flac&devicename=HA_Snapcast&name=Spotify&password=xxx&sampleformat=44100:16:2&username=xxx&volume=100","scheme":"spotify"}

Looking at the processes in the container, the autoplay flag isn't there. (omitted --username and -password)
image

This is probably a question for the Snapcast repo, but curious if anyone has encountered something similar.

<!-- gh-comment-id:1572100832 --> @rwjack commented on GitHub (Jun 1, 2023): And it did not seem to work... It's Snapserver that actually starts up librespot, and here are the relevant log lines: ``` 2023-06-01 13-46-44.492 [Info] (Snapserver) Version 0.27.0 2023-06-01 13-46-44.492 [Info] (Snapserver) Adding stream: spotify:///librespot?name=Spotify&username=xxx&password=xxx&devicename=HA_Snapcast&bitrate=320&volume=100&autoplay=on 2023-06-01 13-46-44.492 [Info] (Snapserver) Adding stream: tcp://0.0.0.0:4953?name=TTS&mode=server 2023-06-01 13-46-44.492 [Notice] (init) Settings file: "/data/snapserver/server.json" 2023-06-01 13-46-44.492 [Info] (Snapserver) Using HTTP host name: local-snapcast-server-libspot 2023-06-01 13-46-44.492 [Error] (Avahi) Failed to create client: Daemon not running 2023-06-01 13-46-44.492 [Info] (PcmStream) PcmStream: Spotify, sampleFormat: 44100:16:2 2023-06-01 13-46-44.493 [Info] (Server) Stream: {"fragment":"","host":"","path":"/librespot","query":{"autoplay":"on","bitrate":"320","chunk_ms":"20","codec":"flac","devicename":"HA_Snapcast","name":"Spotify","password":"xxx","sampleformat":"44100:16:2","username":"xxx","volume":"100"},"raw":"spotify:////librespot?autoplay=on&bitrate=320&chunk_ms=20&codec=flac&devicename=HA_Snapcast&name=Spotify&password=xxx&sampleformat=44100:16:2&username=xxx&volume=100","scheme":"spotify"} ``` Looking at the processes in the container, the autoplay flag isn't there. (omitted --username and -password) ![image](https://github.com/librespot-org/librespot/assets/59068073/acd32792-550f-41e5-8a3f-3578fbe780e6) This is probably a question for the Snapcast repo, but curious if anyone has encountered something similar.
Author
Owner

@eladyn commented on GitHub (Jun 1, 2023):

@rwjack Indeed, that probably doesn't belong here then, but snapcast expects true instead of on for the autoplay option.

<!-- gh-comment-id:1572171366 --> @eladyn commented on GitHub (Jun 1, 2023): @rwjack Indeed, that probably doesn't belong here then, but snapcast [expects `true`](https://github.com/badaix/snapcast/blob/481f08199ca31c60c9a3475f1064e6b06a503d12/server/streamreader/librespot_stream.cpp#L76) instead of `on` for the `autoplay` option.
Author
Owner

@rwjack commented on GitHub (Jun 1, 2023):

Well damn, you got me confused here:

Oh, didn't notice that you are on 0.4.2. At this point, the autoplay option in the official client indeed doesn't affect librespot, and you need to turn --autoplay on manually.

Yeah, upon setting autoplay=true in the Snapcast config, now I see the command line flag --autoplay on

<!-- gh-comment-id:1572202914 --> @rwjack commented on GitHub (Jun 1, 2023): Well damn, you got me confused here: > Oh, didn't notice that you are on 0.4.2. At this point, the autoplay option in the official client indeed doesn't affect librespot, and you need to turn --autoplay on manually. Yeah, upon setting `autoplay=true` in the Snapcast config, now I see the command line flag `--autoplay on`
Author
Owner

@roderickvd commented on GitHub (Jun 1, 2023):

Pretty sure this is not a librespot bug, so closing, but feel free to continue the discussion here or on Gitter.

<!-- gh-comment-id:1572606821 --> @roderickvd commented on GitHub (Jun 1, 2023): Pretty sure this is not a librespot bug, so closing, but feel free to continue the discussion here or on Gitter.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#542
No description provided.