mopidy/mopidy-spotify

Can Spotify Connect be supported?

alesch opened this issue · 28 comments

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?

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//issues/14
.

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:

  • Internet streaming direct to the playback devices
  • "Cloud based" session for seamless playback between devices
  • Control of all these playback devices with the traditional spotify client

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:

  • Cloud-based sessions so you can seamlessly switch between playback through official spotify clients and through mopidy?
  • Having "Connect enabled" speakers and amps automatically discovered and usable as "MPD outputs" in mopidy?
  • Controlling mopidy through a spotify client as if it were just another "smart" speaker/amp.
  • Something else entirely?

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.

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.

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 is 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.

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//issues/14#issuecomment-42748374
.

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

I would love to see this functionality in mopidy!!

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.

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

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
#14 (comment)
.

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

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

I have no news so far.

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.

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

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

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 :)

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

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

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?

+1 ! This would be awesome.

Definitely +1

+1

jodal commented

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