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 playlists not playing #1011

Closed
szaiser opened this issue Jun 12, 2020 · 7 comments
Closed

🐛 | Spotify playlists not playing #1011

szaiser opened this issue Jun 12, 2020 · 7 comments

Comments

@szaiser
Copy link

szaiser commented Jun 12, 2020

EDIT: Replaced the mopidy log by a more concise but still meaningful one, which I obtained after a fresh restart.

Bug

While an RFID card registered to play stream URL spotify:track:################## or spotify:album:############## works like a charm, spotify:user:<username>:###############does not work. Even the sample url in the doc SPOTIFY-INTEGRATION.md#how-to-use-spotify does not work. This could be connected to Mopidy-spotiffy issue 182.

What I did

I installed via

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 

Then I swept an RFID card and registered it by giving the stream URL multiple playlist stream urls for testing. One of them spotify:user:spotify:playlist:37i9dQZF1DX6J5NfMJS675, which as far as I can tell is a valid spotify url. For each URL which I tried, I selected type Spotify, created a new folder and I swept the RFID card after registering.

What happened

Nothing.

I expected this to happen

I expect the first track of the spotify playlist to play, after I sweep the card.

Further information that might help

pi@raspberrypi:~ $ journalctl -u mopidy
-- Logs begin at Thu 2019-02-14 11:11:59 CET, end at Tue 2020-06-16 22:44:00 CEST. --
Jun 16 22:43:39 raspberrypi systemd[1]: Starting Mopidy music server...
Jun 16 22:43:39 raspberrypi systemd[1]: Started Mopidy music server.
Jun 16 22:43:45 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.__main__ Starting Mopidy 3.0.2
Jun 16 22:43:45 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.config Loading config from builtin defaults
Jun 16 22:43:45 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.config Loading config from file:///usr/share/mopidy/conf.d/mopidy.conf
Jun 16 22:43:45 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.config Loading config from file:///usr/share/mopidy/conf.d/mopidy-local.conf
Jun 16 22:43:45 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.config Loading config from file:///etc/mopidy/mopidy.conf
Jun 16 22:43:45 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.config Loading config from command line options
Jun 16 22:43:45 raspberrypi mopidy[491]: ERROR    [MainThread] mopidy.internal.log Loading logging config '/etc/mopidy/logging.conf' failed. 'formatters'
Jun 16 22:43:46 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.__main__ Enabled extensions: iris, file, spotify, mpd, m3u, local, http, stream, softwaremixer
Jun 16 22:43:46 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.__main__ Disabled extensions: none
Jun 16 22:43:48 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.commands Starting Mopidy mixer: SoftwareMixer
Jun 16 22:43:48 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.commands Mixer volume set to 30
Jun 16 22:43:48 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.commands Starting Mopidy audio
Jun 16 22:43:48 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.commands Starting Mopidy backends: FileBackend, M3UBackend, StreamBackend, SpotifyBackend, LocalBackend
Jun 16 22:43:48 raspberrypi mopidy[491]: INFO     [Audio-2] mopidy.audio.actor Audio output set to "alsasink"
Jun 16 22:43:49 raspberrypi mopidy[491]: INFO     [SpotifyEventLoop] mopidy_spotify.backend Logged in to Spotify in online mode
Jun 16 22:43:49 raspberrypi mopidy[491]: ERROR    [SpotifyBackend-6] mopidy_spotify.web Authorization failed, not attempting Spotify API request. Please get new credentials from https://www.mopidy.com/authenticate and/or restart Mopidy to resolve this problem.
Jun 16 22:43:49 raspberrypi mopidy[491]: ERROR    [SpotifyBackend-6] mopidy_spotify.web OAuth token refresh failed: invalid_client Client not known.
Jun 16 22:43:49 raspberrypi mopidy[491]: ERROR    [SpotifyBackend-6] mopidy_spotify.web Failed to load Spotify user profile
Jun 16 22:43:49 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.commands Starting Mopidy core
Jun 16 22:43:49 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.commands Starting Mopidy frontends: IrisFrontend, HttpFrontend, MpdFrontend
Jun 16 22:43:49 raspberrypi mopidy[491]: INFO     [IrisFrontend-11] mopidy_iris.core Starting Iris 3.49.0
Jun 16 22:43:49 raspberrypi mopidy[491]: INFO     [HttpFrontend-13] mopidy.http.actor HTTP server running at [::ffff:0.0.0.0]:6680
Jun 16 22:43:49 raspberrypi mopidy[491]: INFO     [MainThread] mopidy_mpd.actor MPD server running at [::ffff:0.0.0.0]:6600
Jun 16 22:43:49 raspberrypi mopidy[491]: INFO     [MainThread] mopidy.commands Starting GLib mainloop
Jun 16 22:43:59 raspberrypi mopidy[491]: INFO     [MpdSession-15] mopidy_mpd.session New MPD connection from [::ffff:127.0.0.1]:60148
Jun 16 22:43:59 raspberrypi mopidy[491]: INFO     [MpdSession-16] mopidy_mpd.session New MPD connection from [::ffff:127.0.0.1]:60152
Jun 16 22:43:59 raspberrypi mopidy[491]: INFO     [MpdSession-17] mopidy_mpd.session New MPD connection from [::ffff:127.0.0.1]:60156
Jun 16 22:43:59 raspberrypi mopidy[491]: INFO     [MpdSession-18] mopidy_mpd.session New MPD connection from [::ffff:127.0.0.1]:60160
Jun 16 22:43:59 raspberrypi mopidy[491]: INFO     [SpotifyBackend-6] mopidy_spotify.lookup Failed to lookup 'spotify:user:spotify:playlist:37i9dQZF1DX6J5NfMJS675': Playlist Web API lookup failed
Jun 16 22:43:59 raspberrypi mopidy[491]: INFO     [MpdSession-19] mopidy_mpd.session New MPD connection from [::ffff:127.0.0.1]:60164
Jun 16 22:43:59 raspberrypi mopidy[491]: INFO     [MpdSession-20] mopidy_mpd.session New MPD connection from [::ffff:127.0.0.1]:60168
Jun 16 22:43:59 raspberrypi mopidy[491]: INFO     [MpdSession-21] mopidy_mpd.session New MPD connection from [::ffff:127.0.0.1]:60172

