Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to run multiple librespot streams #724

Closed
NDahlem opened this issue Nov 21, 2020 · 8 comments
Closed

Failure to run multiple librespot streams #724

NDahlem opened this issue Nov 21, 2020 · 8 comments

Comments

@NDahlem
Copy link

NDahlem commented Nov 21, 2020

Describe the bug
When I have one librespot stream defined in the config everything runs fine. As soon as I add more streams I get error and the seem to respawn forever

Steps to Reproduce

  1. add more than one librespot stream to config (each with a premium account)
  2. run snapserver
stream = librespot:///opt/librespot/librespot?name=Spotify 1&username=XXX&password=XXX&devicename="Spotify 1"&bitrate=320&wd_timeout=3600&volume=100&onevent=/home/music/librespot/librespot-event.sh 1&disable_audio_cache=true
stream = librespot:///opt/librespot/librespot?name=Spotify 2&username=XXX&password=XXX&devicename="Spotify 2"&bitrate=320&wd_timeout=3600&volume=100&onevent=/home/music/librespot/librespot-event.sh 2&disable_audio_cache=true
stream = librespot:///opt/librespot/librespot?name=Spotify 3&username=XXX&password=xP7vroCQwuYkgUY7&devicename="Spotify 3"&bitrate=320&wd_timeout=3600&volume=100&onevent=/home/music/librespot/librespot-event.sh 3&disable_audio_cache=true
stream = librespot:///opt/librespot/librespot?name=Spotify 4&username=XXX&password=XXX&devicename="Spotify 3"&bitrate=320&wd_timeout=3600&volume=100&onevent=/home/music/librespot/librespot-event.sh 4&disable_audio_cache=true


Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 1) [2020-11-21T10:49:20Z INFO  librespot] librespot 6a4bc83 (2020-11-18). Built on 2020-11-20. Build ID: VPllNSBN
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 2) [2020-11-21T10:49:20Z INFO  librespot] librespot 6a4bc83 (2020-11-18). Built on 2020-11-20. Build ID: VPllNSBN
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 3) [2020-11-21T10:49:20Z INFO  librespot] librespot 6a4bc83 (2020-11-18). Built on 2020-11-20. Build ID: VPllNSBN
Nov 21 10:49:20 music-new snapserver[161469]: Exception: end of file
Nov 21 10:49:20 music-new snapserver[161469]: Exception: end of file
Nov 21 10:49:20 music-new snapserver[161469]: Error while reading from stderr: End of file
Nov 21 10:49:20 music-new snapserver[161469]: message repeated 2 times: [ Error while reading from stderr: End of file]
Nov 21 10:49:20 music-new snapserver[161469]: Exception: end of file
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 4) [2020-11-21T10:49:20Z INFO  librespot] librespot 6a4bc83 (2020-11-18). Built on 2020-11-20. Build ID: VPllNSBN
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 4) [2020-11-21T10:49:20Z DEBUG librespot_connect::discovery] Zeroconf server listening on 0.0.0.0:41569
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 4) [2020-11-21T10:49:20Z INFO  librespot_core::session] Connecting to AP "gew1-accesspoint-b-0gs8.ap.spotify.com:4070"
Nov 21 10:49:20 music-new snapserver[161469]: Starting watchdog, timeout: 3600s
Nov 21 10:49:20 music-new snapserver[161469]: Error while reading from stderr: End of file
Nov 21 10:49:20 music-new snapserver[161469]: Exception: end of file
Nov 21 10:49:20 music-new snapserver[161469]: Starting watchdog, timeout: 3600s
Nov 21 10:49:20 music-new snapserver[161469]: Error while reading from stderr: End of file
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 1) [2020-11-21T10:49:20Z INFO  librespot] librespot 6a4bc83 (2020-11-18). Built on 2020-11-20. Build ID: VPllNSBN
Nov 21 10:49:20 music-new snapserver[161469]: Starting watchdog, timeout: 3600s
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 3) [2020-11-21T10:49:20Z INFO  librespot] librespot 6a4bc83 (2020-11-18). Built on 2020-11-20. Build ID: VPllNSBN
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 1) [2020-11-21T10:49:20Z DEBUG librespot_connect::discovery] Zeroconf server listening on 0.0.0.0:37227
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 3) [2020-11-21T10:49:20Z DEBUG librespot_connect::discovery] Zeroconf server listening on 0.0.0.0:44411
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 1) [2020-11-21T10:49:20Z INFO  librespot_core::session] Connecting to AP "gew1-accesspoint-b-vf92.ap.spotify.com:4070"
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 3) [2020-11-21T10:49:20Z INFO  librespot_core::session] Connecting to AP "gew1-accesspoint-b-gdg8.ap.spotify.com:4070"
Nov 21 10:49:20 music-new snapserver[161469]: Error while reading from stderr: End of file
Nov 21 10:49:20 music-new snapserver[161469]: Error while reading from stderr: End of file
Nov 21 10:49:20 music-new snapserver[161469]: Starting watchdog, timeout: 3600s
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 4) [2020-11-21T10:49:20Z INFO  librespot] librespot 6a4bc83 (2020-11-18). Built on 2020-11-20. Build ID: VPllNSBN
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 4) [2020-11-21T10:49:20Z DEBUG librespot_connect::discovery] Zeroconf server listening on 0.0.0.0:44725
Nov 21 10:49:20 music-new snapserver[161469]: Error while reading from stderr: End of file
Nov 21 10:49:20 music-new snapserver[161469]: Starting watchdog, timeout: 3600s
Nov 21 10:49:20 music-new snapserver[161469]: (Spotify 2) [2020-11-21T10:49:20Z INFO  librespot] librespot 6a4bc83 (2020-11-18). Built on 2020-11-20. Build ID: VPllNSBN
Nov 21 10:49:21 music-new snapserver[161469]: (Spotify 2) [2020-11-21T10:49:21Z DEBUG librespot_connect::discovery] Zeroconf server listening on 0.0.0.0:35635
Nov 21 10:49:21 music-new snapserver[161469]: (Spotify 2) [2020-11-21T10:49:21Z INFO  librespot_core::session] Connecting to AP "gew1-accesspoint-b-k16r.ap.spotify.com:4070"
Nov 21 10:49:21 music-new snapserver[161469]: Error while reading from stderr: End of file
Nov 21 10:49:21 music-new snapserver[161469]: Starting watchdog, timeout: 3600s
Nov 21 10:49:21 music-new snapserver[161469]: (Spotify 3) [2020-11-21T10:49:21Z INFO  librespot] librespot 6a4bc83 (2020-11-18). Built on 2020-11-20. Build ID: VPllNSBN
Nov 21 10:49:21 music-new snapserver[161469]: (Spotify 3) [2020-11-21T10:49:21Z DEBUG librespot_connect::discovery] Zeroconf server listening on 0.0.0.0:41819
Nov 21 10:49:21 music-new snapserver[161469]: Error while reading from stderr: End of file
Nov 21 10:49:21 music-new snapserver[161469]: Starting watchdog, timeout: 3600s```
@NDahlem NDahlem added the bug label Nov 21, 2020
@badaix
Copy link
Owner

badaix commented Nov 21, 2020

you must add killall=false to the librespot parameters. Otherwise each instance will kill all others before it starts.

@NDahlem
Copy link
Author

NDahlem commented Nov 21, 2020

I suspected I was doing something stupid ;-)
wd_timeout=3600 is not affected by this, right?

@badaix
Copy link
Owner

badaix commented Nov 21, 2020

No, each watchdog will monitor it's own librespot instance and will restart it if there hasn't been logged anything for 3600s.
All of these settings are from the early librespot days where it had to be restarted once in awhile. I think the killall default could be changed to false and the watchdog doesn't hurt, but it's actually superfluous.

@NDahlem
Copy link
Author

NDahlem commented Nov 21, 2020

I build the latest version from git and had it running with backend file into a fifo. It didn't seem to survive the internet reconnect last night, therefore I changed to snapserver starting librespot for the watchdog function.

Now I got an additional problem: I hear artefacts when changing volume or song. Is it possible that librespot writes something into the music stream?

@badaix
Copy link
Owner

badaix commented Nov 21, 2020

I recommend using the librespot plugin which reads data from librespots stdout.

@NDahlem
Copy link
Author

NDahlem commented Nov 21, 2020

I'm hearing the artefacts since changing to the librespot plugin. Standalone writing to fifo I did not notice them. Maybe something gets written to stdout which shouldn't be there.

@TekniskSupport
Copy link
Contributor

I did this the other day, but came up with another solution.
I added librespot as an additiojnal service in systemd with --backend pipe --device /tmp/librespot
Then i used a regular fifo as stream in snapcast

@NDahlem
Copy link
Author

NDahlem commented Nov 21, 2020

I added librespot ... with --backend pipe --device /tmp/librespot
Then i used a regular fifo as stream in snapcast

Had this too. But librespot didn't handle the loss of the internet connection gracefully. Therefore I'd like to use the plugin with the watchdog functionality, so I don't have to run my own watchdog.

@badaix badaix removed the bug label Nov 21, 2020
@badaix badaix closed this as completed Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants