[GH-ISSUE #225] 'main' panicked at 'called Result::unwrap() when switching off phone screen #149

Closed
opened 2026-02-27 19:29:06 +03:00 by kerem · 3 comments
Owner

Originally created by @meiseGit on GitHub (May 18, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/225

Hi,
I'm running librespot on my raspberry pi 3 and control it with my android 7 phone. Since the last 2 days librespot crashes with the following error message every time when i turn off the screen of my phone during playback, or when I turn the phone so it switches from portrait to landscape mode.
Here is the error: (without the "fetch" messages)

INFO:librespot: librespot d40c0f5 (2018-05-16). Built on 2018-05-17. Build ID: P11vY1AI
DEBUG:librespot_connect::discovery: Zeroconf server listening on 0.0.0.0:0
DEBUG:librespot_connect::discovery: Post "/" {}
INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-b-n2b0.ap.spotify.com:4070"
INFO:librespot_core::session: Authenticated as "meise86" !
DEBUG:librespot_core::session: new Session[0]
DEBUG:librespot_connect::spirc: new Spirc[0]
DEBUG:librespot_core::mercury: new MercuryManager
DEBUG:librespot_playback::player: new Player[0]
INFO:librespot_playback::audio_backend::alsa: Using alsa sink
DEBUG:librespot_connect::spirc: input volume:32768 to mixer: 2072
DEBUG:librespot_core::session: Session[0] strong=3 weak=2
INFO:librespot_core::session: Country: "DE"
DEBUG:librespot_core::mercury: unknown subscription uri=hm://remote/3/user/meise86/495ba3b0635828fdd24453aa7e8546e6c6a8b165
DEBUG:librespot_core::mercury: subscribed uri=hm://remote/3/user/meise86/ count=0
DEBUG:librespot_connect::spirc: kMessageTypeLoad "Galaxy S6" 495ba3b0635828fdd24453aa7e8546e6c6a8b165 2 0
DEBUG:librespot_playback::player: command=Load(SpotifyId(u128!(38381817756316169679438963587405112931)), false, 16384)
INFO:librespot_playback::player: Loading track "Schmeiß alles rein" with Spotify URI "spotify:track:0SubtpXdMUeIjpGWdq31VF"
DEBUG:librespot_core::audio_key: new AudioKeyManager
DEBUG:librespot_audio::fetch: Downloading file c1140085f9d049636cd1707463db55030129e32e
DEBUG:librespot_core::channel: new ChannelManager
DEBUG:librespot_playback::player: Normalisation Data: NormalisationData { track_gain_db: -9.660004, track_peak: 1.1473889, album_gain_db: -8.650002, album_peak: 1.2710155 }
DEBUG:librespot_playback::player: Applied normalisation factor: 0.3288515
INFO:librespot_playback::player: Track "Schmeiß alles rein" loaded
DEBUG:librespot_connect::spirc: kMessageTypePlay "Galaxy S6" 495ba3b0635828fdd24453aa7e8546e6c6a8b165 3 0
DEBUG:librespot_playback::player: command=Play
TRACE:librespot_audio::fetch: chunk 26 / 27 complete
DEBUG:librespot_audio::fetch: File c1140085f9d049636cd1707463db55030129e32e complete
thread 'main' panicked at 'called Result::unwrap() on an Err value: WireError(InvalidEnumValue(14))', libcore/result.rs:945:5
stack backtrace:
0: 0x880a97 - std::sys::unix::backtrace::tracing:👿:unwind_backtrace::h199161caf4bb8a45
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: 0x8891f7 - std::sys_common::backtrace::print::ha743a2ce883acb7f
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
2: 0x870217 - std::panicking::default_hook::{{closure}}::hbba61518001dc5c7
at libstd/panicking.rs:211
3: 0x86febf - std::panicking::default_hook::h843acd3de0f33da9
at libstd/panicking.rs:227
4: 0x8708db - std::panicking::rust_panic_with_hook::h17c136d6be3ce5e4
at libstd/panicking.rs:463
5: 0x870467 - std::panicking::begin_panic_fmt::h7dac8c4f4073d4bf
at libstd/panicking.rs:350
6: 0x87042f - rust_begin_unwind
at libstd/panicking.rs:328
7: 0x8bdfff - core::panicking::panic_fmt::h291dfef94d3ea1d8
at libcore/panicking.rs:71
8: 0x474333 - core::result::unwrap_failed::hea18e00b20c8f9d4
9: 0x470f4b - core::ops::function::impls::<impl core::ops::function::FnOnce for &'a mut F>::call_once::hec08ca3de9c9c54a
10: 0x491eff - <futures::stream::map::Map<S, F> as futures::stream::Stream>::poll::h6834f5ebe2c11dcf
11: 0x475c73 - <librespot_connect::spirc::SpircTask as futures::future::Future>::poll::hb1546b95926838d4
12: 0x439053 - <librespot::Main as futures::future::Future>::poll::h375c9496645c90f1
13: 0x442a1b - futures::task_impl::std::set::h3408cdf1bfba0f29
14: 0x455d6f - <futures::future::lazy::Lazy<F, R> as futures::future::Future>::poll::hd5c752d811bb876f
15: 0x442b97 - futures::task_impl::std::set::h94b5c45bc614062b
16: 0x4448cb - <std:🧵:local::LocalKey>::with::h80695c7c2df7cfba
17: 0x4467d3 - <tokio::executor::current_thread::Entered<'a, P>>::block_on::hd30b684a30266784
18: 0x444bf3 - <std:🧵:local::LocalKey>::with::hc5de68409eb5b113
19: 0x4449eb - <std:🧵:local::LocalKey>::with::hc412a9fc75f9bb78
20: 0x444763 - <std:🧵:local::LocalKey>::with::h7e68ab9f261c3131
21: 0x44588f - <scoped_tls::ScopedKey>::set::hc0046d94a7f84667
22: 0x43bf27 - tokio_core::reactor::Core::run::h18545fa0167fa52a
23: 0x43afe7 - librespot::main::h9c56636c97bd0ca4
24: 0x45485f - std::rt::lang_start::{{closure}}::hfda5a692ce3d081c
25: 0x87036f - std::panicking::try::do_call::h705bcdac05b967f9
at libstd/rt.rs:59
at libstd/panicking.rs:310
26: 0x88eaeb - __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:105
27: 0x870b4b - std::rt::lang_start_internal::h8893dac715d391ba
at libstd/panicking.rs:289
at libstd/panic.rs:374
at libstd/rt.rs:58
28: 0x43bc73 - main
29: 0x76c2a677 - __libc_start_main
DEBUG:librespot_connect::spirc: drop Spirc[0]
DEBUG:librespot_playback::player: Shutting down player thread ...
DEBUG:librespot_playback::player: drop Player[0]
DEBUG:librespot_core::session: drop Session[0]
DEBUG:librespot_core::audio_key: drop AudioKeyManager
DEBUG:librespot_core::channel: drop ChannelManager
DEBUG:librespot_core::mercury: drop MercuryManager
DEBUG:librespot_core::session: drop Dispatch

I can reproduce this error with two different phones (both android 7). If someone need more information, I'm happy to provide it.

Originally created by @meiseGit on GitHub (May 18, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/225 Hi, I'm running librespot on my raspberry pi 3 and control it with my android 7 phone. Since the last 2 days librespot crashes with the following error message every time when i turn off the screen of my phone during playback, or when I turn the phone so it switches from portrait to landscape mode. Here is the error: (without the "fetch" messages) INFO:librespot: librespot d40c0f5 (2018-05-16). Built on 2018-05-17. Build ID: P11vY1AI DEBUG:librespot_connect::discovery: Zeroconf server listening on 0.0.0.0:0 DEBUG:librespot_connect::discovery: Post "/" {} INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-b-n2b0.ap.spotify.com:4070" INFO:librespot_core::session: Authenticated as "meise86" ! DEBUG:librespot_core::session: new Session[0] DEBUG:librespot_connect::spirc: new Spirc[0] DEBUG:librespot_core::mercury: new MercuryManager DEBUG:librespot_playback::player: new Player[0] INFO:librespot_playback::audio_backend::alsa: Using alsa sink DEBUG:librespot_connect::spirc: input volume:32768 to mixer: 2072 DEBUG:librespot_core::session: Session[0] strong=3 weak=2 INFO:librespot_core::session: Country: "DE" DEBUG:librespot_core::mercury: unknown subscription uri=hm://remote/3/user/meise86/495ba3b0635828fdd24453aa7e8546e6c6a8b165 DEBUG:librespot_core::mercury: subscribed uri=hm://remote/3/user/meise86/ count=0 DEBUG:librespot_connect::spirc: kMessageTypeLoad "Galaxy S6" 495ba3b0635828fdd24453aa7e8546e6c6a8b165 2 0 DEBUG:librespot_playback::player: command=Load(SpotifyId(u128!(38381817756316169679438963587405112931)), false, 16384) INFO:librespot_playback::player: Loading track "Schmeiß alles rein" with Spotify URI "spotify:track:0SubtpXdMUeIjpGWdq31VF" DEBUG:librespot_core::audio_key: new AudioKeyManager DEBUG:librespot_audio::fetch: Downloading file c1140085f9d049636cd1707463db55030129e32e DEBUG:librespot_core::channel: new ChannelManager DEBUG:librespot_playback::player: Normalisation Data: NormalisationData { track_gain_db: -9.660004, track_peak: 1.1473889, album_gain_db: -8.650002, album_peak: 1.2710155 } DEBUG:librespot_playback::player: Applied normalisation factor: 0.3288515 INFO:librespot_playback::player: Track "Schmeiß alles rein" loaded DEBUG:librespot_connect::spirc: kMessageTypePlay "Galaxy S6" 495ba3b0635828fdd24453aa7e8546e6c6a8b165 3 0 DEBUG:librespot_playback::player: command=Play TRACE:librespot_audio::fetch: chunk 26 / 27 complete DEBUG:librespot_audio::fetch: File c1140085f9d049636cd1707463db55030129e32e complete thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: WireError(InvalidEnumValue(14))', libcore/result.rs:945:5 stack backtrace: 0: 0x880a97 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h199161caf4bb8a45 at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49 1: 0x8891f7 - std::sys_common::backtrace::print::ha743a2ce883acb7f at libstd/sys_common/backtrace.rs:71 at libstd/sys_common/backtrace.rs:59 2: 0x870217 - std::panicking::default_hook::{{closure}}::hbba61518001dc5c7 at libstd/panicking.rs:211 3: 0x86febf - std::panicking::default_hook::h843acd3de0f33da9 at libstd/panicking.rs:227 4: 0x8708db - std::panicking::rust_panic_with_hook::h17c136d6be3ce5e4 at libstd/panicking.rs:463 5: 0x870467 - std::panicking::begin_panic_fmt::h7dac8c4f4073d4bf at libstd/panicking.rs:350 6: 0x87042f - rust_begin_unwind at libstd/panicking.rs:328 7: 0x8bdfff - core::panicking::panic_fmt::h291dfef94d3ea1d8 at libcore/panicking.rs:71 8: 0x474333 - core::result::unwrap_failed::hea18e00b20c8f9d4 9: 0x470f4b - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &'a mut F>::call_once::hec08ca3de9c9c54a 10: 0x491eff - <futures::stream::map::Map<S, F> as futures::stream::Stream>::poll::h6834f5ebe2c11dcf 11: 0x475c73 - <librespot_connect::spirc::SpircTask as futures::future::Future>::poll::hb1546b95926838d4 12: 0x439053 - <librespot::Main as futures::future::Future>::poll::h375c9496645c90f1 13: 0x442a1b - futures::task_impl::std::set::h3408cdf1bfba0f29 14: 0x455d6f - <futures::future::lazy::Lazy<F, R> as futures::future::Future>::poll::hd5c752d811bb876f 15: 0x442b97 - futures::task_impl::std::set::h94b5c45bc614062b 16: 0x4448cb - <std::thread::local::LocalKey<T>>::with::h80695c7c2df7cfba 17: 0x4467d3 - <tokio::executor::current_thread::Entered<'a, P>>::block_on::hd30b684a30266784 18: 0x444bf3 - <std::thread::local::LocalKey<T>>::with::hc5de68409eb5b113 19: 0x4449eb - <std::thread::local::LocalKey<T>>::with::hc412a9fc75f9bb78 20: 0x444763 - <std::thread::local::LocalKey<T>>::with::h7e68ab9f261c3131 21: 0x44588f - <scoped_tls::ScopedKey<T>>::set::hc0046d94a7f84667 22: 0x43bf27 - tokio_core::reactor::Core::run::h18545fa0167fa52a 23: 0x43afe7 - librespot::main::h9c56636c97bd0ca4 24: 0x45485f - std::rt::lang_start::{{closure}}::hfda5a692ce3d081c 25: 0x87036f - std::panicking::try::do_call::h705bcdac05b967f9 at libstd/rt.rs:59 at libstd/panicking.rs:310 26: 0x88eaeb - __rust_maybe_catch_panic at libpanic_unwind/lib.rs:105 27: 0x870b4b - std::rt::lang_start_internal::h8893dac715d391ba at libstd/panicking.rs:289 at libstd/panic.rs:374 at libstd/rt.rs:58 28: 0x43bc73 - main 29: 0x76c2a677 - __libc_start_main DEBUG:librespot_connect::spirc: drop Spirc[0] DEBUG:librespot_playback::player: Shutting down player thread ... DEBUG:librespot_playback::player: drop Player[0] DEBUG:librespot_core::session: drop Session[0] DEBUG:librespot_core::audio_key: drop AudioKeyManager DEBUG:librespot_core::channel: drop ChannelManager DEBUG:librespot_core::mercury: drop MercuryManager DEBUG:librespot_core::session: drop Dispatch I can reproduce this error with two different phones (both android 7). If someone need more information, I'm happy to provide it.
kerem closed this issue 2026-02-27 19:29:06 +03:00
Author
Owner

@CombinedEffort commented on GitHub (May 18, 2018):

I'm just going to hop on this issue as my snapserver has just started falling over as of yesterday. I notice both myself and @meiseGit maybe suffering from :

InvalidEnumValue(14))

My snapserver startup looks like this :

$ snapserver -s "pipe:///tmp/snapfifo?name=default" -s "spotify:///librespot?name=Spotify&devicename=Oval"
pipe:///tmp/snapfifo?name=default
spotify:///librespot?name=Spotify&devicename=Oval
2018-05-18 06-53-03 [Notice] Settings file: "/var/lib/snapserver/server.json"
2018-05-18 06-53-03 [Err] Failed to create client: Daemon not running
2018-05-18 06-53-03 [Info] PcmStream sampleFormat: 48000:16:2
2018-05-18 06-53-03 [Info] metadata={
2018-05-18 06-53-03 [Info]     "STREAM": "default"
2018-05-18 06-53-03 [Info] }
2018-05-18 06-53-03 [Info] onMetaChanged (default)
2018-05-18 06-53-03 [Info] PipeStream mode: create
2018-05-18 06-53-03 [Info] Stream: {"fragment":"","host":"","path":"/tmp/snapfifo","query":{"buffer_ms":"20","codec":"flac","name":"default","sampleformat":"48000:16:2"},"raw":"pipe:////tmp/snapfifo?buffer_ms=20&codec=flac&name=default&sampleformat=48000:16:2","scheme":"pipe"}
2018-05-18 06-53-03 [Info] PcmStream sampleFormat: 48000:16:2
2018-05-18 06-53-03 [Info] metadata={
2018-05-18 06-53-03 [Info]     "STREAM": "Spotify"
2018-05-18 06-53-03 [Info] }
2018-05-18 06-53-03 [Info] onMetaChanged (Spotify)
2018-05-18 06-53-03 [Info] Stream: {"fragment":"","host":"","path":"/librespot","query":{"buffer_ms":"20","codec":"flac","devicename":"Oval","name":"Spotify","sampleformat":"44100:16:2"},"raw":"spotify:////librespot?buffer_ms=20&codec=flac&devicename=Oval&name=Spotify&sampleformat=44100:16:2","scheme":"spotify"}
2018-05-18 06-53-03 [Err] (PipeStream) Exception: end of file
2018-05-18 06-53-03 [Info] onStateChanged (Spotify): 2
2018-05-18 06-53-03 [Info] (Spotify) INFO:librespot: librespot 21f1ccf (2018-05-15). Built on 2018-05-16. Build ID: pTpEbpRj
2018-05-18 06-53-05 [Info] onStateChanged (Spotify): 1
2018-05-18 06-53-31 [Info] (Spotify) INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-b-kgs7.ap.spotify.com:4070"
2018-05-18 06-53-31 [Info] (Spotify) INFO:librespot_core::session: Authenticated as "combinedeffort" !
2018-05-18 06-53-31 [Info] (Spotify) INFO:librespot_core::session: Country: "GB"
2018-05-18 06-53-31 [Info] (Spotify) thread 'main' panicked at '
2018-05-18 06-53-31 [Info] (Spotify) called `Result::unwrap()` on an `Err` value: WireError(InvalidEnumValue(14))', libcore/result.rs:945:5
2018-05-18 06-53-31 [Info] (Spotify) stack backtrace:
2018-05-18 06-53-31 [Info] (Spotify) 559d7b9dc2cb -
2018-05-18 06-53-31 [Info] (Spotify) std::sys::unix::backtrace
2018-05-18 06-53-31 [Info] (Spotify) ::tracing::imp::unwind_backtrace::hfcd41b6fc9324cf3
2018-05-18 06-53-31 [Info] (Spotify) at libstd/sys/unix/backtrace/tracing/gcc_s.rs
2018-05-18 06-53-31 [Info] (Spotify) 0x559d7b9e2ec0
2018-05-18 06-53-31 [Info] (Spotify) - std::sys_common::backtrace::print::hb4eb3d23c202b80f
2018-05-18 06-53-31 [Info] (Spotify) libstd/sys_common/backtrace.rs:
2018-05-18 06-53-31 [Info] (Spotify) at libstd/sys_common/backtrace.rs
2018-05-18 06-53-31 [Info] (Spotify) :59
<!-- gh-comment-id:390114263 --> @CombinedEffort commented on GitHub (May 18, 2018): I'm just going to hop on this issue as my snapserver has just started falling over as of yesterday. I notice both myself and @meiseGit maybe suffering from : InvalidEnumValue(14)) My snapserver startup looks like this : ``` $ snapserver -s "pipe:///tmp/snapfifo?name=default" -s "spotify:///librespot?name=Spotify&devicename=Oval" pipe:///tmp/snapfifo?name=default spotify:///librespot?name=Spotify&devicename=Oval 2018-05-18 06-53-03 [Notice] Settings file: "/var/lib/snapserver/server.json" 2018-05-18 06-53-03 [Err] Failed to create client: Daemon not running 2018-05-18 06-53-03 [Info] PcmStream sampleFormat: 48000:16:2 2018-05-18 06-53-03 [Info] metadata={ 2018-05-18 06-53-03 [Info] "STREAM": "default" 2018-05-18 06-53-03 [Info] } 2018-05-18 06-53-03 [Info] onMetaChanged (default) 2018-05-18 06-53-03 [Info] PipeStream mode: create 2018-05-18 06-53-03 [Info] Stream: {"fragment":"","host":"","path":"/tmp/snapfifo","query":{"buffer_ms":"20","codec":"flac","name":"default","sampleformat":"48000:16:2"},"raw":"pipe:////tmp/snapfifo?buffer_ms=20&codec=flac&name=default&sampleformat=48000:16:2","scheme":"pipe"} 2018-05-18 06-53-03 [Info] PcmStream sampleFormat: 48000:16:2 2018-05-18 06-53-03 [Info] metadata={ 2018-05-18 06-53-03 [Info] "STREAM": "Spotify" 2018-05-18 06-53-03 [Info] } 2018-05-18 06-53-03 [Info] onMetaChanged (Spotify) 2018-05-18 06-53-03 [Info] Stream: {"fragment":"","host":"","path":"/librespot","query":{"buffer_ms":"20","codec":"flac","devicename":"Oval","name":"Spotify","sampleformat":"44100:16:2"},"raw":"spotify:////librespot?buffer_ms=20&codec=flac&devicename=Oval&name=Spotify&sampleformat=44100:16:2","scheme":"spotify"} 2018-05-18 06-53-03 [Err] (PipeStream) Exception: end of file 2018-05-18 06-53-03 [Info] onStateChanged (Spotify): 2 2018-05-18 06-53-03 [Info] (Spotify) INFO:librespot: librespot 21f1ccf (2018-05-15). Built on 2018-05-16. Build ID: pTpEbpRj 2018-05-18 06-53-05 [Info] onStateChanged (Spotify): 1 2018-05-18 06-53-31 [Info] (Spotify) INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-b-kgs7.ap.spotify.com:4070" 2018-05-18 06-53-31 [Info] (Spotify) INFO:librespot_core::session: Authenticated as "combinedeffort" ! 2018-05-18 06-53-31 [Info] (Spotify) INFO:librespot_core::session: Country: "GB" 2018-05-18 06-53-31 [Info] (Spotify) thread 'main' panicked at ' 2018-05-18 06-53-31 [Info] (Spotify) called `Result::unwrap()` on an `Err` value: WireError(InvalidEnumValue(14))', libcore/result.rs:945:5 2018-05-18 06-53-31 [Info] (Spotify) stack backtrace: 2018-05-18 06-53-31 [Info] (Spotify) 559d7b9dc2cb - 2018-05-18 06-53-31 [Info] (Spotify) std::sys::unix::backtrace 2018-05-18 06-53-31 [Info] (Spotify) ::tracing::imp::unwind_backtrace::hfcd41b6fc9324cf3 2018-05-18 06-53-31 [Info] (Spotify) at libstd/sys/unix/backtrace/tracing/gcc_s.rs 2018-05-18 06-53-31 [Info] (Spotify) 0x559d7b9e2ec0 2018-05-18 06-53-31 [Info] (Spotify) - std::sys_common::backtrace::print::hb4eb3d23c202b80f 2018-05-18 06-53-31 [Info] (Spotify) libstd/sys_common/backtrace.rs: 2018-05-18 06-53-31 [Info] (Spotify) at libstd/sys_common/backtrace.rs 2018-05-18 06-53-31 [Info] (Spotify) :59 ```
Author
Owner

@michaelherger commented on GitHub (May 18, 2018):

You need to update your librespot to the latest code. See https://github.com/librespot-org/librespot/issues/223

<!-- gh-comment-id:390115075 --> @michaelherger commented on GitHub (May 18, 2018): You need to update your librespot to the latest code. See https://github.com/librespot-org/librespot/issues/223
Author
Owner

@CombinedEffort commented on GitHub (May 18, 2018):

Thanks @michaelherger, I just noticed spirc.proto was updated 8 hours ago so have started a build :)

<!-- gh-comment-id:390121035 --> @CombinedEffort commented on GitHub (May 18, 2018): Thanks @michaelherger, I just noticed spirc.proto was updated 8 hours ago so have started a build :)
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#149
No description provided.