Librespot addon

  • Only an update on what I ended up doing: I removed LibreELEC just to have more control,

    and ended up installing Rocky Linux 8, Kodi (using flatpak) and librespot.

    I set Kodi and librespot as "startup applications", and they work nicely together now

    (they can also play simultaneously, for example).

  • Hi, I've installed latest librespot (2023-05-14) kodi plugin, version 11.80.1.1 by awiouy (Anton Voyl) on latest kodi nightly on RPI4.

    The plugin works with default options, in my case backend alsa and device hw:2,0

    #librespot -d ? gives my device:

    Code
    iec958:CARD=sndrpihifiberry,DEV=0
    Description:
    snd_rpi_hifiberry_digi, HiFiBerry Digi+ Pro HiFi wm8804-spdif-0
    IEC958 (S/PDIF) Digital Audio Output
    Supported Format(s):
    S16 S24

    I have found you can enter certain unconfigured options, since some are preconfigured by the python scripts that load the daemon (there is no systemctl service any longer to manage as audiobobo pointed out). The python acripts that load the daemon are here:

    /storage/.kodi/addons/service.librespot

    By default, cache is disabled and bitrate is set at 320 by, as default soundcard selected by kodi config.

    You can enter extra options in the librespot kodi addon config interface, I entered -f S24 and it seems to work.


    Note: apart from this client addon, I have found another Kodi .zip wrapper manual plugin for Spotify. (https://github.com/jhjdekker98/plugin.audio.spotifyd-client), and it has a link for a armhf binary on https://github.com/Spotifyd/spotifyd/releases, but I haven't tried installing it since it requires Spotify Developer account settings and copying binaries to a specific path: /resources/lib/spotifyd/spotifyd. It is an alternative to the 'official' librespot kodi plugin, and it lets you customize all options to your liking.

    Edited 11 times, last by wyup (July 22, 2023 at 11:07 AM).

  • I don't have a suggestion, but I can second your impression. My guess before was that Librespot stops working when I don't explicitly disconnect from it but just leave the network.

    Is there a different version to install or can the plugin be restarted over a cron job or something? What can I do to help?
    Thanks for your help!

  • I don't have a suggestion, but I can second your impression. My guess before was that Librespot stops working when I don't explicitly disconnect from it but just leave the network.

    Is there a different version to install or can the plugin be restarted over a cron job or something? What can I do to help?
    Thanks for your help!

    Librespot used to stop working after it lost connection to Spotify
    Restarting librespot used to solve the issue, switching from wifi to wired network used to prevent it

    This may have been solved with the latest version of librespot

  • I'm used to librespot installed on Raspbian Lite. Now, on LibreELEC config in options is limited and I'm not sure how to edit settings file.

    I want to set this:

    Code
    LIBRESPOT_BITRATE="320"
    LIBRESPOT_FORMAT="S32"
    LIBRESPOT_INITIAL_VOLUME="100"
    LIBRESPOT_NORMALISATION_PREGAIN="-6.0"
    LIBRESPOT_VOLUME_CTRL="log"

    Not sure if LIBRESPOT_BACKEND="alsa" is needed to work with Kodi. Also, credentials are not required for high quality streaming?

    Please, how can I set up this config on librespot in LibreELEC? Thanks.

  • I'm used to librespot installed on Raspbian Lite. Now, on LibreELEC config in options is limited and I'm not sure how to edit settings file.

    I want to set this:

    Code
    LIBRESPOT_BITRATE="320"
    LIBRESPOT_FORMAT="S32"
    LIBRESPOT_INITIAL_VOLUME="100"
    LIBRESPOT_NORMALISATION_PREGAIN="-6.0"
    LIBRESPOT_VOLUME_CTRL="log"

    Not sure if LIBRESPOT_BACKEND="alsa" is needed to work with Kodi. Also, credentials are not required for high quality streaming?

    Please, how can I set up this config on librespot in LibreELEC? Thanks.

    The librespot addon works fine with the default settings. Use a Spotify app to control it.

    With backend pulseaudio_rtp, librespot plays through Kodi.

    With backend alsa, librespot plays independently of Kodi but requires an audio device that Kodi does not use.

    If you really need to set extra options, use the options parameter to specify them.

    You can also call librespot from the command line or from a script.

  • If you really need to set extra options, use the options parameter to specify them.

    You can also call librespot from the command line or from a script.

    Please, can you elaborate on this? Is there any guide about it? I use USB DAC with studio monitors, so those settings are important for me. Thanks.

  • Please, can you elaborate on this? Is there any guide about it? I use USB DAC with studio monitors, so those settings are important for me. Thanks.

    If you use the USB DAC for Kodi playback, then set the backend setting to pulseaudio_rtp

    Otherwise, set the backend setting to alsa and set the alsa_device setting to specify the USB DAC (the 'aplay -l' or 'aplay -L' terminal commands will help you finding available alsa devices, for instance hw:2,0).

    If you cannot make it work, then provide more details about your setup (the outputs of 'aplay -l' and 'aplay -L', and explain what uses the USB DAC).

    This link lists librespot options, but you should not need them: https://github.com/librespot-org/librespot/wiki/Options.

  • Good Morning, I've noticed that the timestamp bar acts as if the music is a live stream, showing how long I've been listening with Spotify, but not how long the song is, nor the progress in the current song. Normally, this wouldn't be an issue, but it messes with the lyrics, as the metadata updates, but Kodi is never given a signal that the song as changed. the result is that the lyrics add-on will not fetch new lyrics, and if i force it to, can't synchronize lyrics.

    Is there any way to correct this behavior? or is it a limitation of the way the add-on works?

  • I'm not sure if the limitation is in how Spotify streams audio to the add-on, or how the add-on handles and presents audio to Kodi. The original add-on author is long absent from the forum so the add-on is essentially unmaintained these days; we manage to unbreak it occasionally but if new features and changes are desired, the responsibilty for making them rests with the requestor.

    NB: I personally stopped using LibreSpot some time ago as the iPhone app that I normally stream from evolved to support AirPlay and Kodi shows up as an AirPlay target. In this arrangement the current-playing track duration of the media shows correctly. I haven't tried the lyrics add-on (most of what I stream doesn't have lyrics) but since 'time' is correct I think it would work.