Stop working after 5 songs
I tried this version on my RPI3 Jessie https://github.com/herrernst/librespot/releases and after 5 skip songs librespot stop working. Bye Sandro
++ I built it myself on a RPI3 using alsa and after a couple of tracks it simply stops playing. It is still available as a device in my other Spotify clients, I can select it and it looks like it would playback something (and e.g. the playing progress is also shared with other connected Spotify clients), but there is no output on the librespot device itself. It also doesn't log anything anymore, neither an error or something, nor loading/loaded messages of the tracks that it are displayed as playing in the Spotify clients. Restarting librespot solves the problem until it stops playing again after a couple of tracks.
Thanks for the reports. Could you please run librespot in gdb and Ctrl-C it when it hangs, and print the backtrace for all threads.
$ gdb --args target/debug/librespot --username XXX --password XXX
[...]
(gdb) run
[Wait for it to hang, ctrl-c when it does]
(gdb) thread apply all bt
Will do tonight. Can I run this on target/release/librespot as well or do I have to rebuild it first without the --release flag?
Release is probably fine
Here you go @plietar. The first backtrace is from the error scenario described above: I play a Spotify playlist and everything works for a while, but then a new track comes up (in this case "It's Time To Wake Up (2023)") and it doesn't playback, but it doesn't give an error message or crash either.
I also noticed that if I jump to any point in a track while playback still works, it's highly likely that an alsa underrun occurs, and then the rest of the behavior is the same as in the other error case, it doesn't crash, but I can't do anything to make it play stuff again other than restarting librespot. The second backtrace below is from such an alsa underrun.
(gdb) run
Starting program: /home/pi/librespot/target/debug/librespot --cache /tmp --name tini-connect --backend alsa
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
INFO:librespot: librespot eb49ff3 (2017-03-06). Built on 2017-03-15.
[New Thread 0x765ff380 (LWP 8582)]
[New Thread 0x763ff380 (LWP 8583)]
[New Thread 0x75fff380 (LWP 8584)]
[New Thread 0x75bff380 (LWP 8585)]
[Thread 0x763ff380 (LWP 8583) exited]
[Thread 0x75fff380 (LWP 8584) exited]
[Thread 0x75bff380 (LWP 8585) exited]
WARN:mdns::fsm: error sending packet Error { repr: Os { code: 99, message: "Cannot assign requested address" } }
[Thread 0x765ff380 (LWP 8582) exited]
INFO:librespot::session: Connecting to AP "sto3-accesspoint-a36.ap.spotify.com:4070"
INFO:librespot::session: Authenticated as "116580617" !
[New Thread 0x765ff380 (LWP 8586)]
INFO:librespot::audio_backend::alsa: Using alsa sink
INFO:librespot::player: Loading track "Yet Again"
INFO:librespot::player: Track "Yet Again" loaded
[New Thread 0x7102e380 (LWP 8587)]
[Thread 0x7102e380 (LWP 8587) exited]
INFO:librespot::player: Loading track "Pink Moon"
INFO:librespot::player: Track "Pink Moon" loaded
[New Thread 0x7102e380 (LWP 8618)]
[Thread 0x7102e380 (LWP 8618) exited]
INFO:librespot::player: Loading track "One of These Days"
INFO:librespot::player: Track "One of These Days" loaded
[New Thread 0x7102e380 (LWP 8620)]
[Thread 0x7102e380 (LWP 8620) exited]
INFO:librespot::player: Loading track "It's Time To Wake Up (2023)"
INFO:librespot::player: Track "It's Time to Wake Up 2023" loaded
[New Thread 0x7102e380 (LWP 8637)]
^C
Program received signal SIGINT, Interrupt.
0x76e65c14 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
81 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) thread apply all bt
Thread 10 (Thread 0x7102e380 (LWP 8637)):
#0 0x76e5bb80 in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x755de43c in ?? () from /usr/lib/arm-linux-gnueabihf/libpulse.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Thread 6 (Thread 0x765ff380 (LWP 8586)):
#0 0x76e5bb80 in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x76f1c428 in ?? () from /usr/lib/arm-linux-gnueabihf/libasound.so.2
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Thread 1 (Thread 0x76ff5000 (LWP 8581)):
#0 0x76e65c14 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
#1 0x5558b798 in mio::sys::unix::epoll::{{impl}}::select (self=0x76610090, evts=0x7efff3b8, awakener=..., timeout=...)
at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.4/src/sys/unix/epoll.rs:71
#2 0x55587e24 in mio::poll::{{impl}}::poll (self=0x76610090, events=0x7efff3b8, timeout=...)
at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.4/src/poll.rs:243
#3 0x5543acd4 in tokio_core::reactor::{{impl}}::poll (self=0x7efff3b8, max_wait=...)
at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.4/src/reactor/mod.rs:272
#4 0x54af78dc in tokio_core::reactor::{{impl}}::run<librespot::Main> (self=0x7efff3b8, f=...)
at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.4/src/reactor/mod.rs:237
#5 0x54b4a860 in librespot::main () at /home/pi/librespot/src/main.rs:311
#6 0x556250a4 in panic_unwind::__rust_maybe_catch_panic ()
---Type <return> to continue, or q <return> to quit---
at /buildslave/rust-buildbot/slave/stable-dist-rustc-cross-host-linux/build/src/libpanic_unwind/lib.rs:98
#7 0x5562068c in try<(),fn()> () at /buildslave/rust-buildbot/slave/stable-dist-rustc-cross-host-linux/build/src/libstd/panicking.rs:434
#8 catch_unwind<fn(),()> () at /buildslave/rust-buildbot/slave/stable-dist-rustc-cross-host-linux/build/src/libstd/panic.rs:351
#9 std::rt::lang_start () at /buildslave/rust-buildbot/slave/stable-dist-rustc-cross-host-linux/build/src/libstd/rt.rs:57
#10 0x54b4abf8 in main ()
(gdb) run
Starting program: /home/pi/librespot/target/debug/librespot --cache /tmp --name tini-connect --backend alsa
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
INFO:librespot: librespot eb49ff3 (2017-03-06). Built on 2017-03-15.
[New Thread 0x765ff380 (LWP 8563)]
[New Thread 0x763ff380 (LWP 8564)]
[New Thread 0x75fff380 (LWP 8565)]
[New Thread 0x75bff380 (LWP 8566)]
[Thread 0x763ff380 (LWP 8564) exited]
[Thread 0x75fff380 (LWP 8565) exited]
[Thread 0x75bff380 (LWP 8566) exited]
WARN:mdns::fsm: error sending packet Error { repr: Os { code: 99, message: "Cannot assign requested address" } }
[Thread 0x765ff380 (LWP 8563) exited]
INFO:librespot::session: Connecting to AP "sto3-accesspoint-a36.ap.spotify.com:4070"
INFO:librespot::session: Authenticated as "116580617" !
[New Thread 0x765ff380 (LWP 8567)]
INFO:librespot::audio_backend::alsa: Using alsa sink
INFO:librespot::player: Loading track "Skyscraper"
INFO:librespot::player: Track "Skyscraper" loaded
[New Thread 0x7102e380 (LWP 8568)]
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
^C
Program received signal SIGINT, Interrupt.
0x76e65c14 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
81 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) thread apply all bt
Thread 7 (Thread 0x7102e380 (LWP 8568)):
#0 0x76e5bb80 in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x755de43c in ?? () from /usr/lib/arm-linux-gnueabihf/libpulse.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Thread 6 (Thread 0x765ff380 (LWP 8567)):
#0 0x76e5bb80 in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x76f1c428 in ?? () from /usr/lib/arm-linux-gnueabihf/libasound.so.2
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Thread 1 (Thread 0x76ff5000 (LWP 8560)):
#0 0x76e65c14 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
#1 0x5558b798 in mio::sys::unix::epoll::{{impl}}::select (self=0x76610090, evts=0x7efff3b8, awakener=..., timeout=...)
at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.4/src/sys/unix/epoll.rs:71
#2 0x55587e24 in mio::poll::{{impl}}::poll (self=0x76610090, events=0x7efff3b8, timeout=...)
at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.4/src/poll.rs:243
#3 0x5543acd4 in tokio_core::reactor::{{impl}}::poll (self=0x7efff3b8, max_wait=...)
at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.4/src/reactor/mod.rs:272
#4 0x54af78dc in tokio_core::reactor::{{impl}}::run<librespot::Main> (self=0x7efff3b8, f=...)
at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.4/src/reactor/mod.rs:237
#5 0x54b4a860 in librespot::main () at /home/pi/librespot/src/main.rs:311
#6 0x556250a4 in panic_unwind::__rust_maybe_catch_panic ()
---Type <return> to continue, or q <return> to quit---
at /buildslave/rust-buildbot/slave/stable-dist-rustc-cross-host-linux/build/src/libpanic_unwind/lib.rs:98
#7 0x5562068c in try<(),fn()> () at /buildslave/rust-buildbot/slave/stable-dist-rustc-cross-host-linux/build/src/libstd/panicking.rs:434
#8 catch_unwind<fn(),()> () at /buildslave/rust-buildbot/slave/stable-dist-rustc-cross-host-linux/build/src/libstd/panic.rs:351
#9 std::rt::lang_start () at /buildslave/rust-buildbot/slave/stable-dist-rustc-cross-host-linux/build/src/libstd/rt.rs:57
#10 0x54b4abf8 in main ()
Any news how go head this issue? Thks Sandro
Update: I had pulseaudio installed, but decided to remove it because it made other problems as well and since then I don't experience this bug anymore.
I confirm. Unistalled Pulseaudio the problem has been solved. Bye Sandro
I have the same Problem but unfortunately i have no pulseaudio installed.. Tested with a fresh Debian install on a Pi1
I have a similar issue (it just stops playing after a few tracks, usually right in the middle of a song. No error, it just hangs). Trying to pause/play the track or skip to a different one on the remote official andoid app doesn't appear to do anything.
I run debian testing with pulseaudio disabled (pulse daemon not running).
Here's the backtrace when it occurs:
$ gdb librespot
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from librespot...done.
(gdb) r -c /home/lionel/.librespot-cache -n ed -u $user -p '$password' -b 320
Starting program: /home/lionel/bin/librespot -c /home/lionel/.librespot-cache -n ed -u $user -p '$password' -b 320
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
INFO:librespot: librespot 910974e (2017-07-17). Built on 2017-07-27. Build ID: MzdJ2b1M
[New Thread 0x7ffff5dff700 (LWP 9031)]
[New Thread 0x7ffff5bfe700 (LWP 9032)]
[New Thread 0x7ffff55ff700 (LWP 9033)]
[New Thread 0x7ffff4fff700 (LWP 9034)]
[Thread 0x7ffff4fff700 (LWP 9034) exited]
[Thread 0x7ffff55ff700 (LWP 9033) exited]
[Thread 0x7ffff5bfe700 (LWP 9032) exited]
[Thread 0x7ffff5dff700 (LWP 9031) exited]
INFO:librespot::session: Connecting to AP "lon3-accesspoint-a17.ap.spotify.com:4070"
INFO:librespot::session: Authenticated as "$user" !
[New Thread 0x7ffff5dff700 (LWP 9035)]
INFO:librespot::session: Country: "FR"
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
[New Thread 0x7fffef43d700 (LWP 9036)]
[Thread 0x7fffef43d700 (LWP 9036) exited]
INFO:librespot::player: Loading track "The Future"
INFO:librespot::player: Track "The Future" loaded
INFO:librespot::player: Loading track "Elvis"
INFO:librespot::player: Track "Elvis" loaded
INFO:librespot::player: Loading track "You've Got To... - Norman Cook Mix"
INFO:librespot::player: Track "You've Got to... - Norman Cook Mix" loaded
INFO:librespot::player: Loading track "They Come To Get Us - Original Death Set Punk Version"
INFO:librespot::player: Track "They Come To Get Us - Original Death Set Punk Version" loaded
INFO:librespot::player: Loading track "Creep"
INFO:librespot::player: Track "Creep" loaded
INFO:librespot::player: Loading track "8000 Mark"
INFO:librespot::player: Track "8000 Mark" loaded
INFO:librespot::player: Loading track "Holiday In Cambodia"
INFO:librespot::player: Track "Holiday In Cambodia" loaded
INFO:librespot::player: Loading track "Pisse"
INFO:librespot::player: Track "Pisse" loaded
INFO:librespot::player: Loading track "Body Movin' - 2009 Digital Remaster;"
INFO:librespot::player: Track "Body Movin' - 2009 Digital Remaster;" loaded
INFO:librespot::player: Loading track "Boy From School"
INFO:librespot::player: Track "Boy From School" loaded
INFO:librespot::player: Loading track "Der Computer Nr. 3"
INFO:librespot::player: Track "Der Computer Nr. 3" loaded
INFO:librespot::player: Loading track "Hippie Hippie"
INFO:librespot::player: Track "Hippie Hippie" loaded
INFO:librespot::player: Loading track "Love, L'amour und die Liebe"
INFO:librespot::player: Track "Love, L'amour und die Liebe" loaded
INFO:librespot::player: Loading track "Haifischbaby"
INFO:librespot::player: Track "Haifischbaby" loaded
INFO:librespot::player: Loading track "Wassermann und Fisch"
INFO:librespot::player: Track "Wassermann und Fisch" loaded
INFO:librespot::player: Loading track "Fire"
INFO:librespot::player: Track "Fire" loaded
INFO:librespot::player: Loading track "Territory"
INFO:librespot::player: Track "Territory" loaded
INFO:librespot::player: Loading track "Lordly (feat. Alex Aiono)"
INFO:librespot::player: Track "Lordly (feat. Alex Aiono)" loaded
INFO:librespot::player: Loading track "Be Mine"
INFO:librespot::player: Track "Be Mine" loaded
INFO:librespot::player: Loading track "Canopée"
INFO:librespot::player: Track "Canopée" loaded
^C
Thread 1 "librespot" received signal SIGINT, Interrupt.
0x00007ffff73d3083 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) thread apply all bt
Thread 6 (Thread 0x7ffff5dff700 (LWP 9035)):
#0 0x00007ffff73c963d in poll () at ../sysdeps/unix/syscall-template.S:84
#1 0x00007ffff7bbc865 in ?? () from /usr/lib/x86_64-linux-gnu/libportaudio.so.2
#2 0x00007ffff7bbcf93 in ?? () from /usr/lib/x86_64-linux-gnu/libportaudio.so.2
#3 0x0000555555620670 in _$LT$librespot..audio_backend..portaudio..PortAudioSink$LT$$u27$a$GT$$u20$as$u20$librespot..audio_backend..Sink$GT$::write::ha1fabe3c8917c934
()
#4 0x000055555563dc0f in librespot::player::PlayerInternal::run::hd82b52bc8fd6716c ()
#5 0x000055555559e2c3 in std::panicking::try::do_call::hd248eb7b413cbd3e ()
#6 0x00005555558e5ddb in panic_unwind::__rust_maybe_catch_panic () at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libpanic_unwind/lib.rs:98
#7 0x00005555555a2b9e in _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h77981694561c708b ()
#8 0x00005555558ddc05 in alloc::boxed::{{impl}}::call_once<(),()> () at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/liballoc/boxed.rs:624
#9 std::sys_common::thread::start_thread () at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/sys_common/thread.rs:21
#10 std::sys::imp::thread::{{impl}}::new::thread_start () at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/sys/unix/thread.rs:84
#11 0x00007ffff7690494 in start_thread (arg=0x7ffff5dff700) at pthread_create.c:333
#12 0x00007ffff73d2a8f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
Thread 1 (Thread 0x7ffff7fc9880 (LWP 9027)):
#0 0x00007ffff73d3083 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
#1 0x0000555555841101 in mio::poll::Poll::poll::h62614a35ab316ee3 ()
#2 0x0000555555839fb0 in tokio_core::reactor::Core::poll::he32b482b4d03a939 ()
#3 0x00005555555aa5bc in librespot::main::h3264c3ffe2b5a925 ()
#4 0x00005555558e5ddb in panic_unwind::__rust_maybe_catch_panic () at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libpanic_unwind/lib.rs:98
#5 0x00005555558df527 in std::panicking::try<(),fn()> () at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:436
#6 std::panic::catch_unwind<fn(),()> () at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panic.rs:361
#7 std::rt::lang_start () at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/rt.rs:57
#8 0x00007ffff730a2b1 in __libc_start_main (main=0x5555555aba40 <main>, argc=11, argv=0x7fffffffe6a8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffe698) at ../csu/libc-start.c:291
#9 0x000055555559938a in _start ()
(gdb)