mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #497] Can't play songs from Android app #313
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#313
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Johannesd3 on GitHub (Jun 18, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/497
Playing a song with librespot from my Android Spotify app doesn't work. After playing a song in the app and switching to the librespot client, the Android app and the web client still show the song as playing, but librespot produces no sound. When I press pause (or do any other action like increasing volume) on my phone, the playback appears as stopped. In the Web Client everything works fine.
Here's the log of librespot. The command=stop in the second last line seems quite suspicious to me and might be the cause:
@malaakso commented on GitHub (Jun 22, 2020):
Same here, except by skipping to next track I get sound from both phone and librespot at the same time. Web client seems to work for me as well.
@pejobo commented on GitHub (Jun 28, 2020):
Same for me
Was working with Android App v8.5.40.195, not working with App version v8.5.42.812 (same behavior as described above).
Installed old version from here as temporary fix: https://spotify.de.uptodown.com/android/download/2168218
@Johannesd3 commented on GitHub (Jul 3, 2020):
I did a little further research and think I figured it out:
When selecting librespot in the Android App, the app sends a command to librespot to load the track. However, shortly after this command, the app sends some kind of status update (kMessageTypeNotify), claiming still to be active. But when Librespot receives this status update it immediately stops playing, believing the Android app is currently playing. This happens in spirc.rs, line 793.
I also found a possible fix/workaround. The device state contains the information of when it became active. One could compare them in line 793 to check which client became most recently active:
if self.device.get_is_active() && frame.get_device_state().get_is_active() && self.device.get_became_active_at() <= frame.get_device_state().get_became_active_at() {At least for me it works. But since I do not know much about Spotify and this project, someone else should also take a look.
@jaisor commented on GitHub (Jul 12, 2020):
Same here as well
@Mitschmaster commented on GitHub (Jul 17, 2020):
https://github.com/librespot-org/librespot/issues/497#issuecomment-653270238 fix solves the problem for me
@sashahilton00 commented on GitHub (Jul 22, 2020):
Feel free to create a PR for the fix
@sashahilton00 commented on GitHub (Jul 22, 2020):
Closed by #501
@ah- commented on GitHub (Aug 31, 2020):
Thanks everyone for fixing this, finally the Android app just works!