-
Notifications
You must be signed in to change notification settings - Fork 634
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
Spotify client show track as playing, when it is still loading on librespot #210
Comments
I think that the web api is useless in this matter, the PlayStatus is an internal state of the Player, so the web api should not allow you to modify it. As far as I could see in the code, changing the state to buffering is something trivial (PlayStatus :: kPlayStatusLoading), the problem is knowing when the stream is ready to be played. And that depends on the audio backend you choose. For example, if you use alsa, you could start adding that functionality in the rust-alsa library. Then, you would have to make the corresponding modifications in librespot, surely in the player and in some other files, I do not know really. |
Forget what I said about backends. In the Player when |
Thank you for the clarifications @elganzua124. I started the creation of the new states and I am starting to get an idea on how this will work. I have now gotten to the point, where I would like to send a status change from player to spirc, but don't know, how to do it correctly, as adding spirc to player would create a circular dependency. So if you or anybody else could outline the communication between player and spirc, that would be greatly appreciated. |
With regards to the loading state, spirc does have support for it librespot/protocol/proto/spirc.proto Line 107 in deb240c
|
The main issue is that in librespot the playback logic is split between "Player" and "Spirc". To fix this you'd have to add a message from the Player to Spirc to indicate when loading is complete. |
The problem is that I can't (or don't know how to) create a reference from player to spirc. Spirc already has a reference to player, creating a reference from player to spirc would introduce a circular reference, which afaik should be avoided/be impossible. |
There's been a lot of development since this, including prefetching and some loading states. Since this was over two years old, I'm closing this for now, but feel free to re-open if it's still an issue. |
Environment:
rpi3 with current raspbian and raspotify
Apr 21 21:17:11 raspberrypi librespot[518]: INFO:librespot: librespot (raspotify) cb61e22 (2018-03-23). Built on 2018-03-24. Build ID: uvwePBqN
(issue is reproducible with current librespot built from master on Ubuntu 17.10)Android spotify client
pretty slow internet (2-5MBit/s)
Expected behaviour:
Actual behaviour:
I presume this is a problem with my internet connection (network is usually stable, but painfully slow). It only appears on songs that are loaded from internet. Cached songs work as expected. (playing starts immediately)
I started looking into the code and the spotify web api.
Apparently there is currently no way to send state "buffering/loading" to the client.
Current situation causes confusion, because information on app screen (status playing, time running) is not consistent with real situation (status paused, but playing scheduled after loading)
Setting status to pause will cause everybody to think that the play command was not received.
Possible solutions:
I appreciate any feedback and if possible I would like to get help on fixing this issue in the code by myself. If this is a oneliner, that somebody fixes while reading this, I'm happy to test it.
The text was updated successfully, but these errors were encountered: