Musicbox Spotify Connect issue


#1

Hi all,

I have installed PiMusicbox successfully yesterday on my RasPi and entered my credentials for Spotify.
I have a Spotify premium account and I can see and play songs from my playlists via the web interface of Musicbox just fine.
However, neither on the Spotify app on my iPhone nor my Macbook seem to be recognizing Musicbox as a device which supports Spotify Connect.
What does happen is if I am playing a song from Spotify, through the web interface on the Musicbox, and then try to start a song through either my phone or laptop (in Spotify), music is stopped on Musicbox and starts playing on the other device. (which is in line with the normal functioning of Spotify)

The whole reason for me to try Musicbox was its Spotify Connect capability.
I have tried it also on an other RasPi this morning at an other location and network, and still have the same issue.

Does anyone have an idea what might be causing this? and if there is a way of solving it?

Thanks a lot!


#2

Musicbox doesn’t have Spotify Connect functionality as Spotify have not
publicly released Spotify Connect. It’s only available to their preferred
partner companies.

Where did you see that Musicbox offers Spotify Connect functionality?


#3

Well, if I look at it once again, I see that somehow I assumed this to be true, because very vaguely I do remember reading about it. But I might have gotten too excited…

I now see other threads indeed that mention the fact that Spotify Connect is not released publicly yet.
I hope this serves as a reference for other people looking to do the same as I did.
All in all, I believe that Musicbox is still a very cool thing to run on the RasPi and will keep using it, with the hope that Spotify launches Connect as soon as possible.

Thanks for the help!


#4

any News to Spotify Connect in Mopidy?


#5

I guess not,
In the meanwhile I purchased two Gramofons, they have native Spotify
Connect support, no Airplay though.
However if Spotify is the main platform you use, just get one, you won’t
regret it.


#6

https://github.com/sashahilton00/spotify-connect-resources ?


#7

Ideally someone would go and build a Mopidy extension around either https://github.com/plietar/librespot or https://github.com/Fornoth/spotify-connect-web. I think it’s fair to say it won’t become a part of mopidy-spotify until Connect is released publicly, which may never happen.


#8

It is now possible to install Connect on Musicbox, using this quick hack:

login using ssh or a keyboard

Issue these commands:

sudo apt-get install libportaudio2 libvorbisfile3 libavahi-compat-libdnssd1 avahi-daemon -y
mkdir /opt/librespot
cd /opt/librespot
wget http://www.woutervanwijk.nl/mb/connect.zip
unzip connect.zip

Then add this to the end of /opt/musicbox/startup.sh

# start Spotify Connect if enabled
if [ "$INI__spotify__enabled" == "1" ]
then
    #start with cache to /dev/null to prevent disk full errors
    /opt/librespot/librespot -a /opt/librespot/spotify_appkey.key -b "$INI__spotify__bitrate" -c /dev/null -n "$INI__network__name" -u "$INI__spotify__username" -p "$INI__spotify__password"
fi

And reboot. Enjoy!

It’s not completely stable though, but it works quite well. It will stop spitting out sound if you use shairport or mopidy. A reboot fixes that. See:
https://github.com/plietar/librespot/issues/26


#9

I tried the code and instructions for activating connect but it doesn’t seem to work on my raspberry pi 2. I’ve tried applying it to a clean install of pi musicbox, am I missing something?


#10

Hi woutervanwijk,

Thanks for providing an instruction and a downloadable file. However, I can’t connect to your web server. No response on port 80. Is connect.zip available for download somehere else?


#11

Hi Per,

The server was down indeed. It is up again!

wouter

|

| Per_Larsson
May 8
—|---

Hi woutervanwijk,

Thanks for providing an instruction and a downloadable file. However, I
can’t connect to your web server. No response on port 80. Is connect.zip
available for download somehere else?


[Visit Topic](https://discourse.mopidy.com/t/musicbox-spotify-connect-
issue/790/10) or reply to this email to respond


In Reply To

| ![](https://discourse.mopidy.com/user_avatar/discourse.mopidy.com/woutervanwi
jk/45/15_1.png) |
woutervanwijk
April 9
—|---
It is now possible to install Connect on Musicbox, using this quick hack:
login using ssh or a keyboard Issue these commands: sudo apt-get install
libportaudio2 libvorbisfile3 libavahi-compat-libdnssd1 avahi-daemon -y mkdir
/opt/librespot cd /opt/librespot wget http://www.woutervanwijk.nl/mb/c…


[Visit Topic](https://discourse.mopidy.com/t/musicbox-spotify-connect-
issue/790/10) or reply to this email to respond

To stop receiving notifications for this particular topic, [click
here](https://discourse.mopidy.com/t/musicbox-spotify-connect-
issue/790/unsubscribe). To unsubscribe from these emails, change your user
preferences


#12

Hi woutervanwijk,

Appreciate the work, but not having any joy. All that happens is that the first time I try and play a song the librespot process dies. I’ve tried running it manually and get the following before starting Spotify on my phone:

Authenticated !
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
kMessageTypeHello MusicBox 34aee17358367ce034fe6896a117955318021821 1 1463868028366
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: WireError("invalid value for enum: 11")', ../src/libcore/result.rs:688
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', ../src/libcore/result.rs:688

Then once opening Spotify on my phone the following line pops up:

thread '<main>' panicked at 'calledResult::unwrap()on anErrvalue: "SendError(..)"', ../src/libcore/result.rs:688

and the connect device disappears.

It would help if there was some logging I could go through


#13

Sounds like the same issue I am experiencing.


#14

hello im having problems here.
when im selecting MusicBox on spotify connect. it connects and dissconnect in a second.

please help
thank you
david


#15

Yea, also having the same issue when trying to use Spotify connect.


#16

I experience the same issue like @nashant. @woutervanwijk, does it still work for you? It would be awesome if you could provide some help here. :smiley:

I tried to run the command manually on my booted musicbox and got this:

Authenticated !
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
kMessageTypeHello Mopidy 76d3e8b455a760d0e5e9f04e58a64ea65f45de34 1 1466971914362
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: WireError("invalid value for enum: 11")', ../src/libcore/result.rs:688
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', ../src/libcore/result.rs:688
Segmentation fault

#17

I found this solution for Spotify Connect. It works!

I only need to find a way to autostart it in Musicbox.
Maybe it can be integrated in the Musicbox image.


#18

Also I found mopidy-spotify. I can’t see support for Connect. i could not get itcinstalled, because it needs python v2.7.5 while Musicbox has v2.7.3. And maybe it is already installed on musicbox with an older version of python.

https://pyspotify.mopidy.com/en/latest/installation/


#19

As far as I know, there is no other Spotify connect for Mopidy.

There is a plug-in that allows Spotify Premium users to browse the Spotify music catalogue and playlists using the Mopidy interface. I guess this one is called mopidy-spotify.


#20

Just installed musicbox. and there seem to be a beta of spotify connect (enable in config.ini file).
Worked for me…