Help Wanted - C coder for Spotify Connect - Let's make it!

Dear Folks,
things are running fast for Volumio2, and in the meanwhile I’ve had a great discussion with SashaHilton about Spotify Connect.
It turned out to be quite tricky, and not worth the effort, to build a node plugin…
Instead, the ideal solution would be to build a c daemon, and then a node wrapper around it …
To quote sasha’s own words:

Then, about discussing on finding a C coder willing to help us with librespot

So, here’s our quest to find a willing C dev to jump in into this adventure and make a Spotify Connect Wrapper for Volumio reality…

There’s an old thread with some useful informations about the current (and unconfortable, Volumio-wise) python implementation:
spotify-connect-t2811.html

All the development chat about spotify connect is going on here, to get in touch with sasha and the other devs involved…
gitter.im/sashahilton00/spotify … share-link

Let us know guys! Let’s make this happen!

Hi,

Are you imagining this would be a separate C/Rust project that uses librespot as a dependency and provides an API for volumio to access?

If so, I think what you really need might be a rust developer as librespot is written in Rust (very cool and good). It will probably be easier to create a robust daemon with proper dependency management if Rust is chosen as the development language.

I am looking into helping with this tentatively. As you know before Christmas I had terrible troubles getting a dev environment working for the whole of volumio. However, this looks like a more constrained and easier to work on project - it should be possible to get the daemon working standalone before building it for a raspberry pi.

What do others think?

Hi @piercer,

Sorry for taking a while to get back. Ultimately I think the plan for librespot is that it becomes a drop in replacement for libspotify, but with the extra features such as Spotify Connect added in. Given this, the best case scenario would be for us to essentially create a header file (C wrapper) for the rust binary. The header file will probably be based off the original libspotify header https://github.com/mopidy/pyspotify/blob/v2.x/develop/spotify/api.h found here for minimal pain when transitioning existing projects, but will obviously incorporate the new calls for the Spotify Connect features.

As a result of the Connect feature being added, the library will have to run as a service in order to monitor for remote connections and commands continually. The question at the minute is whether we distribute librespot in it’s current form (as a binary), or whether it gets converted into a library, at which point a daemon would be required as you mentioned. I personally am inclined to agree with you that a daemon & library is probably a better solution, but as it currently stands it is a binary, it could be modified to work with Volumio as a standalone binary, which may be easier, seeing as there is already a Rust C bindings generator.

P.S. Setting up the dev environment for librespot is much easier than Volumio.

I have been looking into this.

Rust is VERY good at being used to make node modules

I am going to try making a prototyope node<->spotify module using librespot this week.

The constituents will be

github.com/plietar/librespot

info from

youtube.com/watch?v=okaNt-dGfUg
github.com/steveklabnik/forward2015

May use this library

github.com/rustbridge/neon

If anybody wants to help please let mew know

Hi!
I can’t help you but I support this 100% ! I can do some test when needed !

OK, good news.

Today I got a node module building that uses librespot as a library, communicates with it using Neon and I was able to start a Spotify connect session directly from inside Node.

I have called the module noodly-fi. I did this

var noodle = require(’…/native’);

noodle.connect(,));

I am not quite ready to share the code yet, and I have not tried building for ARM - but I can’t see why it won’t work (unless Neon doesn’t like ARM…)

I’ll keep you posted.

Yes !
Will it requires a dev key as for spotify-connect ?

Yes - I have an app key. Anybody can login using it from the app. But I’m not sure what that means for Volumio.

Hi,
librespot author here.
I am quite interested in making it as easy as possible to integrate it into Volumio.

As far as I understand from a quick look at the existing Spotify plugin, it works by starting an external daemon, and communicates with it over a TCP socket.
This would probably be the easiest way of integrating librespot as well.
Neon is very nice, but unfortunately doesn’t support Async yet, and a lot / most of librespot’s API is asynchronous.

I can work on a Rust daemon which depends on librespot, and exposes some interface that you can use from Volumio.
Unfortunately I wouldn’t really have enough time to work on both sides of it.

Do you have an IRC channel we can discuss this on ? Otherwise there’s a Gitter chat for spotify connect related discussion at gitter.im/sashahilton00/spotify … -resources.

Paul

Hi Plietar,

thanks - I got stuck on making a static reference to the librespot client connection and had given up for a bit.

The daemon sounds like a good idea. I can help you and could give some time to making this work.