[GH-ISSUE #461] Strange behaviour in iOS app when using librespot Spotify Connect #294

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

Originally created by @lealoureiro on GitHub (Apr 14, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/461

Hello,

First of all thanks for great work!

I notice something a bit strange when using librespot as Spotify Connect device, together with Snapcast.

When I push next song, the now playing window disappears/slides down.
The same doest happen with other devices like my laptop or my Denon Amplifier.

Is not a big deal but is annoying feels like something is different.

Please check the video to see better the problem.

Screenplay of Issue

Regards,
Leandro

Originally created by @lealoureiro on GitHub (Apr 14, 2020). Original GitHub issue: https://github.com/librespot-org/librespot/issues/461 Hello, First of all thanks for great work! I notice something a bit strange when using librespot as Spotify Connect device, together with Snapcast. When I push next song, the now playing window disappears/slides down. The same doest happen with other devices like my laptop or my Denon Amplifier. Is not a big deal but is annoying feels like something is different. Please check the video to see better the problem. [Screenplay of Issue](https://www.dropbox.com/s/jvk3ucujcaro3yr/RPReplay_Final1586862897.mp4?dl=0) Regards, Leandro
kerem 2026-02-27 19:29:51 +03:00
Author
Owner

@koloodziej commented on GitHub (May 3, 2020):

Same problem on Android.

<!-- gh-comment-id:623109915 --> @koloodziej commented on GitHub (May 3, 2020): Same problem on Android.
Author
Owner

@ashthespy commented on GitHub (May 26, 2020):

Just bisected and found that github.com/librespot-org/librespot@3f111a9778 introduces this..

Disabling the notification for PlayerEvent::Loading fixes this for me on Android..

diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs
index 77785e3..bb8888b 100644
--- a/connect/src/spirc.rs
+++ b/connect/src/spirc.rs
@@ -554,7 +554,7 @@ impl SpircTask {
             if Some(play_request_id) == self.play_request_id {
                 match event {
                     PlayerEvent::EndOfTrack { .. } => self.handle_end_of_track(),
-                    PlayerEvent::Loading { .. } => self.notify(None, false),
+                    PlayerEvent::Loading { .. } => (),
                     PlayerEvent::Playing { position_ms, .. } => {
                         let new_nominal_start_time = self.now_ms() - position_ms as i64;
                         match self.play_status {
@@ -1221,6 +1221,7 @@ impl SpircTask {
             PlayStatus::kPlayStatusStop => "kPlayStatusStop",
             PlayStatus::kPlayStatusPlay => "kPlayStatusPlay",
         };
+        assert_ne!(status_string, "kPlayStatusLoading");
         trace!("Sending status to server: [{}]", status_string);
         let mut cs = CommandSender::new(self, MessageType::kMessageTypeNotify);
         if let Some(s) = recipient {

@kaymes Any ideas?

<!-- gh-comment-id:634278281 --> @ashthespy commented on GitHub (May 26, 2020): Just bisected and found that https://github.com/librespot-org/librespot/commit/3f111a97785c1c1d5a77d833a98e5fb085a85399 introduces this.. Disabling the notification for `PlayerEvent::Loading` fixes this for me on Android.. ```diff diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 77785e3..bb8888b 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -554,7 +554,7 @@ impl SpircTask { if Some(play_request_id) == self.play_request_id { match event { PlayerEvent::EndOfTrack { .. } => self.handle_end_of_track(), - PlayerEvent::Loading { .. } => self.notify(None, false), + PlayerEvent::Loading { .. } => (), PlayerEvent::Playing { position_ms, .. } => { let new_nominal_start_time = self.now_ms() - position_ms as i64; match self.play_status { @@ -1221,6 +1221,7 @@ impl SpircTask { PlayStatus::kPlayStatusStop => "kPlayStatusStop", PlayStatus::kPlayStatusPlay => "kPlayStatusPlay", }; + assert_ne!(status_string, "kPlayStatusLoading"); trace!("Sending status to server: [{}]", status_string); let mut cs = CommandSender::new(self, MessageType::kMessageTypeNotify); if let Some(s) = recipient { ``` @kaymes Any ideas?
Author
Owner

@kaymes commented on GitHub (May 26, 2020):

It seems like Spotify changed the way the app behaves for kPlayStatusLoading. When I wrote this code, I tested it quite a bit with the desktop client (Linux) and the Android app. The behaviour for kPlayStatusLoading was that the desktop client would grey out the progress bar and the Android app just ignored it.
My understanding of kPlayStatusLoading was that it should be sent while loading a track but not yet playing it, so that's what I programmed.

With the new behaviour of the app, it seems like my interpretation of kPlayStatusLoading was wrong because the way the app behaves is indeed annoying and doesn't make sense when loading a track. Maybe it is intended to be sent during the start-up phase of a user-controlled client. I don't know.

In any case, librespot should probably refrain from using kPlayStatusLoading for now.

I created a branch with a simple fix. I'll open a PR in a moment.

<!-- gh-comment-id:634333755 --> @kaymes commented on GitHub (May 26, 2020): It seems like Spotify changed the way the app behaves for kPlayStatusLoading. When I wrote this code, I tested it quite a bit with the desktop client (Linux) and the Android app. The behaviour for kPlayStatusLoading was that the desktop client would grey out the progress bar and the Android app just ignored it. My understanding of kPlayStatusLoading was that it should be sent while loading a track but not yet playing it, so that's what I programmed. With the new behaviour of the app, it seems like my interpretation of kPlayStatusLoading was wrong because the way the app behaves is indeed annoying and doesn't make sense when loading a track. Maybe it is intended to be sent during the start-up phase of a user-controlled client. I don't know. In any case, librespot should probably refrain from using kPlayStatusLoading for now. I created a branch with a simple fix. I'll open a PR in a moment.
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#294
No description provided.