Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 | Spotify does not work anymore #1815

Closed
hyperbit00 opened this issue May 16, 2022 · 145 comments · Fixed by #2315 · May be fixed by #2164
Closed

🐛 | Spotify does not work anymore #1815

hyperbit00 opened this issue May 16, 2022 · 145 comments · Fixed by #2315 · May be fixed by #2164

Comments

@hyperbit00
Copy link

hyperbit00 commented May 16, 2022

Bug

What I did

My Working Phoniebox stops working since today.
Spotify integration does not work. only local playback works

I Changed nothing. Works weeks before like a charm.
Spotify Premium is Valid

What happened

May 16 19:46:47 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.__main__ Starting Mopidy 3.2.0
May 16 19:46:47 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.config Loading config from builtin defaults
May 16 19:46:47 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.config Loading config from file:///usr/share/mopidy/conf.d/mopidy-local.conf
May 16 19:46:47 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.config Loading config from file:///usr/share/mopidy/conf.d/mopidy.conf
May 16 19:46:47 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.config Loading config from file:///etc/mopidy/mopidy.conf
May 16 19:46:47 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.config Loading config from command line options
May 16 19:46:47 phoniebox mopidy[2207]: ERROR    [MainThread] mopidy.internal.log Loading logging config '/etc/mopidy/logging.conf' failed. 'formatters'
May 16 19:46:47 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.__main__ Enabled extensions: local, spotify, file, mpd, iris, m3u, stream, softwaremixer, http
May 16 19:46:47 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.__main__ Disabled extensions: none
May 16 19:46:48 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.commands Starting Mopidy mixer: SoftwareMixer
May 16 19:46:48 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.commands Mixer volume set to 30
May 16 19:46:48 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.commands Starting Mopidy audio
May 16 19:46:48 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.commands Starting Mopidy backends: FileBackend, M3UBackend, StreamBackend, SpotifyBackend, LocalBackend
May 16 19:46:49 phoniebox mopidy[2207]: INFO     [Audio-2] mopidy.audio.actor Audio output set to "alsasink"
May 16 19:46:49 phoniebox mopidy[2207]: ERROR    [SpotifyEventLoop] spotify.session Spotify login error: <ErrorType.USER_NEEDS_PREMIUM: 15>
May 16 19:46:49 phoniebox mopidy[2207]: INFO     [SpotifyBackend-6] mopidy_spotify.web Logged into Spotify Web API as XXXXXXXXXX
May 16 19:46:49 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.commands Starting Mopidy core
May 16 19:46:49 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.commands Starting Mopidy frontends: IrisFrontend, HttpFrontend, MpdFrontend
May 16 19:46:49 phoniebox mopidy[2207]: INFO     [IrisFrontend-11] mopidy_iris.core Starting Iris 3.54.2
May 16 19:46:49 phoniebox mopidy[2207]: INFO     [HttpFrontend-13] mopidy.http.actor HTTP server running at [0.0.0.0]:6680
May 16 19:46:49 phoniebox mopidy[2207]: INFO     [MainThread] mopidy_mpd.actor MPD server running at [0.0.0.0]:6600
May 16 19:46:49 phoniebox mopidy[2207]: INFO     [MainThread] mopidy.commands Starting GLib mainloop


May 16 19:49:29 phoniebox mopidy[2207]: INFO     [MpdSession-278] mopidy_mpd.session New MPD connection from [127.0.0.1]:34620
May 16 19:49:29 phoniebox mopidy[2207]: INFO     [SpotifyBackend-6] mopidy_spotify.lookup Failed to lookup 'spotify:album:0XXX': Session must be logged in and online to load objects: <ConnectionState.LOGGED_O
May 16 19:49:29 phoniebox mopidy[2207]: INFO     [MpdSession-279] mopidy_mpd.session New MPD connection from [127.0.0.1]:34622
@hyperbit00
Copy link
Author

hyperbit00 commented May 16, 2022

I think its a problem an is described here -> ? https://github.com/mopidy/mopidy-spotify

