[HowTo] Spotify-Connect support via Raspotify (LibreSpot)

In your audio settings are you using passthrough and transcode to AC3?

Do you mean the Kodi auto settings? Audio passthrough is enabled. All different audio formats (AC3, E-AC3, DTS, TrueHD, DTS-HD are enabled.

Yes. The volume control inside of Kodi only works with LPCM output. Any audio that is set to ā€œpassthroughā€ will not change volume with that control. This will not affect music playback UNLESS you have ā€œtranscode to AC3ā€ enabled which will make all audio ā€œpassthroughā€.

I donā€™t quite understand that. I have chosen HDMI as audio device, 7.1 channels. There is actually no option to activate ā€œtranscode to AC3ā€ or I do not find it.

I am quite sure that the volume setting of 90% is working in that constellation (with passthrough enabled). I had problems with a volume setting of 100% before (some audio was distorted in my preamp) and do not have those problems anymore with a volume setting of 90%. So the volume level is actually reduced, although passthrough is enabled (this is meant for OSMC/Kodi in general, not for Raspotify).

Disregard my previous posts. After looking into how raspotify works it is clear that it has no integration with Kodi and as such the audio settings in one have no bearing on the other.

Does --initial-volume actually work for you with a value different to 100%?

I donā€™t use the program or Spotify. I just looked at interwebs to see how the system worked. I suspect that the line you added might only work with the normalization option you removed from it. You might try tacking the ā€˜initial-volumeā€™ on to the end of the ā€˜optionsā€™ line with your account details as that is what I see others have done with the program that raspotify gets most of its code from. You might also try a lower volume as I think I saw somewhere that librespot defaults to using a 50% settings which makes me think that there might not be a great deal of difference between 90% and 100% with however there doing whatever with the audio.

I suspect that the line you added might only work with the normalization option you removed from it.

That was it. When adding --enable-volume-normalisation the volume is actually reduced to the value from --initial-volume. But apparently it doesnā€™t work for me as expected. As I wrote before I need the digital level to be reduced from 0dB to -6dB for my preamp to avoid distortions (this seems to be a bug of Marantz pre-amps). Reducing the level in OSMC works (results in no distortions), while reducing the level in Raspotify actually does still lead to distortions (even at low levels) :frowning:

Are you saying the volume control in Kodi is affecting the volume of what you are playing in raspotify? I also donā€™t understand what you mean by the volume is actually reduced but itā€™s still not working.

The information to get to where you need to go to would probably be found here.

Are you saying the volume control in Kodi is affecting the volume of what you are playing in raspotify?

Not really. Changing the volume in Kodi is not changing the volume of what is played in raspotify. Changing the volume in raspotify is changing the actual volume of the music. But: changing the volume in Kodi to 90% is avoiding distortions, changing the volume to 90% in raspotify is not (tested with the same audio track).

I also donā€™t understand what you mean by the volume is actually reduced but itā€™s still not working.

The volume is reduced, but the distortions are still there, so Spotify via OSMC is not working for me (as it is also not working for me when streamed directly to the Marantz pre-amp because it is also distorted in that case).

The information to get to where you need to go to would probably be found here.

I will check that for sure, thank you!

If reducing the volume in Kodi to 90% cures the issue then why canā€™t you just do that and call it a day?

On a side note does your pre-amp not have a source level adjustment?

If reducing the volume in Kodi to 90% cures the issue then why canā€™t you just do that and call it a day?

I did not describe it clearly enough: Reducing the volume to 90% in Kodi cures the issue playing the audio track from local NAS, but it does not cure the issue playing the (example) track from Spotify.

On a side note does your pre-amp not have a source level adjustment?

Yes it does. But that does not cure the issue. When leaving volume at 100% in Kodi and 0dB in pre-amp I have distortions. When reducing volume to 90% in Kodi and increasing to +6dB in pre-amp everything is fine. Leaving volume at 100% in Kodi and reducing it in pre-amp to -6dB or even -12dB does not solve the issue. Because of that I am quite sure that it must be a bug in the pre-amp which I cannot do anything about (although I even changed the pre-amp from AV7702mkII to AV7705).

I have no clue what this mess is with your preamp but it looks like if you go through the documentation I linked for librespot you should be able to find arguments that will change what audio device is being controlled and that should (I think) get you to where you wanted to be.

Hmm, I actually did not find that much in that documentation. I did not try PulseAudio, because I read that installing PulseAudio will destroy the sound in Kodi, which is not what I want.

I actually read about Spocon (GitHub - spocon/spocon: SpoCon - A Spotify Connect Client for Debian , Ubuntu and Raspberry Pi based on librespot-java) but I donā€™t know how to install in on Vero4K. add-apt-repository is missing and the Spocon-website lists only Ubuntu-repositories which I could manually add to /etc/apt/sources.list but which would not make sense on Debian.

Does anybody know if unofficial Spotify plugin for Kodi does work on Vero4K? (GitHub - kodi-community-addons/plugin.audio.spotify: Unofficial spotify plugin for Kodi)

I said ā€œdeviceā€, not mixer. You said you got the argument to set the audio level but it did not change the actual volume. Perhaps your changing the volume on the analog output which is not the device your connect to?

Did I say that? Then I didnā€™t describe it well enough, sorry. When adding the argument to set the audio level it does change the actual volume correctly (since I added --enable-volume-normalisation as you recommended). My problem is that even with reduced volume I have distortions, which I do not have when playing music in Kodi (also with reduced volume).

I tried the --device option before. I tried 0 / 1 / 0,0 / 0,1 / 1,0 / 1,1 / 2,0 / 2,1 and the only working device is 0,1. On all other devices I get

ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ERROR:librespot_playback::audio_backend::alsa: Alsa error PCM open -2
ERROR:librespot_playback::player: Could not start audio: Alsa error: PCM open failed

or

ERROR:librespot_playback::audio_backend::alsa: Alsa error PCM open -16
ERROR:librespot_playback::player: Could not start audio: Alsa error: PCM open failed

So I guess I have chosen the right device?

Perhaps you could changing it directly via alsamixer or amixer and see if you can find something that works there.

This guide for Vero 4K should be really updated, just ****** up some hoursā€¦
Yes you need raspotify v0.12.
Also if you add

RemainAfterExit=no

to the Service entry in /lib/systemd/system/raspotify.service, the service will recover after it failed when you started to play something in Kodi.

1 Like

Dear, I have installed Raspotify as reported in this faq but as you can see on the following screenshot it is not available. Why? thanks a lot.

osmc@osmc:~$ systemctl status raspotify
 raspotify.service - Raspotify
   Loaded: loaded (/lib/systemd/system/raspotify.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-12-17 10:39:13 CET; 16min ago
  Process: 670 ExecStartPre=/bin/mkdir -m 0755 -p /var/cache/raspotify (code=exited, status=0/SUCCESS)
  Process: 671 ExecStartPre=/bin/chown raspotify:raspotify /var/cache/raspotify (code=exited, status=0/SUCCESS)
 Main PID: 672 (librespot)
   Memory: 788.0K
   CGroup: /system.slice/raspotify.service
           `-672 /usr/bin/librespot --name raspotify (osmc) --backend alsa --bitrate 160 --disable-audio-cache --enab

Dec 17 10:39:13 osmc systemd[1]: Starting Raspotify...
Dec 17 10:39:13 osmc systemd[1]: Started Raspotify.
Dec 17 10:39:13 osmc librespot[672]: [2020-12-17T09:39:13Z INFO  librespot] librespot (raspotify v0.14.0) 6aac8a6 (20
Dec 17 10:39:13 osmc librespot[672]: [2020-12-17T09:39:13Z WARN  libmdns] Failed to register IPv6 receiver: Os { code
lines 1-14/14 (END)

Hi, I have the same problem, I think after some latest version of OSMC raspotify stopped working. I have been trying to troubleshoot this problem for quite a long time (few months). I can get working librespot(rasberrypie spotify speaker) but I canā€™t get working raspotify. Raspotify works for librespot like a service what is started after system startup. If you canā€™t get raspotify working, same as meā€¦ I just use librespot and I need to start it manualy everytime I want get it working. With command like this librespot -n "Living room" -b 160. It would be great if they can fix it, but I found noone with similar problems, I guess not many ppl using OSMC with raspotifyā€¦dunno.