Librespot Add-on

    • Official Post

    Hey, is there a more recent build of this addon than "RPi2.service.librespot-8.1.100.zip"? The first post by awiouy links to "RPI2.service.librespot-8.1.90.zip" and I am not sure where I got version 8.1.100 from.

    The merged MR on libreelec github project seems to also not having arrived in the official repository as of now.

    We noticed a build issue while building librespot, which is fixed by PR #1707. Librespot should be available soon for all projects, via the LibreELEC Add-ons repository. Thank you for your patience.

  • Hi,

    I'm running librespot on intel nuc with libreelec and librespot won't to start on boot...I tried issues from other posts without any result :(

    Log :

    Jun 27 12:19:15 LibreELEC sh[636]: INFO:librespot: librespot 5e5bc0b (2017-06-23). Built on 2017-06-23.

    Jun 27 12:19:15 LibreELEC sh[636]: WARN:librespot::apresolve: Failed to resolve Access Point: HTTP error

    Jun 27 12:19:15 LibreELEC sh[636]: WARN:librespot::apresolve: Using fallback "ap.spotify.com:80"

    Jun 27 12:19:15 LibreELEC sh[636]: INFO:librespot::session: Connecting to AP "ap.spotify.com:80"

    Jun 27 12:19:15 LibreELEC sh[636]: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Custom(Custom { kind: Other,

    error: StringError("failed to lookup address information: Temporary failure in name resolution") }) }', /checkout/src/libcore/result.rs:859

    Jun 27 12:19:15 LibreELEC sh[636]: note: Run with `RUST_BACKTRACE=1` for a backtrace.

    Jun 27 12:19:15 LibreELEC systemd[1]: service.librespot.service: Main process exited, code=exited, status=101/n/a

    Jun 27 12:19:15 LibreELEC systemd[1]: service.librespot.service: Unit entered failed state.

    Jun 27 12:19:15 LibreELEC systemd[1]: service.librespot.service: Failed with result 'exit-code'.

    Jun 27 12:19:15 LibreELEC systemd[1]: service.librespot.service: Service hold-off time over, scheduling restart.

    Jun 27 12:19:15 LibreELEC systemd[1]: Stopped librespot.

    Jun 27 12:19:15 LibreELEC systemd[1]: service.librespot.service: Start request repeated too quickly.

    Jun 27 12:19:15 LibreELEC systemd[1]: Failed to start librespot.

    Jun 27 12:19:15 LibreELEC systemd[1]: service.librespot.service: Unit entered failed state.

    Jun 27 12:19:15 LibreELEC systemd[1]: service.librespot.service: Failed with result 'exit-code'.

    I don't understand, DNS resolution works perfectly...

    Thanks :)

  • Ok...I tried to put a "sleep 5" in /storage/.kodi/addons/service.librespot/bin/librespot.start at line 24, between

    oe_setup_addon service.librespot

    and

    activate_card() {

    AND IT WORKS ;)

    ->

    ...

    . /etc/os-release

    . /etc/profile

    oe_setup_addon service.librespot

    sleep 5

    activate_card() {

    if [ -e "/proc/asound/$1" ]; then

    ...

    It seems to be a ressources start order issue. I don't know exactly which ressource...maybe sound or network cards? Or librespot service starts too quickly, not sure about that...

    Regards

  • Is your network wired or wireless?

  • Is your network wired or wireless?

    awiouy : My intel NUC is wired (macbook & other control devices are wireless, but I think we don't care ^^)

    I'll also try the plugin directly on raspberry-pi-1 with raspbian with wireless connection (I'll feedback later if I encounter any issue).

    Edited 2 times, last by T0mT0m (June 27, 2017 at 12:00 PM).

  • awiouy : My intel NUC is wired (macbook & other control devices are wireless, but I think we don't care ^^)

    I'll also try the plugin directly on raspberry-pi-1 with raspbian (wireless), but in my case the issue was on the intel nuc

    Hm... DNS error suggests that network is not fully up when librespot starts... I would like to understand then mitigate ;)

    Note that activate_card is merely a function, called somewhere in the script, and that this function does nothing on x86_64.

  • awiouy  T0mT0m I've had similar problems reported on my original repo. (I've asked them to report here but here's my summary as that issue has become muddled since it started on my initial builds but they now use the LibreELEC Repo version).

    The two issues can be summarised as follows:

    1. The librespot binary has issues resolving the AP address when starting. The odd time it starts, it fails with #2. I'm not sure what is causing this;

    2. The librespot binary fails due to an issue in rust-crypto. A build with a fix for rust-crypto available for testing here (Haven't a NUC device myself to test).

    The common thread is that it is on Intel NUCs. Awaiting more detailed debug logs.

  • Another question : is it possible to manage librespot volume not only with spotify control device, but directly with libreelec volume control ?

    I have a hifi amplifier set to 1/4 volume (due to differents uses, so I don't want to touch the volume button on this amplifier), so I usually manage volume from devices (intel nuc with libreelec, etc...)

    In this case, each time I start my nuc, spotify (on android or mac) detect the device and set maximum volume :-/

  • I notice some delay with playback on track change. this is most annoying with audiobooks when on each track start aproximately 1 second is missing/silent. This only happens with playback via librespot - playback with kodi works as expected.

  • We heard some of "Bibi Blocksberg", "Jake und die Nimmerlandpiraten" and "Leo Lausemaus" which are in German, so it might be hard to notice if you wouldn't understand it. ;) I can try to find some english audiobooks later this evening.

  • Great! When I tried to find some English spoken audiobooks earlier, I noticed that my receiver/amp reconfigures the input format on every track change. Seems like librespot closes the stream/interface after each track and opens the interface/a new stream at start of the next track. This takes some second or two, and leads to this issue. Kodi itself seemingly keeps the stream open and only changes stream format if it is necessary.

  • I created a proof of concept to demonstrate playback through Kodi.

    Preview addon for Generic

    Preview addon for RPi2

    Code

    To activate set Mode to Kodi in the addon settings.

    Librespot will therequest Kodi to play the stream onstart (every time librespot starts playing a track), provided Kodi is not playing something.

    This should solve some of the issues raised in this thread, namely:

    interference with Kodi newphreak

    discontinuous playback ZyanKLee

    screensaver klisk

    volume

    User interaction is rudimentary and work in progress.

  • awiouy this works almost flawless:

    This PoC introduces a delay of something between 5-10 seconds in playback - perhaps some buffer getting filled? To be more clear: spotify app is around 7 seconds in the future compared to what gets played back. For example when one changes the track, it takes that time before the old track is stopped and the new one starts playing. Similar on track changes.

    Aside from that, it does what it should: discontinuous playback is gone with kodi as playback mode.

  • There are some requests from my significant other to fulfill the WAF:

    * let users stop playback through kodi ui (if I start music with my Spotify account, she can not stop it with hers)

    * display playback info in kodi ui (artist, title, album, etc)

    • Official Post

    Thank you for the feedback ZyanKLee

    I will see if I can reduce the latency introduced by ffmpeg.

    As for not being able to stop feedback from another account, I think it is a (quite logical) feature of librespot. I was thinking of enabling the Kodi user (rather than the connected Spotify user) to stop Spotify playback.

    I will see if there is a way to provide playback information, but the only information readily available seems to be the title of the current track.