"As promised last month, Spotify disabled access to libspotify on 16/05/2022. As of today, seven years after libspotify was deprecated, there is still no official replacement library available."

I think this is a major problem for every Phonebox/Spotify version

@s-martin
Copy link
Collaborator

s-martin commented May 16, 2022

Thanks for reporting this.

Looks like this is a real showstopper, we need to look into that.

@s-martin s-martin changed the title 🐛 | Spotify does not working anymore 🐛 | Spotify does not work anymore May 16, 2022
@varac
Copy link
Contributor

varac commented May 18, 2022

Holy shite, yes please prioritized this, I think this breaks every other phoniebox out there (including mine :/)

@Vanierica
Copy link

Can confirm. We have 2 Phonieboxes for our children and both stopped playing spotify over night.

@thomas-wolf
Copy link

Confirmed by 5 boxes and 5 sad children. There will be no quick way around it. We all hoped that day would never come, but it finally has come and there is not much one can do as long as spotify does not reconsider its decision. At least the non-spotify part is still working.

@s-martin
Copy link
Collaborator

s-martin commented May 18, 2022

Holy shite, yes please prioritized this, I think this breaks every other phoniebox out there (including mine :/)

Unfortunately I don’t think that there will be quick a solution to this, because Spotify disabled the support of libspotify.

The people from mopidy-spotify (which Phoniebox relies on) are currently working on solutions (see mopidy/mopidy-spotify#110 (comment)), but no idea, when a solution will be available.

@s-martin
Copy link
Collaborator

@MiczFlor

@DavidOrtmann
Copy link

Is it out of the question to use another API or SDK for Spotify on Phoniebox? It's really depressing to lose that unique selling point. I didn't see it coming, either.

@s-martin
Copy link
Collaborator

Is it out of the question to use another API or SDK for Spotify on Phoniebox? It's really depressing to lose that unique selling point. I didn't see it coming, either.

See #1815 (comment)

@morpheus12
Copy link

morpheus12 commented May 18, 2022

Same here spotify is not working anymore. Is there any alternative API or SDK to replace mopidy?

whats about this: https://lib.rs/crates/gst-plugin-spotify
(found here mopidy/mopidy-spotify#110 (comment))

@sonicdee
Copy link

^that might work, see how to install https://qengineering.eu/install-gstreamer-1.18-on-raspberry-pi-4.html
( I hadn't found time to try ;( )

@s-martin
Copy link
Collaborator

s-martin commented May 20, 2022

Same here spotify is not working anymore. Is there any alternative API or SDK to replace mopidy?

whats about this: https://lib.rs/crates/gst-plugin-spotify (found here mopidy/mopidy-spotify#110 (comment))

Current implementation relies on mopidy in the Spotify edition (also for non Spotify functions), so from my point of view we should wait for an update of mopidy-spotify. Hopefully this would be only an update of mopidy-spotify.

But if anyone comes up with a different solution and proposes a PR, we could also check if this is the way we want to go.

As we are currently working on a new and shiny version 3 we need to check the implications in https://github.com/MiczFlor/RPi-Jukebox-RFID/tree/future3/spotify as well.

@pabera @ChisSoc @Groovylein @MiczFlor

@sonicdee
Copy link

As we are currently working on a new and shiny version 3 we need to check the implications in https://github.com/MiczFlor/RPi-Jukebox-RFID/tree/future3/spotify as well.

^^I've seen there is already alottah python inside, this might be handsome, I'll try...

https://pypi.org/project/spotify/

@Groovylein
Copy link
Collaborator

As we are currently working on a new and shiny version 3 we need to check the implications in https://github.com/MiczFlor/RPi-Jukebox-RFID/tree/future3/spotify as well.

I've tested the development environment for Spotify yesterday and it works 🤞
We are using https://github.com/librespot-org/librespot-java, which is using the Spotify Web-API

@sonicdee
Copy link

As we are currently working on a new and shiny version 3 we need to check the implications in https://github.com/MiczFlor/RPi-Jukebox-RFID/tree/future3/spotify as well.

I've tested the development environment for Spotify yesterday and it works 🤞 We are using https://github.com/librespot-org/librespot-java, which is using the Spotify Web-API

yeah, would be so nice to have a kind of working version, so guys can swtich to future 3 ;)

@usamer77
Copy link

usamer77 commented May 20, 2022

Hey Guys, that would be so so so awesome if you would be able to find an alternative solution! You would be a star for so many Kids and Dads! :-)

@morpheus12
Copy link

I'm to stupid for active coding contribution. It would be awesome to get an alternative for my son. We both created a huge amount of cards with his favorite audiobooks. Therefore it would be great if you professionals find a way to solve the problem.

@s-martin
Copy link
Collaborator

As we are currently working on a new and shiny version 3 we need to check the implications in https://github.com/MiczFlor/RPi-Jukebox-RFID/tree/future3/spotify as well.

I've tested the development environment for Spotify yesterday and it works 🤞 We are using https://github.com/librespot-org/librespot-java, which is using the Spotify Web-API

How mature is the future3/spotify branch? Can it be merged and released yet?

@Groovylein
Copy link
Collaborator

How mature is the future3/spotify branch? Can it be merged and released yet?

Unfortunately it isn't stable at all. The player management and the whole WebApps are not ready for Spotify yet.

@lenlennart
Copy link
Contributor

Can we get a merge of future3/dev and spotify? Even if not stable and no web-app, i guess you will get a lot of testers :-)

