mopidy / mopidy-spotify

Mopidy extension for playing music from Spotify
https://mopidy.com/ext/spotify/
Apache License 2.0
933 stars 108 forks source link

Can Spotify Connect be supported? #14

Open alesch opened 10 years ago

alesch commented 10 years ago

My guess is that Spotify has not added this feature to the library you are using. I do not know whether its protocol has been reversed already. Any thoughts on this?

kingosticks commented 10 years ago

Correct, it's not exposed in libspotify (the official library). But doesn't the mpd architecture already give you this functionality? Or am I missing something? On 18 Mar 2014 00:13, "Alex Schenkman" notifications@github.com wrote:

My guess is that Spotify has not added this feature to the library you are using. I do not know whether its protocol has been reversed already. Any thoughts on this?

Reply to this email directly or view it on GitHubhttps://github.com/mopidy/mopidy-spotify/issues/14 .

kingosticks commented 10 years ago

So I looked at this a bit more since I'd forgotten about Spotify Connect, was curious, and thought I'd share...

Spotify Connect is a whole bunch of stuff which essentially just separates the playback and control of spotify music. It enables "smart" playback devices (certain wireless speakers and amps) to stream directly from the internet rather than being fed audio from a (usually docked/wired) local source e.g. mobile device or computer. This makes it easy for Joe Bloggs to avoid using his cruddy phone/tablet speakers, draining his battery and interrupting his music with phone notifications. So there are a few parts to it:

I'm assuming they are doing the control through UPnP/DLNA with the speakers/amp as a renderer and the spotify client as a controller. Looking at the two currently supported wireless audio chipsets (Venice 6.5 & JukeBlox 3), the only fancy stuff is the "direct to device" streaming capability.

All in all, it doesn't sound too dissimilar to what you can do with an MPD setup now - providing you can get the audio to the playback device. It also doesn't sound a world away from what you could do with some extra UPnP magic.

Saying all that ... what exactly do you mean when you say Spotify Connect support? Do you mean:

ajcrowe commented 10 years ago

From my perspective I would much prefer to use the native Spotify interface and send tracks/playlists/albums to my Mopidy server to play then use any of the MPD clients / Web interfaces available.

So I would vote for point 3 being where I would like to see it implemented.

u1735067 commented 10 years ago

I'd love to have this too :) Use Spotify from my smartphone to control my Pi+speakers (through Pi MusicBox & Mopidy) as if it was an expensive smart speaker.

jodal commented 10 years ago

I recently asked a couple of Spotify engineers about Spotify Connect, with especial focus on part three: Controlling mopidy through a spotify client as if it were just another "smart" speaker/amp.

This is what I learned:

Personally, I'm very interested in creating a Mopidy frontend for Spotify Connect when the SDK arrives.

kingosticks commented 10 years ago

I can totally confirm the last point. I spent a good while with wireshark and got nowhere other than the broadcast done to advertise the service. Good news they plan to release it. On 10 May 2014 18:25, "Stein Magnus Jodal" notifications@github.com wrote:

I recently asked a couple of Spotify engineers about Spotify Connect, with especial focus on part three: Controlling mopidy through a spotify client as if it were just another "smart" speaker/amp.

This is what I learned:

  • The playing device (e.g. Mopidy) streams music directly from Spotify's servers. The controlling device (Spotify app on your phone) may be removed and the music will continue playing.
  • Spotify Connect is entirely custom. It has nothing to do with UPnP/DLNA, Qualcomm Allplay, Chromecast's DIAL, or similar.
  • Control is done through Spotify's servers, not directly over your local network.
  • There no special hardware required.
  • Eventually there will be a public SDK for Connect functionality. Currently this SDK is only being distributed to Spotify Partners.
  • Reverse engineering the protocol is supposedly quite hard, so we're recommended to sit tight waiting for the SDK.

Personally, I'm very interested in creating a Mopidy frontend for Spotify Connect when the SDK arrives.

— Reply to this email directly or view it on GitHubhttps://github.com/mopidy/mopidy-spotify/issues/14#issuecomment-42748374 .

