forslund / spotify-skill

Mycroft Skill to control spotify using the Spotify Connect API
Apache License 2.0
71 stars 38 forks source link

Mac client must connect to Raspotify before Mycroft skill sees it #92

Closed jeremymatthewwerner closed 5 years ago

jeremymatthewwerner commented 5 years ago

I have installed Raspotify and the Mycroft Spotify Skill and I have them connecting to my Premium Spotify account and playing through Raspotify on the same machine - with one catch.

On a fresh startup when I ask Mycroft to play something from Spotify, it can’t find any devices, saying " Spotify couldn’t start playback. I couldn’t find any Spotify devices".

ps -ef | grep reaspot shows /usr/bin/librespot is running, but for some reason the skill can’t find it.

However, If I then launch the Spotify app on my Mac and go to Settings -> Open Devices Menu -> and click the device that shows called “raspotify” it somehow “pokes” Raspotify because immediately re-issuing the same voice command to Mycroft works! I don’t even have to start a stream playing from my Mac first. Just clicking the device on the Mac client seems to make Raspotify visible to Mycroft on the Rasperry Pi both are running on.

Has anyone seen this behavior before? Does anyone have any idea what might be going on?

BTW I assume I have to use Raspotify and can’t just have the skill stream directly the way, say, the news skill does? If that’s possible I can’t figure out how to make that simpler setup work either.

forslund commented 5 years ago

Hi, it sounds a bit like raspotify is in discovery mode. When it's in this mode a spotify client can activate it but until it's been activated it's not registered as a spotify connect player.

Have you added your username / password to the /etc/default/raspotify.conf config?

As you've figured out raspotify (or another spotify client/player) is needed for the skill.

jeremymatthewwerner commented 5 years ago

I have not added my Spotify username / password to raspotify.conf yet as that sounded like it was only needed for raspotify to be accessed across "the whole internet". In fact is it needed to get out of discovery mode? Are you saying adding this will auto-register? I will try it tonight regardless. Thank you for your prompt reply!

jeremymatthewwerner commented 5 years ago

Since I'm only trying to have Mycroft on the same Pi as Raspotify see Raspotify, I thought this was the comment that applied "Raspotify works out of the box and should be discoverable by Spotify Connect on your local network"

forslund commented 5 years ago

I have been trying to get the discovery mode working with the skill and got half way there. I can find the device on the network but haven't really figured out how to send the credentials to the player to make it available on Spotify connect.

jeremymatthewwerner commented 5 years ago

I see. Well your suggestion worked! Adding my Spotify credentials did the trick. All works now. Thanks a ton for your help.

forslund commented 5 years ago

Great to hear, is it ok to close this issue now?