@Micharius
Copy link

Just came to the discussions to find out, why my daughter's Phoniebox stopped working. And now - oh my, what a catastrophe 😥, our Phoniebox is entirely based on Spotify, I made over 50 cards. Hopefully, it will work again in Future, shame on Spotify to just cut the access.

@Simson002
Copy link

Thanks @jnettels for your nice guide, unfortunately I still ran into some issue. As I always find it easier to follow a complete guide, I decided to create one and post it here. So you don't have to jump between different guides/wikis etc.

1. Raspberry Pi OS Bullseye

Use Bullseye, as this ships with Python 3.9, which is needed to build the mopidy-spotify extension. And manually upgrading Python is just a pain in the ass.

2. Add mopidy GPG key

If you don't add the mopidy GPG key, the Phoniebox installation will throw some errors (which actually may get unnoticed) and you'll probably end up with a broken installation.

sudo mkdir -p /etc/apt/keyrings                                               
sudo wget -q -O /etc/apt/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg
sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/bullseye.list
sudo apt update 

Source: https://docs.mopidy.com/en/latest/installation/debian

3. Install Phoniebox

cd; rm buster-install-*; wget https://raw.githubusercontent.com/MiczFlor/RPi-Jukebox-RFID/master/scripts/installscripts/buster-install-default.sh; chmod +x buster-install-default.sh; ./buster-install-default.sh

Source: https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/INSTALL-stretch#one-line-install-command

4. Remove default mopidy installation

sudo apt remove mopidy-spotify

5. Install mopidy-spotify extension

5.1. Install rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Don’t forget to source it (see last line of install output) source "$HOME/.cargo/env"

5.2. Install GStreamer dependencies

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gcc pkg-config git

5.3. Install gst-plugins-spotify

git clone --depth 1 https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
cd gst-plugins-rs
cargo build --package gst-plugin-spotify --release -j1
sudo install -m 644 target/release/libgstspotify.so $(pkg-config --variable=pluginsdir gstreamer-1.0)/

5.4. Verify installation

gst-inspect-1.0 spotify

5.5. Install latest version of mopidy-spotify extension

sudo python3 -m pip install https://github.com/mopidy/mopidy-spotify/archive/master.zip

Source: https://github.com/mopidy/mopidy-spotify#dependencies

Troubleshooting

Check mopidy config/extensions

sudo mopidyctl config

If mopidy-spotify could not be loaded, you'll see this line

WARNING [MainThread] mopidy.config Ignoring config section 'spotify' because no matching extension was found

Display logs for debug

