LibreELEC.tv icon indicating copy to clipboard operation
LibreELEC.tv copied to clipboard

librespot: update to 0.4.2 and addon (131)

Open ne0h opened this issue 2 years ago • 4 comments

update 0.3.1 (2021-10-25) to 0.4.2 (2022-07-29) release notes:

  • https://github.com/librespot-org/librespot/releases/tag/v0.4.0
  • https://github.com/librespot-org/librespot/releases/tag/v0.4.1
  • https://github.com/librespot-org/librespot/releases/tag/v0.4.2

ne0h avatar Aug 07 '22 10:08 ne0h

have you build and runtime tested this?

This post https://forum.libreelec.tv/thread/25931-librespot-no-longer-works/?postID=171641#post171641 indicates the notify kodi patch https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/addons/service/librespot/patches/librespot-01_notify_kodi.patch needs to be fixed or dropped, otherwise it doesn't build

HiassofT avatar Aug 07 '22 10:08 HiassofT

I am sorry, I did not want to blast an ongoing discussion! I was just looking into the PRs in this repository and opened a new one as a starting point for a discussion (because I did not find one) :)

@heitbaum, as your PR appears to have a greater scope than mine, what about merging mine first to get librespot back into a running state and after that merging yours?

ne0h avatar Aug 09 '22 15:08 ne0h

Fixing one issue with librespot-01_notify_kodi.patch

1982 | ...                   &track_id.to_base62()].join(" ")),
     |                       ^^^^^^^^^^^^^^^^^^^^^ expected `str`, found enum `std::result::Result`

required a single change, the line should be &track_id.to_base62().unwrap()].join(" ")),. I attached the complete patch file.

I tested librespot 0.4.2 by compiling it in the official Rust docker container on LibreElec 10.0.2 with the patch applied. I then copied the resulting binary librespot over the one used by the Kodi add-on in /storage/.kodi/addons/service.librespot/bin/librespot. With this the add-on works as expect on LE 10.0.2.

During building the second error

1979 |             match event {
     |                   ^^^^^ not found in this scope

did not occur. I didn't test building the add-on with the LE11 build system.

librespot-01_notify_kodi.patch.zip

Obrekr avatar Aug 13 '22 12:08 Obrekr

  1. The old-api branch, of which 0.4.2 is the latest version, seems to have issues when connecting to certain access points. This is being tracked on their repo.
  2. The new-api or dev branches don't seem to have this issue, but a stable version of these has not been released yet. I have successfully patched this version for notify-kodi and am using it on a RPi, but occasionally it will disconnect for seemingly no reason. I reckon this is due to the new api still being a bit unstable.
  3. The onevent flag for librespot is going to get a lot more powerful as soon as this PR is merged, which should allow us to rewrite the addon without the need for patching, nor fetching data from the Spotify API. This is definitely what we should be aiming for in the long run.
  4. Minor issue, but I noticed that we are building the Librespot binary with both the ALSA and Pulseaudio backends, but the ALSA backend is never actually used. I have built it with just the Pulseaudio backend and it works fine, so I don't see a reason to build it with both.

kernitus avatar Sep 04 '22 13:09 kernitus

Moving to LE12. Still needs a patch for Kodi event handling

heitbaum avatar Jan 18 '23 11:01 heitbaum

Superceeded by #7732

heitbaum avatar Apr 09 '23 11:04 heitbaum