Missing spotify-connect support
Ncspot doesn't seem to implement spotify-connect support meaning that it doesn't appear in other players (official app, website) as a device. Consequently, it is not possible to control remote device, that is playing music with my local ncspot.
It shouldn't be that hard to implement because spotifyd knows it and it is also based on the librespot
seconded! This is already implemented in librespot.
I've looked into this and unfortunately it's not that simple. The librespot interface for Spotify connect is a different than the one we use now for direct playback. It would probably require a rework of the entire Spotify player backend on our side..
I'm a little confused, does ncspot not use the most up to date verision of librespot?
Yes, it does. But unless I'm missing something, the interface isn't designed this way. librespot's Spotify Connect implementation is contained in an interface called Spirc: https://github.com/librespot-org/librespot/blob/master/connect/src/spirc.rs
Spirc consumes the session and player objects that we need to play songs. If we hand these objects to Spirc, we cannot control the player object anymore except for a limited set of playback control operations (play, pause, stop, etc. - see: https://github.com/librespot-org/librespot/blob/51a634dc33233ca85a92db3e723d19550b548593/connect/src/spirc.rs#L282).
If we wanted to control the queue of the Spirc player, we would have to reimplement our entire playlist system to make use of the web api to control the local Spotify Connect player. This would involve a major rewrite of all the parts involving player control, which is why this feature is a lot more complicated than it seems.
Closing this as it is out of scope and would require massive rewrites/architecture changes due to the way librespot's Spotify Connect (SPIRC) is designed.
Closing this as it is out of scope and would require massive rewrites/architecture changes due to the way librespot's Spotify Connect (SPIRC) is designed.
@hrkfdn Does that mean you don't want to add it at all? Or would you add it, if anyone would do the refacotring? So would replacing the current logic ("private/disconnected session") with the spirc ("connected session") be in favor of most people? Or would a mixed solution be the only way to implement it? I would rather advise against the mixed solution because of the maintance overhead.
@photovoltex Thanks for the follow up! No, I'm not opposed to the feature itself. I just didn't have to time/capacity to take care of it. Contributions are very welcome :) I also think using the Spirc session would be the way to go. That way ncspot could also be controlled by other Spotify Connect clients.
Good to hear! From the outside it does looks like you rejected the idea by closing/completing this issue with "to complicated".
Anyhow, I actually already did implement the spirc into a working state here https://github.com/photovoltex/ncspot/tree/feature/connect-wip. Some months passed since i last touched the topic, I remember that the current connect info's we get from the spirc aren't "good" enough to handle all events. Mostly related to devices. The dealer tho does provide the missing information's which I currently trying to integrate for librespot (https://github.com/librespot-org/librespot/pull/1356).
If the dealer is merged into librespot i might try to tackle the task again. Unless someone else is faster then me or wants to bring my old branch into a mergeable state that is^^
Oh no, good that you followed up to clarify.
And thanks for your work on extending Spirc. This was one of the reasons I shied away from it back then.
FYI @photovoltex not sure if this is still interesting to you, but thanks to the latest changes that you and others made to librespot I started working on this in #1692
Oh, great to hear! I had opened this issue for that topic https://github.com/librespot-org/librespot/issues/1448. But the problem is that I didn't know what to update Events would make sense or should be exposed so I put it aside until I would need it and develop around it.
So if you are interested in it just add some notes on the issue and what you would expect it to expose and I could try to make that work :D.