Will display e.g. Spotify authentication issues, so just keep this running while (re)starting mopidy. journalctl -u mopidy -f

Restart mopidy

Make changes from mopidy.conf take effect. systemctl restart mopidy

mopidy.conf

You definitely want to use /etc/mopidy/mopidy.conf file. The one inside your users dir is not being used when mopidy runs as a service (which it does here).

Make sure to have the correct credentials set. You absolutely need username, password, client_id and client_secret. It will look like it is working with client_id and client_secret alone, but won't play any songs (no error in the GUI, just won't work).

Hi, I followed the guide by d4rkd3v1l.
Thanks for the great guide, I'm amazed that I got Spotify to work again :- )

I have one issue: Spotify Tracks don't play until I manually restart the service via
systemctl restart mopidy (as shown in trouble shooting).
I have to give my login credentials (pi+password), then the service restarts; then RFID cards and Iris work perfectly.

What am I missing?
I tried to activate wait for network to boot in raspi-config.
I also tried
sudo systemctl enable mopidy
to make sure mopidy starts as service on boot.

But I'm a little lost here as an total beginner. Help would be great.

@Baggerfahrer
Copy link

Thanks @jnettels for your nice guide, unfortunately I still ran into some issue. As I always find it easier to follow a complete guide, I decided to create one and post it here. So you don't have to jump between different guides/wikis etc.

1. Raspberry Pi OS Bullseye

Use Bullseye, as this ships with Python 3.9, which is needed to build the mopidy-spotify extension. And manually upgrading Python is just a pain in the ass.

2. Add mopidy GPG key

If you don't add the mopidy GPG key, the Phoniebox installation will throw some errors (which actually may get unnoticed) and you'll probably end up with a broken installation.

sudo mkdir -p /etc/apt/keyrings                                               
sudo wget -q -O /etc/apt/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg
sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/bullseye.list
sudo apt update 

Source: https://docs.mopidy.com/en/latest/installation/debian

3. Install Phoniebox

cd; rm buster-install-*; wget https://raw.githubusercontent.com/MiczFlor/RPi-Jukebox-RFID/master/scripts/installscripts/buster-install-default.sh; chmod +x buster-install-default.sh; ./buster-install-default.sh

Source: https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/INSTALL-stretch#one-line-install-command

4. Remove default mopidy installation

sudo apt remove mopidy-spotify

5. Install mopidy-spotify extension

5.1. Install rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Don’t forget to source it (see last line of install output) source "$HOME/.cargo/env"

5.2. Install GStreamer dependencies

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gcc pkg-config git

5.3. Install gst-plugins-spotify

git clone --depth 1 https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
cd gst-plugins-rs
cargo build --package gst-plugin-spotify --release -j1
sudo install -m 644 target/release/libgstspotify.so $(pkg-config --variable=pluginsdir gstreamer-1.0)/

5.4. Verify installation

gst-inspect-1.0 spotify

5.5. Install latest version of mopidy-spotify extension

sudo python3 -m pip install https://github.com/mopidy/mopidy-spotify/archive/master.zip

Source: https://github.com/mopidy/mopidy-spotify#dependencies

Troubleshooting

Check mopidy config/extensions

sudo mopidyctl config

If mopidy-spotify could not be loaded, you'll see this line

WARNING [MainThread] mopidy.config Ignoring config section 'spotify' because no matching extension was found

Display logs for debug

Will display e.g. Spotify authentication issues, so just keep this running while (re)starting mopidy. journalctl -u mopidy -f

Restart mopidy

Make changes from mopidy.conf take effect. systemctl restart mopidy

mopidy.conf

You definitely want to use /etc/mopidy/mopidy.conf file. The one inside your users dir is not being used when mopidy runs as a service (which it does here).

Make sure to have the correct credentials set. You absolutely need username, password, client_id and client_secret. It will look like it is working with client_id and client_secret alone, but won't play any songs (no error in the GUI, just won't work).

i as well want to say many thanks for this great guide!! it perfectly works

@Simson002
Copy link

