Librespot addon

  • Dear All,


    I´ve noticed that with librespot under libreelec on rpi4b, the sound is by default compressed. I´m not talking about compression as in mp3 or such, but when using a compressor for decreasing the dynamics of the file in order to increase its loudness.

    On some stuff, especially music from before the 90´s, this can have horrible consequences. How do I disable this?

    Please note that the latest available version from the libreelec repository is 9.0.115, and this could be something that has been made optional in later releases. I wouldn´t know how to install newer versions though, so if this is a solution, please advise. I assume that none of the settings in the settings.xml file has any impact on this...
    And, I should add that libreelecs spotify service (which fails to impress in any other way compared to librespot) does NOT add this compression, so it´s not like a thing spotify always does that can´t be turned off.


    Example: spotify:track:5BSkUsTWQWfctzP5EF8XnK - that´s really not how that song should sound!

    I´m playing it now through tuneblade, a decent alternative to play all pc audio through kodi, and this sounds how it should. I think I do recall though that it has some bugs with suddenly stopping to work, so I´d prefer librespot to not use compression.

    Also, tuneblade makes it impossible for me to have a chat over my headset while listening to spotify, since what I´m using here in my living room is a raspberry that´s RDPing into my PC on the 2nd floor, and that solution only allows one audio device, meaning that I´d get the party I´m calling talking through the libreelec raspberry.

    Edited 3 times, last by jazzlpunk ().

  • Dear all,

    I'm using LibreELEC 9.0.2 on two RPi3s, same setup with only one difference: One is playing audio via ALSA, the other via PULSE. On the former, Librespot is playing directly to sysdefault card via ALSA with no user mode switched on. Anything works well if I choose this output device on my mobile with Spotify app running. On the latter, Librespot is configured to play via "Kodi" output mode with no user mode either, it could be found as valid output device if nothing else is currently playing. First, it shows up with a different symbol (screen icon instead of loudspeaker icon) in Spotify app, second, if I try to switch to it, the app switches indeed, but only for a very short time and then switches back to the mobile device itself. "journalctl -u service.librespot" just tells me that the service is stopped after successful authentication with my spotify credentials. The other RPi using ALSA tells me instead that tracks are loaded and played successfully at the same place of the log dump.


    Thus it seems as if PULSE output is causing this problem. Does someone have similar issues?


    Best

  • I want to run Librespot on a Amlogic S905X box, but it doesn't work. On my other S905W it works fine.

    The S905X uses Alsa audio instead of Pulse, but there's no alsa support in the current amlogic version 'Invalid backend' ?

    Can you please build a version to test alsa on a Amlogic S905x ?


    S905W:


    S905X

  • Hi


    is the Addon Python3 ready?

    I have Libreelec and Milhouse on a Pi4.

    But only i get an error Message.


    Best Greedings

    Sorry, I use the google translator


  • It will take some time to build, if I have enough space on my build system. Check here again tomorrow.

    Hello,

    I'd like to download this new version too, if that's okay. I have same hardware.

    Thank you very much for your work so far. :)

  • after having solved the above issue, I received an update for the librespot addon (version 118), throught the update channel.


    this update again delivered a non functional binary:

    after replacing the binary with the version I compiled myself ... everything is back to normal.


    If I was on a custom linux installation I could understand such issues ... but as I am under libreelec my freedom to screw up my system config is quite limited ....


    So I wonder why noone else seems to have this problem ....

  • Could you please share your binary so I can try it out as well?


    I tried compiling it myself as well but the build process failed. Maybe I didn't have all the required dependencies? Anyways, it would be nice if I could try your binary! :)

  • However, revision 119 of the addon will bring back an ALSA backend to librespot.

    It will then be possible to start librespot for ALSA with a separate custom system.d service

    I'm on LibreELEC 9.2.0 on RPi2.arm. Will version 119 also be released for this combination?

  • Since a couple of months my LibreELEC librespot client isn't listed under available devices any more, although it seems to start without errors. The log does contain the following lines when I activate the addon:

    Code
    1. 2020-02-25 20:27:34.940 T:1068483456 NOTICE: Librespot: service started
    2. 2020-02-25 20:27:34.940 T:1068483456 NOTICE: Librespot: monitor started
    3. 2020-02-25 20:27:34.940 T:1068483456 NOTICE: Librespot: player started
    4. 2020-02-25 20:27:34.972 T:1068483456 NOTICE: Librespot: playback started
    5. 2020-02-25 20:27:34.972 T:1068483456 NOTICE: Librespot: stop librespot
    6. 2020-02-25 20:27:35.092 T:1085268864 NOTICE: Librespot: control pipe started

    Is this output OK? Because of "stop librespot" I guess here is something wrong.


    When I start the service directly via ssh everything is fine:

    Code
    1. LibreELEC:~/ # librespot --name=foo --username=johndoe
    2. [2020-02-25T19:38:24Z INFO librespot] librespot 710041d5d9 (2020-02-02). Built on 2020-02-03. Build ID: nHEi7Chn
    3. Password for johndoe:
    4. *** WARNING *** The program 'librespot' uses the Apple Bonjour compatibility layer of Avahi.
    5. *** WARNING *** Please fix your application to use the native API of Avahi!
    6. *** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
    7. [2020-02-25T19:38:41Z INFO librespot_core::session] Connecting to AP "gew1-accesspoint-b-h7lp.ap.spotify.com:4070"
    8. [2020-02-25T19:38:41Z INFO librespot_core::session] Authenticated as "johndoe" !
    9. [2020-02-25T19:38:41Z INFO librespot_playback::audio_backend::alsa] Using alsa sink
    10. [2020-02-25T19:38:41Z INFO librespot_core::session] Country: "DE"

    The client is listed under available devices till I abort it.


    So where is the difference? I've double checked my password in LibreELEC addon settings and also tried to listen as anonymous with no success.


    Using Librespot 9.2.0.120 on LibreELEC 9.2.0 on an RPi 2.


    EDIT: I solved it by uninstall (including settings), restart and new install of latest version /shrug

    Edited once, last by donutpanic ().


  • once again after autoupdate from 28. February: librespot binary is broken


    after replacing the binary with my self build one the device appeared back on spotify connect ... but trying to play a song I hear no audio, even though the the song appears to be played on the client device.


    Then I removed the --backend pulseaudio switch from librespot.start


    now everything works again.


    any thoughts why this is would be highly appreciated.

  • Hi Sappi,


    According to the log you provide, the binary is not broken but something in your configuration is.


    First, if you remove the --backend flag then librespot does not use pulseaudio but alsa, which is out of the scope of the addon.


    Then, your logs report a DNS issue, so let us try inspecting this:

    1. What version of LibreELEC are you running (hardware and version)?

    2. Have you set the wait for network option in LibreELEC network configuration?

    3. Is Avahi enabled in LibreELEC services configuration?

    4. Do you have a Spotify Premium account?

    5. Have you tried running in user mode, where you set Spotify username and password in the settings of the addon?

    6. Can you provide the output of "ldd /storage/.kodi/addons/service.librespot/bin/librespot", the version shipped with the addon?

    @

  • Hi awiouy,


    sorry not coming back on that for a while. Howewer, now that my system got broken again (likely doue to an update again). I am eager to trace the root cause.


    As a starting point I:


    1. deinstalled librespot addon

    2. deleted the zip archive from .kodi/addons/packages/

    3. rebootet the machine

    4. reinstalled addon

    5. rebootet the machine

    6. journalctl -u service.librespot returns the previously reported error log


    So find the requested information below


    1.) LibreELEC (official): 9.2.0 (Generic.x86_64)

    2.) no, disabled

    3.) no, disabled

    4.) yes, have premium

    5.) yes, tried but when the service is crashed, but prefer not to use, because we have mutiple accounts in my home, that want to use the service

    6.) ldd /storage/.kodi/addons/service.librespot/bin/librespot


    linux-vdso.so.1 (0x00007fff5d5fd000)

    libpulse.so.0 => /usr/lib/libpulse.so.0 (0x00007fccab1a7000)

    libpulse-simple.so.0 => /usr/lib/libpulse-simple.so.0 (0x00007fccab1a0000)

    libasound.so.2 => /usr/lib/libasound.so.2 (0x00007fccab0de000)

    libdns_sd.so.1 => /storage/.kodi/addons/service.librespot/lib/libdns_sd.so.1 (0x00007fccab0d5000)

    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fccab0d0000)

    librt.so.1 => /usr/lib/librt.so.1 (0x00007fccab0c6000)

    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fccab0a3000)

    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fccab089000)

    libc.so.6 => /usr/lib/libc.so.6 (0x00007fccaaed3000)

    /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007fccab8cb000)

    libm.so.6 => /usr/lib/libm.so.6 (0x00007fccaad93000)

    libpulsecommon-12.2.so => /usr/lib/pulseaudio/libpulsecommon-12.2.so (0x00007fccaacbe000)

    libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007fccaac76000)

    libavahi-common.so.3 => /usr/lib/libavahi-common.so.3 (0x00007fccaac67000)

    libavahi-client.so.3 => /usr/lib/libavahi-client.so.3 (0x00007fccaac56000)

    libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007fccaabb7000)


    would be great if the would tell you something meaningful ...


    Best Regards

    Sappi

  • Hi Sappi,


    To solve your issue either enable avahi in LibreELEC services or set user name and password in user mode in Librespot settings.


    Also, wait for network is recommended for Librespot and for other services.


    Librespot for LibreELEC is built with dns-sd (avahi) rather than mdns, for historical reasons and also because user interaction is smoother.


    Hope this helps.

    @

  • Hello Sappi,


    did you have more luck with Avahi turned on? I am asking because I had likely the same problem, but as awiouy mentioned earlier, Avahi must be turned on. That was my problem.

  • Really want to use it on my raspberry pi 4. Has anyone tried ******* to solve this problem? I found some reviews of it but not sure if it really works.