Release: Spotifyd addon for CoreELEC

I recently got a VIM3 and found that the librespot addon doesn’t work with the Amlogic-ng version of CE. I also saw similar reports of users with a RPi4 on the LibreELEC forums. I spent a few days trying to fix it by building different versions of librespot but to no avail.

So I started experimenting with building Spotifyd, an open source Spotify client running as a UNIX daemon that is based on librespot that I used to run on my HTPC before I got my VIM3. I got Spotifyd to run and made it into an addon. I hope somebody finds it useful as well so that’s why I’m releasing it here, if not then no harm done right?

I personally use the addon on my VIM3. I’ve configured Kodi to use HDMI for audio output and I use the VIM3’s SPDIF output for Spotifyd (but you could also use an external USB sound card for example). For me this is perfect because now I can stream Spotify to my old speakers without turning on my TV or interfering with Kodi in any way. This also means that there is no feedback of the addon to Kodi at all, so it’s not possible to see what’s playing or skip songs or anything like that, the Spotifyd service is basically invisible.

Install instructions

  • Download and install the addon from zip:
    service.spotifyd-9.2.101-Amlogic-ng.zip (2.3 MB)
  • There are no settings in Kodi, configure the addon by editing:
    /storage/.kodi/userdata/addon_data/service.spotifyd/spotifyd.conf
  • Disable/enable the addon from Kodi to load the new configuration.

Changelog

101
- Update to Spotifyd v0.2.24
100
- Initial addon based on Spotifyd v0.2.23
Older versions

The initial addon was built for both Amlogic and Amlogic-ng versions of CE.

service.spotifyd-9.2.100-Amlogic.zip (2.3 MB)
service.spotifyd-9.2.100-Amlogic-ng.zip (2.3 MB)

4 Likes

Interesting.
I use Spotify (free) on my phone and cast to TV or Yamaha amp.
Does this mean I can just use Kodi (CE)to open Spotify the same way?

Thanks a lot @jant90 !
This version really works on my X96 Max + (S905X3), which was not the case for librespot.
It would be great if this plugin could be included in the coreelec repo
One thing i have to ask: is it possible to control the volume of the spotify playback from within kodi?
For now it just works with the Spotify app, but not with the remote control.
I think i have to change the playback device from Alsa to Pulseaudio but i’m not sure…?

Edit: Yeah there seems to be something broken with the mixer, whenever a sound is created by Kodi, the Spotify Playback stops. even a normal click sound

Edit: I tried changing the backend to pulseaudio, but this made the playback completly stop working…
Here you can take a look in the logs http://ix.io/2bW7 I switched the backend at about 11:20

Hi there! I have the Khadas VIM3L with Khadas Tone board as a DAC on it. I have installed the -ng version but there is no sound coming out. I can see the device (coreelec 9.2.2 installed) but there is no sound coming out of it after the cast.
About the settings and the .conf file…how can i edit it from coreelec? I can see the content as text but there is no option to edit it. As i guess i need to set the spotify username/password and the audio device?

I have the same problem. I have Odroid N2 (Coreelec 9.2.2), I install the NG version, after providing login details, spotify @ coreelec is visible in the player (in iPhone or Macbook), but there is no music in Odrod. I output the signal to the speakers via S/PDIF.

@vdgg
You don’t have to set your username and password. If a Spotify app is in the in the same network as your CoreELEC device you can use Spotify’s “Connect” feature to control Spotifyd running on your CoreELEC device. Other people (e.g. guests) can also connect as long as they’re connected to your network. If you do enter your username and password you will “tie” Spotifyd to that account only, which can be good depending on your situation (e.g. control Spotifyd from your phone while on mobile internet, or even away from home).

@Steasenburger, @vdgg, @m8kbv
Spotifyd is a Linux daemon that runs in the background without GUI. It runs completely separate from Kodi and all Kodi’s settings. If you use the same audio device that Kodi is already using they might be in conflict with each other.

You need to configure Spotifyd by manually editing the spotifyd.conf file using Samba (SMB) or SSH, as is mentioned in the addon description as well. Control or configuration from within Kodi will never be possible unless somebody writes a Python addon for it (and I for sure can’t, lol).

Regarding the configuration, you might find the information on Github by the Spotifyd author useful:

For example I’ve set my device variable in the config as device = iec958:AMLAUGESOUND, based on my VIM3’s aplay -L output:

# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=AMLAUGESOUND
    AML-AUGESOUND,
    Default Audio Device
sysdefault:CARD=AMLAUGESOUND
    AML-AUGESOUND,
    Default Audio Device
surround71:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND,
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND,
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND,
    HDMI Audio Output
1 Like

Updated the OP with a new version built from Spotifyd v0.2.24 source.

Thanks alot jant90 this works great on my Odroid N2

i couldnt get it working editting the spotifyd.conf with vi, but using nano as editor it works now.

i also disabled gui sounds in coreelec so this would not interfere when getting popup notification sounds and stopping the spotify playback

Only problem im having is one spotify account can connect, but other family members with their own spotify account cant connect after that, restart doesnt work.
im trying to find something to disable username/password caching, but can not find this.