Software

Base image and version

pi@raspberrypi:~/phoniebox_logs $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Branch / Release

master

Installscript

Hardware

RaspberryPi version

Raspberry Pi 3 Model B Rev 1.2

RFID Reader

KKMoon HID 413d:2107
--> had to follow #551

Soundcard

idVendor 0x0d8c C-Media Electronics, Inc.
idProduct 0x013c CM108 Audio Controller

Other notable hardware

OLED display, installed SW therefore is:

cd; rm o4p_installer.sh; wget https://raw.githubusercontent.com/splitti/oled_phoniebox/master/scripts/install/o4p_installer.sh; chmod +x o4p_installer.sh; ./o4p_installer.sh 
@s-martin
Copy link
Collaborator

s-martin commented Jun 14, 2020

Are you sure the URI is correct? Because you have the following error: Jun 12 21:47:04 raspberrypi mopidy[487]: ValueError: Could not parse 'spotify:user:spotify:playlist:37i9dQZF1DWUVpAXiEPK8P' as a Spotify URI

Edit I have no experience with Spotify, but the second occurrence of spotify seems strange to me and not in accordance to https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/5b2cf742573489db27b117bf9588f2a54d750365/docs/SPOTIFY-INTEGRATION.md#how-to-use-spotify

@szaiser
Copy link
Author

szaiser commented Jun 16, 2020

  1. I am reasonably sure that spotify:user:spotify:playlist:37i9dQZF1DWUVpAXiEPK8P is a valid URI. When I copy it into the search field of https://open.spotify.com/search, the playlist is found and correctly opened. Spotify is also satisfied with spotify:playlist:37i9dQZF1DWUVpAXiEPK8P, which points to the same playlist.
    Btw: The second spotify in the URI is the username of the playlist owner (who is "spotify"). I think it is in accordance with the Link you posted. If I got you wrong there, please let me know.
  2. Is there anybody out there, who successfully uses a current RPi-Jukebox version with spotify playlists in the way I am trying to? To me this seems quite hopeless at this stage, and it would be great to learn otherwise.

@s-martin
Copy link
Collaborator

Did you try the shorter version of the URI, if Spotify is also satisfied with that format?

@szaiser
Copy link
Author

szaiser commented Jun 20, 2020

Yes, I tried every URI format which I could come up with. Whenever it referred to a Spotify playlist, then Mopidy complains, that it can not find the playlist.

@s-martin
Copy link
Collaborator

@kingosticks, sorry to bother you again, but maybe you have some info, what mopidy requires here?

@kingosticks
Copy link

That form is old and Spotify are supposed to be moving towards the 'spotify:playlist:blahblahblah' format so I'm a bit surprised they are still giving out the old format. That being said, the old format should still work and the code still handles it. The (updated?) error log in the original post shows the first error is the web API authorization failed. You must fix that first.

@szaiser szaiser closed this as completed Jun 23, 2020
@szaiser szaiser reopened this Jun 23, 2020
@szaiser
Copy link
Author

szaiser commented Jun 23, 2020

Thanks everybody for the help, in particular kingosticks. In hindsight it seems obvious, but the issue indeed was the wep API authorization error. I simply used the wrong config file (I used ~/.config/mopidy/mopidy.conf, see https://docs.mopidy.com/en/latest/running/service/#configuration).

The reason why I felt safe to ignore this error is, that both albums and tracks played correctly and hence I assumed, this is just wrong startup behavior. I still do not understand, what in this respect is the difference to playlists.

@szaiser szaiser closed this as completed Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants