Librespot Entrypoint: Play Spotify in any (or all) of your Roon zones

Introduction

The Entrypoints Wiki describes a method on how to use the Audio Entrypoint to get a Spotify or Airplay stream into Roon. As this tinkering method requires the installation of additional applications and the setup of an alsa loopback device it is pretty restricted in its use.

Over the last few months I looked into ways to make a dedicated Entrypoint extension for Spotify and now I’m pleased to present the results of that effort to you all.

The extension is called Librespot Entrypoint and is the latest member in the Entrypoints family. It can be installed with the Extension Manager and it can run besides any of the other Entrypoint extensions.

How it works

The extension identifies itself as a Spotify Connect device and converts any music it receives into a web radio stream that can be picked up by Roon. In its basic form you connect to the device, start playback in the Spotify app and play the web radio stream in Roon.

But there is more, by setting up Auto Control you give the Spotify app control over a zone, or a zone group. Now the Spotify app is a guest remote for this zone, taking care of playback and volume control.

This brings the following:

  • The Spotify user uses an app that is known and a personal library that is known
  • When Play is pressed the Roon zone automatically tunes in on the Live Radio station that has been setup
  • The upper limit of the volume control in the Spotify app is the Roon comfort limit, so you set the limits
  • When there is a party then zones can be grouped and the guests can pick what is playing, without the need to hand out you Roon Remote
  • The Roon zone still takes care of any DSP settings that are applied, e.g. room correction
  • One extension running in the network can turn any Roon zone into a Spotify Connect zone

One thing to note: the web radio approach gives a playback delay of about 5 seconds (doesn’t apply to volume control), inform the Spotify user about this.




If you are new to Entrypoints then please start off by reading the Entrypoints Wiki. The Wiki has been updated with install and setup instructions for the Librespot Entrypoint.

Let me know about your use case for this extension, I’m sure further fine tuning can be done.

BTW For those who are wondering about why it is called Librespot Entrypoint and not Spotify Entrypoint, there are a few practical reasons.

  • Spotify doesn’t allow a 3th party app to have a name that starts with “Spot” (stated in Developer Policy). Although I’m not directly using their API, I took the safe route and named it after the app that takes care of the main functionality: Librespot
  • Librespot is a nice piece of software that I now give credit via the extension name
  • RoPieee users might already recognize the name as @spockfish also uses the name in the RoPieee XL product

BTW2 For this extension to exist I had to start a Spotify trial, there are still 2 weeks remaining of the one month trial and I have to decide later if I keep my subscription.

8 Likes

Version 0.2.0 is now available!

This release has two changes:

  • Implement volume control for zones that get online after extension startup
  • Update to the latest Liquidsoap release (v2.0.3)
3 Likes

I wonder do many Roon users know what an easy way (relatively) this is to get Spotify to play through Roon.

I have a set of HAF filters from Thierry that I want to use so although my Aries has a Spotify connect I now have my DSP in the mix through Roon.










.sjb

2 Likes

@Jan_Koudijs Whats the chances of getting metadata into now playing ike we get from Internet radio when its availble?

Also I take it if you want have this to have controlof multiple zones independantly you would need to run seprate instances of the extension? This isnt possible on the same hardwre though is it? Just asking as Spotty on LMS does this to allow streaming to individual endpoints each endpoint runs its own instance of librespot.

Regardless this is a great extension simple and effecttive.

Been using this for last 3 hours, it’s really good Jan.

@Jan_Koudijs really excited about the Spotify endpoint. I am trying to set in up and failing though. My problem is I cannot create a radio station as it says could not find a radio station at this URL and I cannot configure the libresoft endpoint without a radio station. I tried to pick another radio station and just change things around but that still did not detect a signal. Any ideas how to get started? Additionally, now that I have picked a radio station the cache is set and so I cannot unpick to get back to the "set up a radio station and pick it here text. I uninstalled and reinstalled and it keeps the last configuration. Not sure this is the best idea if it was not intentional.

You need to be playing to the librespot instance via connect before adding the radio station or it won’t see an incoming stream and it can’t be added.

I tried that, if you pick the Librespot device from Spotify it says it is listening to the Librespot device and then eventually gives up and removes the Librespot entry from devices at defaults to the local machine. To get the Librespot entry point to show up in the Spotify device list again you have to restart the entry point from the entry point manager. Additionally, @CrystalGipsy your comment does not really make any sense since I have to pick the radio station in the Librespot extension point before I can stream and I cannot create the radio station until the extension point is streaming.


image
This is the message I get while I am streaming Spotify and the Spotify Current device is showing as above
image

This is what needs to be solved first. If you play a track in the Spotify app and then select the LibreSpot Entrypoint device it should play to that device, indicated by the font color that turns green. When this is the case the radio stream is active and it can be configured in Roon. If the device drops after a while it would be helpful if you can share the extension logs as described here.

The Station name that you setup in the extension settings is only for the Auto Control function. This means that if you play to the LibreSpot Entrypoint device in the Spotify app the extension automatically selects the configured radio stream.

OK, so reading the spotify web site it says: " * Make sure devices are on the same WiFi." Which is quite difficult for me given Core in hard wired and all of my spotify devices are on the other side of WiFi devices.
They are all on the same subnet but there are some protocols that do not seem to get passed I am guessing UDP based. Anyone have any thoughts if I just need to get one spotify device to make the connection or if every spotify device will have to have that initial close network connection to set up the tunnel? @Jan_Koudijs I wonder if I should move my entry point manager off the record player audio input device and place it in the AV room or I could put it on wifi? Thoughts? UPDATE: I think the network is a non-issue. I am able to play spotify out through my Marantz home theater receiver which is plugged into the same hub on the Ethernet port of the wifi router.
here is a link to the logs: Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

Wired and Wi-Fi isn’t an issue unless you have them configured as two separate networks in most cases they are extensions of the same network. If they share the same subnet as each other they are on the same network and should work fine. Can you Spotify connect to any official devices on your network normally if so this isn’t the problem and likely an issue with the install.

@CrystalGipsy Did you install your Librespot entry point on an existing entry point device or build from scratch? My recordplayer entry point has been running since the very begining, I was helping Jan debug it and I have not rebuit since I got it working. Wondering if I should rebuild my entrypoint portion of the service from the ground up?

It’s all on one pi in my setup both extension manager with entry point manager and the entry point itself all installed at same time. I don’t really use it much if I am honest but it works.

I had a look at the logs and what I see is that the software that handles the radio stream terminates at every start attempt with an error about a sleep mode. Never seen this error before. Are you running this on a RPi? Are there any power save modes active?

I just did the default entry point installation on dietpi and it is on the same device that serves as the entry point for my record player and that always works. On the Spotify end the bevavior is the same on windows, iPhone and Android.

@Jan_Koudijs I am trying to find the code to debug this error, where is your librespot repository? NVM found it GitHub - TheAppgineer/librespot: Open Source Spotify client library

@Jan_Koudijs so I tore it all down and rebuilt it from scratch and it worked first time. Had to be something cached that I could not find and clear. Thanks for looking at the logs. FWIW, I went and looked at the associated UNIX code and I could not find any parameters that seemed likely to cause the error.

2 Likes

have you installed Entrypoint Gateway?

Yes, I have the manager, the gateway, an audio entry point, and a librespot entry point


It will be better if the track information is shown!