I restarted the whole process from scratch; I don't know what I did differently this time; but now it worked perfectly. Thanks for the guide.

@DonPavlov
Copy link

Additional info for anyone trying to build it on raspbian 32 bit legacy, but with a pi4 64 bit:
You need to do a custom installation of Rust and, when asked for the default host triple, enter

arm-unknown-linux-gnueabihf

(This is for Raspberry Pi 4. It might be different for other Pi versions)

Before that i was even unable to run cargo --version or rustc --version

@pabera
Copy link
Collaborator

pabera commented Nov 17, 2023

I will take some time later today or on the weekend on the status of future3 with regards to Spotify or other streaming services. There are technical boundaries and legal questions that need to be considered.

@AlvinSchiller
Copy link
Collaborator

AlvinSchiller commented Nov 17, 2023

Additional info for anyone trying to build it on raspbian 32 bit legacy, but with a pi4 64 bit: You need to do a custom installation of Rust and, when asked for the default host triple, enter

arm-unknown-linux-gnueabihf

(This is for Raspberry Pi 4. It might be different for other Pi versions)

Before that i was even unable to run cargo --version or rustc --version

@DonPavlov
Does setting the kernel also to 32-bit maybe make a difference?
/boot/config.txt -> arm_64bit=0

@DonPavlov
Copy link

DonPavlov commented Nov 17, 2023

@DonPavlov Does setting the kernel also to 32-bit maybe make a difference? /boot/config.txt -> arm_64bit=0

So after removing rust completely setting the boot/config.txt to 32 bit, and rebooting.
I get a different profile even: armv7-unknown-linux-gnueabihf

after installation finishes everything works as expected: it is possible to just run cargo and rustc
I assume both host profiles are correct in a way.

@kingosticks
Copy link

I will take some time later today or on the weekend on the status of future3 with regards to Spotify or other streaming services. There are technical boundaries and legal questions that need to be considered.

If you have issues/questions regarding the use of Mopidy (or librespot) in the future release than feel free to raise them at the usual places (or privately if necessary). There are now some automated gst-plugin-spotify builds, I don't think there are any major blockers to having it all installable through apt again. This thread has been useful in demonstrating some rough edges that I wasn't hitting.

@rmk-ch
Copy link

rmk-ch commented Nov 17, 2023

Thanks @jnettels for your nice guide, unfortunately I still ran into some issue. As I always find it easier to follow a complete guide, I decided to create one and post it here. So you don't have to jump between different guides/wikis etc.

1. Raspberry Pi OS Bullseye

Use Bullseye, as this ships with Python 3.9, which is needed to build the mopidy-spotify extension. And manually upgrading Python is just a pain in the ass.

2. Add mopidy GPG key

If you don't add the mopidy GPG key, the Phoniebox installation will throw some errors (which actually may get unnoticed) and you'll probably end up with a broken installation.

sudo mkdir -p /etc/apt/keyrings                                               
sudo wget -q -O /etc/apt/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg
sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/bullseye.list
sudo apt update 

Source: https://docs.mopidy.com/en/latest/installation/debian

3. Install Phoniebox

cd; rm buster-install-*; wget https://raw.githubusercontent.com/MiczFlor/RPi-Jukebox-RFID/master/scripts/installscripts/buster-install-default.sh; chmod +x buster-install-default.sh; ./buster-install-default.sh

Source: https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/INSTALL-stretch#one-line-install-command

4. Remove default mopidy installation

sudo apt remove mopidy-spotify

5. Install mopidy-spotify extension

5.1. Install rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Don’t forget to source it (see last line of install output) source "$HOME/.cargo/env"

5.2. Install GStreamer dependencies

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gcc pkg-config git

5.3. Install gst-plugins-spotify

git clone --depth 1 https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
cd gst-plugins-rs
cargo build --package gst-plugin-spotify --release -j1
sudo install -m 644 target/release/libgstspotify.so $(pkg-config --variable=pluginsdir gstreamer-1.0)/

5.4. Verify installation

gst-inspect-1.0 spotify

