Issues with Spotify device connection from Picroft


#1

I’ve just got my Picroft up and running and now I’m trying to connect Spotify. I’ve added the Spotify skill and configured the username and password. When I ask Mycroft to play something, it plays through a Spotify device (my Amazon Echo, my iPhone etc). Now I want to set up a Spotify device on the RPi itself. I installed raspotify, and updated my /etc/default/raspotify with the same name as my Picroft device (which I simply called “Picroft” on home.mycroft.ai).

Device name on Spotify Connect

DEVICE_NAME=“Picroft”

I edited the device in the skill settings to match, and this is reflected in ~/mycroft-core/skills/mycroft-spotify.forslund/settings.json:

{“default_device”: “Picroft”, “Spotify”: “1”, “use_ducking”: true, “user”: “i0p7j6t0aipmxiptpeb87l2lj”, “__mycroft_skill_firstrun”: false, “password”: “REDACTED”}

If I open the Spotify app on my phone, it says that devices are available and I can choose Picroft. The sound does come out of my RPi, but it’s really slowed down like the sample rate is incorrect. Also, if I try to play anything using Mycroft, I get the following error message:

Unable to get a default device while trying to play something

If anybody could help set this up I would really appreciate it!


#2

I just rebooted and tried again, and this time Mycroft told me verbally that:

Spotify couldn’t start playback: I couldn’t find any Spotify devices"

But when I opened the Spotify app on my phone, the device was showing there as available and I could stream to it (albeit with the apparent sample rate issue). When I then stopped playback from the phone and asked Mycroft to play something, it played through Raspotify. But I don’t understand why I needed to play something using the phone client first.


#3

Hmm, further problems. If I quit the Spotify app from my phone and ask Mycroft to play something, it says it is playing, but I don’t hear anything. When I re-open the Spotify app on my phone, it says it is playing what I asked for to Picroft. If I switch the device to play it to the phone then it continues playing and I can hear it from the phone. If I then switch it to the Picroft device using the phone app, the sound comes from the Picroft.


#4

Hey mashers, thanks for the reports.

I just tried firing up Spotify on a Picroft and had similar results. It’s working fine on the Mark 1’s but for me the Picroft won’t show as a potential Spotify device.

One of our key developers Ake is currently looking at the Spotify Skill as we’ve also seen a few bugs cropping up. Ake’s on leave this week but I’ll flag this thread with him when he gets back.


#5

Thanks gez. I think part of the problem might actually be with raspotify, as I’ve seen some bug reports on the raspotify GitHub page from others having similar issues. I tried switching over from raspotify to spocon, which is a wrapper for a Java Spotify device endpoint. It does work, but not on Stretch as the openjdk-11-jre package doesn’t exist on Stretch. I actually installed Buster and set up Mycroft manually and was able to get spocon working, but it still wasn’t very reliable :confused:


#6

@mashers You can try spotifyd, there is an arm version that appears to run fine on my rp4.


#7

@lordsiris thank you for the suggestion but unfortunately I have the same problem with that as I had with raspotify - the audio is stretched out like the sample rate is incorrect :confused:


#8

@lordsiris - Oh wait, I switched the system to use the output of my ReSpeaker instead of the built-in Pi output and it works perfectly! Thank you! :slight_smile: :slight_smile: :slight_smile:


#9

Hm it still doesn’t work from Mycroft, only if I stream to spotifyd directly from my phone


#10

Does the spotifyd config have the name of your mycroft device? Also think you will have much better audio output in general using the respeaker output vs the internal pi headphone (those are notoriously bad quality).