RPi-Jukebox-RFID: đ | Spotify does not work anymore
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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 145 (9 by maintainers)
Thanks for reporting this.
Looks like this is a real showstopper, we need to look into that.
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-spotifyextension. 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.
Source: https://docs.mopidy.com/en/latest/installation/debian
3. Install Phoniebox
Source: https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/INSTALL
4. Remove default mopidy installation
sudo apt remove mopidy-spotify5. Install mopidy-spotify extension
5.1. Install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shDonâ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 git5.3. Install gst-plugins-spotify
5.4. Verify installation
gst-inspect-1.0 spotify5.5. Install latest version of mopidy-spotify extension
sudo python3 -m pip install https://github.com/mopidy/mopidy-spotify/archive/master.zipSource: https://github.com/mopidy/mopidy-spotify#dependencies
Troubleshooting
Check mopidy config/extensions
sudo mopidyctl configIf
mopidy-spotifycould not be loaded, youâll see this lineDisplay logs for debug
Will display e.g. Spotify authentication issues, so just keep this running while (re)starting mopidy.
journalctl -u mopidy -fRestart mopidy
Make changes from
mopidy.conftake effect.systemctl restart mopidymopidy.conf
You definitely want to use
/etc/mopidy/mopidy.conffile. 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_idandclient_secret. It will look like it is working withclient_idandclient_secretalone, but wonât play any songs (no error in the GUI, just wonât work).Hey all,
while this is not yet a perfect solution I got spotify working again on phoniebox.
The solution is based on the thread referenced by @s-martin. Major thanks goes to all the contributors in the https://github.com/mopidy/mopidy-spotify/issues/110 thread.
be advised: The solution requires some minor code changes and compilation of one software module , so you should have some basic Linux knowledge to apply the workaround.
Iâve applied the solution on a Raspberry Pi 4 and slight adjustments might be necessary on older PIs due to the different ARM-architecture.
What did I do to get the solution working:
A restart may be needed to get the plugin working.
gst-launch-1.0 spotifyaudiosrc username=<Username> password=<Password> track=spotify:track:3i3P1mGpV9eRlfKccjDjwi ! oggdemux ! vorbisdec ! audioconvert ! autoaudiosinkYou need your regular credentials here not any API or application keys.
vi ./mopidy_spotify/backend.pyAlmost at the end of the file you will find the following code:
I simply replaced the username and password logic with hardcoded values:
Remove the exising installation of mopidy-spotify which is no longer working
sudo apt-get remove mopidy-spotifyCompile and install the new mopidy-spotify
You may need to install pip to execute the compile command.
This can be done via apt:
sudo apt-get install python3-pipThatâs it. After applying all this changes I was able to use the spotify feature of the phoniebox again.
Even though there are some limitations right now which may especially affect those of you using phoniebox for Audiobooks.
Currently the implementation only supports Play and Pause you cannot fast forward within a track and you cannot resume a track where you stopped. This hopefully comes at a later stage.
My little boy is very happy now as the PhonieBox is back in actionâŚ
I appreciate any feedback if this was helpful and if the approach worked for you as well.
Wow, thank you very much for that workaround and sharing it here with lots of deperate parents, who had sad kids from the day on their boxes did not work anymore like they used to do.
When I followed your walkthrough, I noticed, that the following section was not in the code anymore:
I still tried to set it up following the other steps and also updated the mopidy.conf at â/etc/mopidy/mopidy.confâ via new authentication details. It did not work out.
I noticed, that the developer kingosticks has just worked on his project, you are pulling the source code from, and exactly that crucial piece of code changed. With that change, you cannot hardcode the username and password as described in your guide by pulling the newest branch commit.
So in order to follow the procedure of you, which results in a working setup, you need to change step 4 from :
to
This will pull the commit that was the leading one, when the workaround guide was published. With that special commit everything worked like a charm. So thank you very much!!!
Kind regars Eric
Hi guys, I just wanted to say a couple of things.
It sucks Spotify have turned libspotify off and theyâve no interest in supporting projects like this. I assume some of the comments on the Spotify dev forum are from (rightly) unhappy Phoniebox users and although I donât think Spotify will reverse this move, itâs still good to demonstrate there is demand for a real libspotify replacement. So thanks to everyone who posted.
Secondly, I am working on a fixed version of Mopidy-Spotify but I donât have much free time so itâs sporadic development. And itâs a fair bit of work. But progress is being made and I hope to get it working again soon. I canât make any specific timescale promises. I would understand if Phoniebox was to move to another software solution, itâs important to find the best fit for your project and get things working for users. But I would hope you avoid projects that circumvent Spotifyâs Premium subscription requirement as I think thatâll just end in everyone losing access. Alternative services like Tidal are an option but they have even worse developer support (itâs non-existent). No good options out there, sadly.
I also want to mention it was my colleague that randomly reminded me of Phoniebox when suggesting it as a cool project for me, now Iâm a father. Hopefully this explains why dev is slow but at least Iâve got a vested interest now!
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
It has been silent in this thread for a while. I just want to encourage anyone who is missing the spotify integration to give the manual installation a try, it works for me:
sudo apt-get remove mopidy-spotifygst-plugins-spotifyon your raspberry pi: https://github.com/mopidy/mopidy-spotify#dependenciessudo apt-get updatebefore running theapt installcommandcargo build --package gst-plugin-spotify --release -j1, as was recommended in disussions heremopidy-spotifywithsudo python3 -m pip install https://github.com/mopidy/mopidy-spotify/archive/main.zipNow spotify integration seems to work fine on my raspberry pi 3b with raspbian bullseye!
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 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 https://github.com/MiczFlor/RPi-Jukebox-RFID/pull/2315
Best install on another SDCard with Bullseye and use this command for the installation (no other changes needed):
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.
This is an excellent hint which saved me hours. I believe I ran into this issue already several times because this was not clear to me. Itâs working now. Thanks a lot!
@The-Judge Thanks for your effort! Spotify stopped working for me a while back. While it might have been an option to reauthenticate via the Iris frontend, I didnât think about that and used your script to setup a fresh install! I ran into some small issues but nothing related to spotify.
(I think I ran the setup kind of parallel because connecting to the screen session did not work for me, so I started the stuff manually đ, gpio not stable --> had to enable the GPIO base service, files not playing --> rescan of library via GUI, RFID shortcuts had spotify link in there before, now it looks like it has to be the path to the folder, display did not work --> cable disconnected đ¤Śđťââď¸, ⌠).
But: I didnât have to do anything special to get spotify to work! So, thanks a lot for that!
Do you see any chance to support the implementation in V3? I would like to update because stability is not quite that good with V2 for me. I just made a Reboot RFID card because sometimes stuff just stops working and you can only solve it by restarting. Would be great if V3 had spotify, that would be enough for me to try it out! đ
283 cards and 2 Phonieboxes deep into this project ⌠It would be REALLY great if a working release, at least with RFID card reader + working Spotify support, would be released. Even as pre-pre-pre-alpha without any working Web-Interface or anything would be highly appreciated. RFID + Spotify are the only features we use anyways.
Any roadmap there?
Hi phonieboxers.
I would like to share two solutions/workarounds to satisfy our children until the ultimate Phoniebox release. Neither requires coding or changes to the Phoniebox code.
journalctl -u mopidy)Hope this helps you as well! Best, rmk
Iâll stick with spotify and converted all my stuff to mp3. Slightly more effort but it works even offline.
https://www.heise.de/news/Abgeschaltet-libspotify-Aus-legt-selbstgebastelte-Musikboxen-fuer-Kinder-lahm-7124231.html
nice!! Iâm on a just python script, back to basics, I started yesterday, reading the usb rfid number works, have less time but will be ready hopefully soon
This was quite shocking news so I thought about alternatives out of desperation: I have an LMS SqueezeboxServer server on another Raspberry Pi (with working Spotify support), so I installed piCorePlayer on my Phoniebox to use it as an LMS Squeezebox Client, and wrote a script to use RFID tags for starting Spotify playlists.
Of course, this is not supposed to be a replacement for Phoniebox, just a quick and dirty fix to get Spotify working again quickly. I hope you find a better solution soon! Until then, if someone is desperate enough to try it out, the script and instructions are here https://github.com/maahn/piCorePhonie
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.
Holy shite, yes please prioritized this, I think this breaks every other phoniebox out there (including mine đ)
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.
So after removing rust completely setting the boot/config.txt to 32 bit, and rebooting. I get a different profile even:
armv7-unknown-linux-gnueabihfafter 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.
@DonPavlov Does setting the kernel also to 32-bit maybe make a difference? /boot/config.txt -> arm_64bit=0
i as well want to say many thanks for this great guide!! it perfectly works
Those credentials wonât work (and they never have). Get credentials from https://mopidy.com/ext/spotify/ or https://www.mopidy.com/authenticate (as per the logged error message)
If you still having problems with GPIO and RFID reader, I suggest to open a new issue for that. Otherwise this issue gets cluttered with different problems.
@The-Judge : It works perfectly fine! đ
I just had the issue with the permission at the first place but then everything ran through! I think this is the new âone_line-installerâ of Phoniebox with the Spotify fix everybody was waiting for!
I just added the GPIO/OLED controls and the ON/OFF Shim, copied back my old audio folders and there it is - back in business! đ
Thank you so much!!!
hmm⌠Following @d4rkd3v1l method above, on a raspberry PI 4 I had to alter the 5.1 step. Installed Rust was for 64 arm linux version, and I had a 32 PI. After installing the correct version of rust everything else worked.
Starting playback (local files worked). Adding a Spotify track URI worked ⌠for a day. Today nothing from Spotify seems to work any more. Iris web client never worked actually for playback - it just says âMopidy: Failed to add some tracksâ when pressing play from it. No error messages in mopidy logs.
FYI itâs back online.
Everything at https://gitlab.freedesktop.org is down, supposedly for maintenance. Even if you had a copy of gst-plugin-rs, youâd be unable to fetch the dependencies that are also hosted there e.g. https://gitlab.freedesktop.org/gstreamer/gstreamer-rs. Hopefully itâll all be back tomorrow and Iâll finally get some RPi-compatable gst-plugin-spotify binaries uploaded this week, itâs long overdue.
Works like a charme! Many thanks to @MrStrategy !!!
I just followed the steps, used my âUSERNAMEâ(not Email!) and âPasswordâ. I just was able to use the existing Phoniebox installation with all the associated cards, with no issues and no degradation of functions!
The only hint⌠Iâd like to recommend to be prepared while using part 2:
The test went ok, but with FULL volume and basically caused injuries while neighbors were falling out of their bed! đ
Cheers!
A hash in the config file denotes a comment, i.e the text following the hash character is ignored. If I remember correctly, you can avoid that by surrounding your value in quotes:
Thereâs no reason this would be different between the old (broken) version of Mopidy-Spotify and this hacked-up workaround version.
For what itâs worth, Iâm planning to do some more work on the fixed version this week. Not sure if itâll be release ready but I want to sort out seeking and the loading latency.
Hi Guys, just wanted to catch up on the last activities since June. What is the actual status? Is there a workaround in place for the libspotify issue?
Many thanks!
I can recommend DownOnSpot for this purpose. It is based on librespot and requires a nightly Rust toolchain for building, but overall the process is fairly straightforward. They claim it will also work with a free Spotify account, I did not verify this, but it definitely worked well with my premium account. Actually now I like this solution more than the streaming version, it is more reliable and Spotify can no longer mess with my custom playlists (which they did a couple of times in the past). Not sure if its covered by their TOS but as long as you have a premium account, it could be argued this falls under fair use.
In our new version 3 we use a different implementation of the Spotify API, but the branch future3/spotify is not ready for production yet, see https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/1815#issuecomment-1132774819
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! đ
See https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/1815#issuecomment-1130384442
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