Spotify stopped working

Hello, I have been using the musicbox with great pleasure for a while. Last months, I cannot get access to spotify any more. I only use radio streams, which work, and spotify.

I re-configured the spotify credentials.

When I search for something, the system keeps waiting for ???

Any clue, or anything I could try?

I now read (https://github.com/pimusicbox/pimusicbox/releases/tag/v0.7.0RC7), I believe I made that image before, that Spotify playlists stopped working. Could a fresh image solve things?

Thanks, Quintijn

Quintijn,

There’s no release of Pi Musicbox available that supports Spotify playlists unless you switch to using it with the Mopidy-Iris webclient rather than the default Mopidy-Musicbox-Webclient. However, Spotify search functionality should be working in v0.7RC7.

I’m going to have to stop kidding myself that Pi Musicbox is still maintained any more and so if you are still have problems with v0.7RC7 I think I would suggest either manually setting up your own Mopidy-based system on the latest version of Raspbian, or perhaps moving to one of the alternate platforms like Volumio or RuneAudio.

Thanks kingosticks, I will delve into it again. Thanks anyway for your honest answer and your kind support some time ago when I set up the musicbox.

Quintijn

Searching on, I find mopidy on https://docs.mopidy.com/en/v0.9.0/installation/raspberrypi/, which seems quite old, 2012. Will this still be maintained? And it should work not work with Raspian, and hardware floating point should be disabled. How correct is this information??

Are the other packages more recent, AND, do they support spotify? Before I jump into burning images, it would be good to know a little bit more about these. RuneAudio seems to be better documented than Volumio, but it is not very clear what these can do and cannot do.

You’ve dug up an old one there! Please take a look at the latest documentation at https://docs.mopidy.com/en/latest/installation/raspberrypi/

The latest version of Mopidy-Spotify is fully working except for the limitations outlined in the README.

I think I hit upon the hardware floating point problem, as was mentioned before. The default Raspian images seem to do this wrong. Can you point to an image for the raspberry pi that has this floating point behaviour disabled?

I’m not aware of any floating point problems with the latest versions. Maybe I wasn’t clear before - that install document you have found is really old, it’s full of outdated information. Do not use it. Use the install link I provided.

Can you explain exactly what you’ve used and done and what problem you have?

Yeah, sure:

I installed raspian desktop, from https://www.raspberrypi.org/downloads/raspberry-pi-os/

Put an empty file ssh in the root of the boot partition, so can reach the pi via putty.

Configured after a bit of searching my justboom_dac sound card via /boot/config.txt
(dtparam=audio=off
dtoverlay=justboom-dac
)

Entered spotify credentials in .conf/mopidy/mopidy.conf

started rapsberry pi before starting mopidy

Then with sudo journalctl -u mopidy i get:

So my suspicion is the hardware floating point error, that frustrated earlier versions.

Hope you can read the images. But it complains about the spotify configuration.

Thanks again for your kind help.

Quintijn

The file .conf/mopidy/mopidy.conf is the wrong one when you are running as a service. You can see in your second screenshot that the Mopidy service is reading config from /etc/mopidy/mopidy.conf (amongst other places, but /etc/mopidy/mopidy.conf is the file you need to use) and so there are warning messages telling you the Spotify config was not found there. So just move all the config settings you want to change to /etc/mopidy/mopidy.conf and you should be good.

You really can entirely forget about hardware floating point issues. You’ll really struggle to run into anything like that in 2020.

I’ll jump in now with some other things you might want to do:

  • Install some web clients e.g. Mopidy-Musicbox-Webclient, Iris (note: sudo needed when installing for use with the Mopidy service)
sudo python3 -m pip install Mopidy-MusicBox-Webclient Mopidy-Iris
[http]
hostname = ::
default_app = musicbox_webclient
sudo apt install mopidy-mpd mopidy-tunein

Be sure to configure Mopidy-MPD’s hostname similarly to HTTP if you want to access it from other machines.

I installed the things above. I cannot reach the musicbox/mopidy via 192.168… the local address. Should the hostname above be change to the actual address?

Where does mopidy-mpd come in?

And the final step should be, how to start up mopidy automatically at boot time, when all other things work. Is “sudo systemctl start mopidy” equivalent to how it should start at boot time?

Thanks, Quintijn

No. Mopidy starts the web server at port 6680 (you can see this in the log). So you’ll need to visit http://192.168.x.y:6680

To avoid needing that (annoying to remember) Pi Musicbox adds some extra system config outside of Mopidy to redirect requests on port 80 (the default for web browsers) onto port 6680. It does this on every boot but you should be able to use the iptables-persistent package to avoid having to do that.

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 6680
sudo apt-get install iptables-persistent

There are other ways you can handle this kind of thing, this is just one.

Only if you want to use an MPD client to control playback. If you don’t want to do that / don’t know what that means then don’t bother installing that extension.

From https://docs.mopidy.com/en/latest/running/service/#service-management-with-systemd

On systems using systemd you can enable the Mopidy service by running:

sudo systemctl enable mopidy

This will make Mopidy automatically start when the system starts.

sorry, no luck yet, but probably nearly there. Now the webinterface shows up when I type 192.168.x.y:6680. And spotify search works. But does not play a track yet.

but maybe first:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 6680

–dport is not an option in this system…

And, in what file can I insert the automatic start line at boot time?

BTW I see no problem in typing that :6680 after the address, but your solution is nicer.

Greetings, Quintijn

Not sure I understand. What part of the https://docs.mopidy.com/en/latest/running/service/#service-management-with-systemd are you talking about?

I would like to run the line

sudo systemctl enable mopidy

automatically at startup of the raspberry pi.

No need. Run the command once (now). That will enable the service and it will persist between reboots.

wow, yes, that is magic!

The spotify search now works, but playing a track keeps waiting for mopidy. Any idea about that one?

Can it have to do with the redirect of :6680 which did not work on my pi? See my question above with screen shot…

Quintijn

I am reading the “journal” of mopidy now, and added users mopidy audio and video.

I have a radio stream running but hear no sound.

I added in /boot/config.txt:

Enable audio (loads snd_bcm2835)

#dtparam=audio=on
dtparam=audio-off
dtoverlay=justboom-dac

No sound, although the “alsa test” passed. (aplay /usr/share/sounds/alsa/Front_Center.wav)

When I try to insert in mopidy.conf:
[audio]
output = justboom_dac

The keyword “audio” is not valid, and raises an python error.

Also the keyword “mixer” does not work, expects software or none.

Questions:

  1. should the mopidy play sound with only the settings in /boot/config.txt
  2. if not: with what settings can I get justboom_dac (I think the correct name) recognised by mopidy?

Thanks, Quintijn

I think the settings you had in there originally were fine and if the test works then that part really is fine. I recently added a section to the Raspberry Pi instructions to make the system audio settings (which the Mopidy service uses) the same as the pi user’s settings. Did you do that bit? Another thing to try is removing the hdmi output, I think the system might default to using that for audio in some cases (but hopefuly not if you did the bit i just mentioned).

Great! I missed the instructions:

[audio]
output = alsasink

And now it all works. Much faster than the image of the pimusicbox as well…

Maybe the most important things you could add/stress in the instructions are:

  1. changing the sound card in /boot/config.txt
  2. add the preference for enabling mopidy as a service (sudo systemctl enable mopidy), and the remark that with this command the system will startup next time with this program.
  3. pointing at the correct location of the mopidy.conf file (/etc/mopidy/mopidy.conf), when running mopidy as service.

A detail still missing is getting rid of :6680 with the iptables command. (–dport option is missing), but typing this in my browser is not much of a problem.

With those instructions it is not very much more difficult to use the raspberry pi as musicbox, compared with the image of the pimusicbox. But it was a bit of a horde/barrier to take, for a newbie on the raspberry pi, not understanding how it all fits together (though an experienced programmer).

Nick, again my great appreciation of your kind and patient help!

Thanks and greetings, Quintijn (from The Netherlands)

1 Like

I forget how many little bits of glue there are present in pi musicbox that makes everything work together. If you were using other features e.g. Spotify Connect, DLNA, Airplay, network shares, automatic USB mounting etc then there would be quite a few more things needed. And that’s a helpful reminder that maybe there is some value in trying to revive the project and produce a new image, maybe…