Librespot Add-on

  • 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.

  • Hi, I had a very good experince with librespot for a couple of months, but it stopped working somewhen in the last two weeks.
    I can connect via the Spotify app but when I hit play nothing happens. I tried it both with Libreelec v11.0.6 and librespot v11.0.0.4 and the new LibreElec v12.0.0 and librespot 12.0.0.1. I read here RE: Librespot on Kodi 'failed' that adding user creds helps. The problem is I have a dash in my username and using quotes does not seem to work. Has anyone any ideas?

    Here ist the log:

  • "Too many errors"

    Since recently, librespot is no longer visible on the network by Spotify, when I restart the raspberry pi4 or re-enable the addon, "Too many errors" show up in the addon.

  • Authentication failed with reason: BedCredentials

    this is in the log:

    NOTICE: Librespot: thread 'main' panicked at 'Authentication failed with reason: BedCredentials', core/src/connection/mod.rs:121:21

    Any suggestions for a fix? Thanks

  • In my case as well spotify has stopped working. Libresoft is visible from spotify, but after trying to connect to it from spotify the first time (which does not work), it disappears from spotify.

    I see the following type of errors

    Code
    2024-09-05 11:37:29.735 T:883      INFO <general>: Librespot: [2024-09-05T09:37:29Z INFO  librespot_connect::spirc] Fetching autoplay context uri
    2024-09-05 11:37:29.769 T:883      INFO <general>: Librespot: [2024-09-05T09:37:29Z INFO  librespot_connect::spirc] Autoplay uri resolved to <"spotify:station:playlist:37i9dQZF1E35R8hFoMeHWo">
    2024-09-05 11:37:29.808 T:883      INFO <general>: Librespot: [2024-09-05T09:37:29Z INFO  librespot_playback::player] Loading <Chasing the Sun> with Spotify URI <spotify:track:7wrDfgpKlkqTaut2sjysdw>
    2024-09-05 11:37:29.893 T:883      INFO <general>: Librespot: [2024-09-05T09:37:29Z ERROR librespot_core::channel] channel error: 2 0
    2024-09-05 11:37:29.894 T:883      INFO <general>: Librespot: [2024-09-05T09:37:29Z ERROR librespot_playback::player] Unable to load encrypted file: ChannelError
    2024-09-05 11:37:29.894 T:883      INFO <general>: Librespot: [2024-09-05T09:37:29Z WARN  librespot_playback::player] Unable to load <SpotifyId { id: 328575273318722427711936273846579157590, audio_type: Track }>

    I hope someone can help me out on this. Thanks