raspotify: Some songs cant be played
Hello!
I’m using raspotify at my old cubieboard 2, its work well but some songs dont play there, anyone here know something about it? I’ve seacher but i might be using wrong words and I didnt find nothing, my english is basic as it is not my primary language. log:
Aug 18 05:12:06 cubieboard2 librespot[1921]: [2020-08-18T05:12:06Z INFO librespot_playback::player] Loading <Running Outta Love> with Spotify URI <spotify:track:1aSTn7F9RUijD31mAzjlQx> Aug 18 05:12:06 cubieboard2 librespot[1921]: [2020-08-18T05:12:06Z ERROR librespot_core::channel] channel error: 2 0 Aug 18 05:12:06 cubieboard2 librespot[1921]: [2020-08-18T05:12:06Z ERROR librespot_playback::player] Unable to load encrypted file. Aug 18 05:12:06 cubieboard2 librespot[1921]: [2020-08-18T05:12:06Z WARN librespot_connect::spirc] The player has stopped unexpectedly.

Thanks and sorry for my english
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 17
Ok, this is going to be a lot to post. It’s not as bad as it looks. : )
Run these commands as your normal, logged in user. Use sudo when a privileged command is needed.
Install some prerequisites:
sudo apt-get install build-essential libasound2-devI needed a newer version of rust than my pi installed from apt. Per the instructions at https://www.rust-lang.org/tools/install:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shWhen prompted, proceed with the default by selecting
1When the install finishes, we need to update our paths for our currently logged in session:
source ~/.cargo/envCompile and install librespot (This step will take quite a while, 41 minutes for me) If you need the alsa backend (Raspotify’s default), mk-360 found the correct way to install for that:
cargo install librespot --no-default-features --features "alsa-backend"Alternatively, this will install with librespot using the new rodio backend. Do not run this command if you ran the above command for the alsa-backend, or you won’t be able to use the alsa-backend.
cargo install librespotIf it completes successfully, you should see something similar to:
Finished release [optimized] target(s) in 41m 46sInstalling /home/pi/.cargo/bin/librespotInstalled package librespot v0.1.3 (executable librespot)If we ask the OS where librespot is installed, we should see two installs:
whereis librespotExample output:
librespot: /usr/bin/librespot /home/pi/.cargo/bin/librespotThe new copy is in your home directory. Before we make changes, lets shutdown Raspotify:
sudo systemctl stop raspotifyMove old librespot and symlink to the new one. I’m getting /usr/bin from my whereis output. My install had dtcooper’s install in /usr/bin:
cd /usr/bin/sudo mv librespot librespot.oldsudo ln -sf ~/.cargo/bin/librespot /usr/bin/librespotThe new librespot has changed some of it’s option flags. We will need to edit our /etc/default/raspotify. But first we’ll copy and symlink.
cd /etc/defaultsudo cp raspotify raspotify.oldsudo mv raspotify raspotify.newEdit raspotify.new with your preferred editor. You will need to sudo to edit this file. Raspotify by default uses --linear-volume. This option changed in the new version of librespot. Uncomment the following line by removing the # at the start of the line:
#VOLUME_ARGS="--enable-volume-normalisation --linear-volume --initial-volume=100"Edit the line so that --linear-volume is now --mixer-linear-volume:
VOLUME_ARGS="--enable-volume-normalisation --mixer-linear-volume --initial-volume=100"If you installed with the new rodio backend, you will need to change from the default backend. At the bottom of the file should be the following line. Remove the # to uncomment it:
#BACKEND_ARGS="--backend alsa"Make it look like the following (only if you installed with the default that uses rodio)
BACKEND_ARGS="--backend rodio"Finally symlink to our new config:
sudo ln -sf raspotify.new raspotifyNow start raspotify and test it.
sudo systemctl start raspotifyTo check the logs:
journalctl -u raspotifyTo change everything back to the dtcooper’s config and binary:
sudo systemctl stop raspotifysudo ln -sf /usr/bin/librespot.old /usr/bin/librespotsudo ln -sf /etc/default/raspotify.old /etc/default/raspotifysudo systemctl start raspotifyIn the future… To update our build environment and get available librespot updates: (Probably should stop the raspotify service before updating)
Install prerequisite package:
sudo apt install libssl-devInstall an update package for cargo: (This step will take a while, 21 minutes for me)
cargo install cargo-updateNow we can update rust:
rustup updateAnd our installed/compiled packages:
cargo install-update -aOther thoughts…
There is more than one way to do this. Instead of symlinking the librespot binary, we can create a systemd override file for the raspotify.service file and point it directly to the new librespot we compiled. This would prevent an update from overwriting our changes and from changing the librespot binary we are using. As it stands with this method, if dtcooper updates his repo it will install a new librespot over top of our symlink and we’ll start using that version of the file. I figured if that happened, why not try and see if it works. If it doesn’t, follow the steps to move it to librespot.old and symlink back to the version we made.
Just some additional food for thought…
I believe it has something to do with the librespot that is included with raspotify. I went to that project’s site and followed their install/compile directions, then symlinked it where raspotify installed it’s build of it. It’s been over a day since I’ve seen the issue now. Previously, I was seeing it every time I listened.
edit: Just remembered, some of the option flags have changed in the newer version of librespot. You will have to tweak /etc/default/raspotify