A little help with librespot?

Hey everyone,

I’m a Odroid N2+ user. I’ve been trying to get librespot to work with my device so we can listen to music in the livingroom, but I am thoroughly stuck.

So from these forums I have figured out that the 20.2.2 version of librespot that is in the current repository is broken, so I have instead manually installed the recommended new version, 20.3.2 using a zip file.

It appears to be working, at least on some level. My spotify app can see it, and connect to it, and from the app, it LOOKS like it is playing in CoreElec, but the only problem is nothing is happening.

Part of my problem in troubleshooting this is that I am not sure what I am supposed to expect when using librespot. Is a window supposed to pop up on screen when I start using it? If so that isn’t working.

Is it just supposed to sit in the background and play audio without any visual cues on screen? if so, then it might be my sound settings that are wrong.

But I have tried just about everything sound setting wise, and still, I get nothing but silence.

I changed the settings to ALSA, and by default it populated “hw:2,0” which I don’t think is an alsa device on my box.

“aplay -l” shows the following which is remarkably unhelpful:

**** List of PLAYBACK Hardware Devices ****
card 0: AMLAUGESOUND [AML-AUGESOUND], device 0: SPDIF-B-dummy dummy-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 1: TDM-B-T9015-audio-hifi T9015-audio-hifi-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 2: SPDIF-A-dummy dummy-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 3: TDM-C-dummy dummy-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Based on this, I guessed by device was “hw:0,1” as everything else said “dummy” but that produced no sound at all.

I tried again with aplay -L and it is at least a little bit more helpful:

null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=AMLAUGESOUND
    AML-AUGESOUND, 
    Default Audio Device
sysdefault:CARD=AMLAUGESOUND
    AML-AUGESOUND, 
    Default Audio Device
surround71:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND, 
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND, 
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND, 
    HDMI Audio Output

Kodi is currently set to play back on ALSA:AML-AUGESOUND, HDMI, and the sound is getting to the right output (HDMI → TV, analog output from TV to amplifier), so I figured I should set it to the same thing to make sure the audio went to the right place.

So, I tried setting the alsa device in the librespot settings to “hdmi:CARD=AMLAUGESOUND,DEV=0” to no avail. The same happens. There is just no output.

Then I read that the “Keep Audio Device Alive” setting in Kodi can interfere with it, so I turned that off. Still nothing.

Figuring maybe it was an alias, via hardware id problem, I tried using the direct device name which I interpreted to be “hw:0,0” but also, nothing.

At this point I am stuck. I’d appreciate any help from anyone who might have this working.

I’d post logs, but I am not quite sure where to find them. I don’t see anything that looks relevant in /var/log. From what I recall of Kodi on the Linux desktop, it drops logs in the users home directory. It looks like /storage is the home directory, so I found the .kodi folder there, and there are some main kodi logs, but nothing that seems relevant to the plugin.

So, I am thoroughly stuck. Appreciate any help and / or suggestions.

Much appreciated,
Matt

1 Like

@mattlach : Librespot 20.2.2 has been working out of the box (no credentials configured in settings) for me on several devices. I have a paid family subscription. I run on several devices including both ng and ne 20.2 Nexus … Typically all I do is change Name to reflect room or location. All worked last week. Note that I do not use Librespot often. … Now that I read your post I tested and nothing works. That is: the Spotify client on my (Linux) desktop sees all the Librespot by name and even switches to them as output device but the CE Librespot itself does not give any sign of life. FYI: it should show album/song artwork and simply play music.

So, since nothing changed from my side, I am tempted to believe something in the Spotify protocol or subscription may have changed.

No logs.

When I turn on debug logging I notice:

2023-11-25 00:22:17.896 T:13705   debug <general>: Librespot: [2023-11-24T23:22:17Z ERROR librespot_playback::player] Unable to load encrypted file: Error { kind: FailedPrecondition, error: ParseIntError { kind: InvalidDigit } }
2023-11-25 00:22:17.896 T:13705   debug <general>: Librespot: [2023-11-24T23:22:17Z ERROR librespot_playback::player] Skipping to next track, unable to load track <SpotifyId("spotify:track:3uVuMqVTiVf3mUHMDFVXai")>: ()