vizzah commented 10 years ago

If you'd like to know more about Spotify Connect, check this out: http://divideoverflow.com/2014/08/reversing-spotify-connect/

LandonSchropp commented 9 years ago

:+1:

geekbleek commented 9 years ago

I would love to see this functionality in mopidy!!

ulilicht commented 9 years ago

When reading the comments here: https://developer.spotify.com/technologies/libspotify/ it seems that there won't be any integration of Spotify Connect into libspotify soon.

jodal commented 9 years ago

libspotify is barely maintained. I'm guessing that freely available Spotify Connect functionality will be available through a new library.

ulilicht commented 9 years ago

Was there any hint that Spotify Connect will be freely available or are you talking about the reverse engineered approach?

Stein Magnus Jodal notifications@github.com schrieb am Fri Nov 07 2014 at 13:58:25:

libspotify is barely maintained. I'm guessing that freely available Spotify Connect functionality will be available through a new library.

— Reply to this email directly or view it on GitHub https://github.com/mopidy/mopidy-spotify/issues/14#issuecomment-62138606 .

jodal commented 9 years ago

No, there wasn't. I haven't been in contact with Spotify about this since my comment on May 10.

sashahilton00 commented 9 years ago

@jodal has spotify provided any update to you on when it will be released, or are we still being left in the dark?

jodal commented 9 years ago

I have no news so far.

woutervanwijk commented 9 years ago

More info here. No library though... http://divideoverflow.com/2014/08/reversing-spotify-connect/

calgot commented 9 years ago

Just adding a +1 for alternative 3 above, just bought a Pi with MusicBox to get simple streaming to my stereo without realising I needed Spotify Connect for it to work like I'd like... I hope Spotify will release something soon.

fyksen commented 9 years ago

Would love to see this implemented. Makes it easy to make a spotify speaker with a raspberry pi.

dennisfisch commented 9 years ago

+1 from me as well, this would be absolutely awesome.

sashahilton00 commented 9 years ago

Hi guys,

we are currently in the process of assembling any developers who are interested in making Spotify Connect an open protocol that can be integrated with any projects of your choosing. Anyone who is willing to help is welcome, especially those who know a thing or two about reverse engineering ;)

If you are interested, have a look at the central repo that holds resources related to this project: https://github.com/sashahilton00/spotify-connect-resources and come and introduce yourself over on the chatroom, we wont bite ;) https://gitter.im/sashahilton00/spotify-connect-resources

See you soon, I hope :)

sashahilton00 commented 9 years ago

I figured an update was probably in order... we have managed to reverse the authentication, encryption and transport protocols for Connect, and have a rudimentary client working as a PoC. A library is now under development, so hopefully this will be a reality soon... The library in progress can be found here: https://github.com/plietar/spotify-connect/tree/librespot

psych0d0g commented 9 years ago

im VERY interested in point 3 myself! my current approach to get spotify music on mopidy from my mobile phones i quite ugly:

root device Use bubbleupnp Licensed version Install xposed framework enable bubbleupnp xposed module start playback from spotify on android phone

Here the audio gets captured by the xposed bubbleupnp module and streamed to musicbox via upnp which introduces alot of audio latency and way more load on my android device (thus reducing battery life) than when using native spotify connect

robo-corg commented 9 years ago

Not sure how to solve this but just installing modipy with this extension bundled I was pretty confused when connect did not work (it didn't even occur to me it was just a client).

Only after ssh in seeing there were no errors and finding this bug did I figure out it was not supported. I wonder if there is a way to make it clearer connect is not supported in the UI?

bourgeois commented 9 years ago

+1 ! This would be awesome.

marcokeur commented 9 years ago

Definitely +1

pablospe commented 9 years ago

+1

artworklv commented 9 years ago

+1

jodal commented 9 years ago

+1-ing this issue won't make this any more or less likely to happen. Please stop.

kingosticks commented 14 hours ago

If someone can figure out how this would work, I am open to integrating it.