5.5. Install latest version of mopidy-spotify extension

sudo python3 -m pip install https://github.com/mopidy/mopidy-spotify/archive/master.zip

Source: https://github.com/mopidy/mopidy-spotify#dependencies

Troubleshooting

Check mopidy config/extensions

sudo mopidyctl config

If mopidy-spotify could not be loaded, you'll see this line

WARNING [MainThread] mopidy.config Ignoring config section 'spotify' because no matching extension was found

Display logs for debug

Will display e.g. Spotify authentication issues, so just keep this running while (re)starting mopidy. journalctl -u mopidy -f

Restart mopidy

Make changes from mopidy.conf take effect. systemctl restart mopidy

mopidy.conf

You definitely want to use /etc/mopidy/mopidy.conf file. The one inside your users dir is not being used when mopidy runs as a service (which it does here).

Make sure to have the correct credentials set. You absolutely need username, password, client_id and client_secret. It will look like it is working with client_id and client_secret alone, but won't play any songs (no error in the GUI, just won't work).

Thanks a lot for the great guide!

I have one addition that took me quite a while to solve: I always got the "error: command failed: 'cargo': No such file or directory (os error 2)" when calling the cargo build command (on Raspi 4 which is a 64 bit ARM arch).
I had installed Raspi PI OS Legacy Lite (Bullseye, 32 bit!) and needed to customize the Rust installation when runningcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh. The installer selects 'stable-aarch64-unknown-linux-gnu' per default -- but the OS is on 32 bits! Therefore, I needed to ustomize installation and set the "triple" to 'armv7-unknown-linux-gnueabihf'.

Now, spotify works again - finally!
Thanks again for all your efforts!

@AlvinSchiller
Copy link
Collaborator

I have one addition that took me quite a while to solve: I always got the "error: command failed: 'cargo': No such file or directory (os error 2)" when calling the cargo build command (on Raspi 4 which is a 64 bit ARM arch).
I had installed Raspi PI OS Legacy Lite (Bullseye, 32 bit!) and needed to customize the Rust installation when runningcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh. The installer selects 'stable-aarch64-unknown-linux-gnu' per default -- but the OS is on 32 bits! Therefore, I needed to ustomize installation and set the "triple" to 'armv7-unknown-linux-gnueabihf'.

#1815 (comment) ;)

@s-martin
Copy link
Collaborator

For future3 PR #2164 is laying the ground work for Spotify.

Help is greatly appreciated.

1 similar comment
@s-martin
Copy link
Collaborator

For future3 PR #2164 is laying the ground work for Spotify.

Help is greatly appreciated.

@s-martin s-martin linked a pull request Dec 21, 2023 that will close this issue
@jnettels
Copy link

jnettels commented Feb 4, 2024

Is anyone else getting errors when trying to play Spotify playlists from rfid tags or the phoniebox UI? These playlists work fine when started from the iris UI. Spotify URIs to albums work fine everywhere.

[SpotifyBackend-6] mopidy_spotify.lookup Failed to lookup Spotify playlist 'spotify:playlist:4xcdTOFwLdZb8G4c5W2h5F': Invalid playlist response

This seems to be related:
mopidy/mopidy-spotify#373

I updated to the latest mopidy-spotify version with the following command, but it did not solve the issue:

sudo python3 -m pip install https://github.com/mopidy/mopidy-spotify/archive/main.zip

@s-martin
Copy link
Collaborator

s-martin commented Feb 7, 2024

sudo python3 -m pip install https://github.com/mopidy/mopidy-spotify/archive/main.zip

You need also the --upgrade flag

what’s the response of this command?

@jnettels
Copy link

jnettels commented Feb 10, 2024

You need also the --upgrade flag

what’s the response of this command?

Thanks for answering to my question. However, --upgrade does not seem to change anything.

