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
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.
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.
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…)
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.