fwiw: one may need

sysctl abi.cp15_barrier=2

for Librespot to work, but I guess you knew.

Has anyone else seen Librespot stop working recently?

btw: where does one find Librespot more recent than 20.2.2 ? But again, 20.2.2 worked just fine until now.

I noticed that Librespot doesn’t work on Nexus either.
However,if I swap to the Nexus nightly,it does work.
The Nexus nightly seems pretty reliable on my N2+
Hope this helps.B

1 Like

@brettly : thanks for mentioning I do not use librespot much but it is good to hear it is not broken. I will wait for CE 20.3

Hello!
Vim3Pro-user with similar problem.
Did you resolve your Librespot issues?

I have the same issue as you.
I can see it playing from my phone but no sound. It plays and I can change volume from my phone but i cant pause but not a sound coming out.

Librespot 20.4.4
Vim3Pro

Tried with the nightlie:
https://relkai.coreelec.org/Amlogic-ng/ce-20/CoreELEC-Amlogic-ng.arm-20.4-Nexus_nightly_20240228-Generic.img.gz”,
to no avail.

Tried to change sound hw with alsa from the addon configuration:
iec958:CARD=AMLAUGESOUND,DEV=0 which is my default cards. And tried:
default:CARD=AMLAUGESOUND as well.

From ssh:
-librespot backend?

[2024-03-02T17:48:00Z INFO librespot] librespot 0.5.0-dev 2d593d4b08 (Built on 2024-02-16, Build ID: aYWazsCh, Profile: release)
*** WARNING *** The program ‘librespot’ uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
[2024-03-02T17:48:00Z INFO librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2024-03-02T17:48:00Z INFO librespot_playback::convert] Converting with ditherer: tpdf
[2024-03-02T17:48:00Z INFO librespot_playback::audio_backend::alsa] Using AlsaSink with format: S16

Any guidance would be much appreciated!

@RosensRauk
I have librespot working again in CE 20.3 and 20.4
Which version do you use?

I have tried with two versions: 20.2.2, 20.4.4.

Just installed 20.5-nexus 20240306 nightly. Still no sound.
A small difference is that now i can not update the addon from UI, it fails. Probably because of nightly.
Will continue testing with earlier versions of librespot alt. Go back to 20.4.

How did you fix librespot for 20.4?

@RosensRauk

I have not really done anything … on CE 20.2 librespot at that time did not work for me, but then later from CE 20.3 onward, it did work again.

I have, in .config/autostart.sh :
sysctl abi.cp15_barrier=2

Update.
I am now on 21.1 nightly and still no functional Librespot. I made a clean install.

I have found a workaround of sorts.
By incorporating my Home Assistant I can use the MUSIC ASSISTANT(MA) addon as caster towards Coreelec.
It’s not without its own share of problems. Only Spotify playlists of a certain age will actually work. Newly created Spotify playlists, MA will not find the source.
I am starting to be inclined to that this can be HW related or maybe the old 4.9.x kernel that Coreelec stands on is the culprit.

I am out of ideas.

I decided to try again .

Intermittently i get audio from alsa hw,0,3. Sometimes more than one song after another. After a reboot it stops working.
Maybe i have a faulty sound server.
I can’t even get the spotify → Bluetooth working.

journalctl -u service.librespot have no entries.
I always fails after "spclient " resolved but in the app it continues to play.

librespot_core::spclient] Resolved "gew4-spclient.spotify.com:443" as spclient access point
[2024-07-24T18:02:43Z WARN  librespot_core::spclient] Unable to get client token. Trying to continue without...
[2024-07-24T18:02:44Z INFO  librespot_playback::player] Loading <Blir det vår nu i Irak?> with Spotify URI <spotify:episode:7JpvDQrrg4aRgZhojD0iq4>
[2024-07-24T18:02:44Z WARN  librespot_core::spclient] Unable to get client token. Trying to continue without...
[2024-07-24T18:02:44Z ERROR librespot_core::audio_key] error audio key 0 1
[2024-07-24T18:02:44Z WARN  librespot_playback::player] Unable to load key, continuing without decryption: Service unavailable { audio key error }.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.