pi@musicpi:~ $ sudo python3 -m pip install https://github.com/mopidy/mopidy-spotify/archive/main.zip --upgrade
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting https://github.com/mopidy/mopidy-spotify/archive/main.zip
  Using cached https://github.com/mopidy/mopidy-spotify/archive/main.zip
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: requests>=2.20.0 in /usr/local/lib/python3.9/dist-packages (from Mopidy-Spotify==4.1.1) (2.31.0)
Requirement already satisfied: Mopidy>=3.4.0 in /usr/local/lib/python3.9/dist-packages (from Mopidy-Spotify==4.1.1) (3.4.1)
Requirement already satisfied: setuptools in /usr/local/lib/python3.9/dist-packages (from Mopidy-Spotify==4.1.1) (68.0.0)
Requirement already satisfied: Pykka>=2.0.1 in /usr/local/lib/python3.9/dist-packages (from Mopidy-Spotify==4.1.1) (3.1.1)
Requirement already satisfied: tornado>=4.4 in /usr/local/lib/python3.9/dist-packages (from Mopidy>=3.4.0->Mopidy-Spotify==4.1.1) (6.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests>=2.20.0->Mopidy-Spotify==4.1.1) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests>=2.20.0->Mopidy-Spotify==4.1.1) (2.0.3)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.9/dist-packages (from requests>=2.20.0->Mopidy-Spotify==4.1.1) (3.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests>=2.20.0->Mopidy-Spotify==4.1.1) (2023.5.7)

Afterwards I rebooted by raspberry pi, and then tail /var/log/syslog -n 200 still reveals errors like this when attempting to play playlists:

[SpotifyBackend-6] mopidy_spotify.lookup Failed to lookup Spotify playlist 'spotify:playlist:4xcdTOFwLdZb8G4c5W2h5F': Invalid playlist response

Any other hints?

Edit:
So.... I actually was not on the current state of the branch "main" in my local install.
I tracked down the file web.py and manually performed the change done in this commit:
mopidy/mopidy-spotify@2007771

Now playlists work again! I am confused, but happy

@kingosticks
Copy link

I think pip wants install options before the path/name.

sudo python3 -m pip install --upgrade https://github.com/mopidy/mopidy-spotify/archive/main.zip

@rlndwgnr
Copy link

rlndwgnr commented Feb 26, 2024

Thanks @jnettels for your nice guide, unfortunately I still ran into some issue. As I always find it easier to follow a complete guide, I decided to create one and post it here. So you don't have to jump between different guides/wikis etc.

1. Raspberry Pi OS Bullseye

Use Bullseye, as this ships with Python 3.9, which is needed to build the mopidy-spotify extension. And manually upgrading Python is just a pain in the ass.

2. Add mopidy GPG key

If you don't add the mopidy GPG key, the Phoniebox installation will throw some errors (which actually may get unnoticed) and you'll probably end up with a broken installation.

sudo mkdir -p /etc/apt/keyrings                                               
sudo wget -q -O /etc/apt/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg
sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/bullseye.list
sudo apt update 

Source: https://docs.mopidy.com/en/latest/installation/debian

3. Install Phoniebox

cd; rm buster-install-*; wget https://raw.githubusercontent.com/MiczFlor/RPi-Jukebox-RFID/master/scripts/installscripts/buster-install-default.sh; chmod +x buster-install-default.sh; ./buster-install-default.sh

Source: https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/INSTALL

4. Remove default mopidy installation

sudo apt remove mopidy-spotify

5. Install mopidy-spotify extension

5.1. Install rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Don’t forget to source it (see last line of install output) source "$HOME/.cargo/env"

5.2. Install GStreamer dependencies

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gcc pkg-config git

5.3. Install gst-plugins-spotify

git clone --depth 1 https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
cd gst-plugins-rs
cargo build --package gst-plugin-spotify --release -j1
sudo install -m 644 target/release/libgstspotify.so $(pkg-config --variable=pluginsdir gstreamer-1.0)/

5.4. Verify installation

gst-inspect-1.0 spotify

5.5. Install latest version of mopidy-spotify extension

sudo python3 -m pip install https://github.com/mopidy/mopidy-spotify/archive/master.zip

Source: https://github.com/mopidy/mopidy-spotify#dependencies

Troubleshooting

Check mopidy config/extensions

sudo mopidyctl config

If mopidy-spotify could not be loaded, you'll see this line

WARNING [MainThread] mopidy.config Ignoring config section 'spotify' because no matching extension was found

Display logs for debug

Will display e.g. Spotify authentication issues, so just keep this running while (re)starting mopidy. journalctl -u mopidy -f

Restart mopidy

Make changes from mopidy.conf take effect. systemctl restart mopidy

mopidy.conf

You definitely want to use /etc/mopidy/mopidy.conf file. The one inside your users dir is not being used when mopidy runs as a service (which it does here).

Make sure to have the correct credentials set. You absolutely need username, password, client_id and client_secret. It will look like it is working with client_id and client_secret alone, but won't play any songs (no error in the GUI, just won't work).

Hi,
i tried this, but could not install gst-plugins-spotify.

cargo build --package gst-plugin-spotify --release -j1

gives me this error:


 Updating crates.io index
    Skipping git submodule `https://github.com/gtk-rs/gir` due to update strategy in .gitmodules
    Skipping git submodule `https://github.com/gtk-rs/gir-files` due to update strategy in .gitmodules
    Skipping git submodule `https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git` due to update strategy in .gitmodules
    Updating git repository `https://github.com/gtk-rs/gtk-rs-core`
warning: spurious network error (3 tries remaining): failed to connect to github.com: No route to host; class=Os (2)
warning: spurious network error (2 tries remaining): failed to connect to github.com: No route to host; class=Os (2)
warning: spurious network error (1 tries remaining): failed to connect to github.com: No route to host; class=Os (2)

error: failed to get `gio` as a dependency of package `gst-plugin-threadshare v0.13.0-alpha.1 (/home/pi/gst-plugins-rs/generic/threadshare)`

Caused by:
  failed to load source for dependency `gio`

Caused by:
  Unable to update https://github.com/gtk-rs/gtk-rs-core?branch=master#90fc2033

Caused by:
  failed to fetch into: /home/pi/.cargo/git/db/gtk-rs-core-7be42ca38bd6361c

Caused by:
  failed to connect to github.com: No route to host; class=Os (2)


a google search told me it could be related to using a proxy, which i don't do, so I don't know what to do with it.

Can anybody help me with this?

@kingosticks
Copy link

kingosticks commented Feb 27, 2024

I don't know what your problem is, it seems your pi has network issues. There was a time I'd have suggested your power supply might not be good enough but I would hope in 2024 everyone has got that sorted.

In any case, you can grab gst-plugin-spotify from https://github.com/kingosticks/gst-plugins-rs-build/releases/latest

@kingosticks
Copy link

kingosticks commented Mar 1, 2024

There is (finally) a new pre-release version of Mopidy-Spotify. It's got some fixes due to Spotify silently breaking their Web API and new install instructions which suggest using the deb packages at https://github.com/kingosticks/gst-plugins-rs-build/releases/latest

The version of spotifyaudiosrc within the package itself is not new, so there's no need to upgrade to it if you already have a working version.

@s-martin
Copy link
Collaborator

s-martin commented Apr 4, 2024

The future PR #2315 will incorporate the necessary changes for legacy V2, so no manual changes will be necessary anymore.

@AlvinSchiller
Copy link
Collaborator

AlvinSchiller commented Apr 5, 2024

If someone want to try out the changes and give feedback, that would be really helpfull before we merge it.
Please post feedback in the PR #2315

Best install on another SDCard with Bullseye and use this command for the installation (no other changes needed):

cd; rm install-jukebox.sh; wget https://raw.githubusercontent.com/AlvinSchiller/RPi-Jukebox-RFID/feature/mopidy-spotify-fixes/scripts/installscripts/install-jukebox.sh; chmod +x install-jukebox.sh; GIT_URL=https://github.com/AlvinSchiller/RPi-Jukebox-RFID.git GIT_BRANCH=feature/mopidy-spotify-fixes ./install-jukebox.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.