Open Tafari opened 6 years ago
The skill is basically a spotify connect skill and will play locally if there is a Spotify connect device there. as @ConorIA suggest you can install Raspotify on the picroft. This comes pre-installed on the Mark-1 but I'm not 100% sure it's bundeled on the picroft image. you might need to install it separately. If you configure the client to have the same name as the mycroft device the skill will default to this device.
@forslund your comment
If you configure the client to have the same name as the mycroft device the skill will default to this device.
Does this mean that the raspotify device name (in the config /etc/default/raspotify) should have the same device name as mentioned on home.mycroft ?
@parthsuthar yes that's best.
Edit: A bit more info: when starting playback it checks for
that works. thanks!
@forslund I am running this on Mark 1 and I am seeing something similar to above. When I newly install the skill or reboot, it recognises Mark 1 as a Spotify device and works perfect but once I leave the Mark 1 alone for a few hours, it doesn't see itself as a device anymore and will only play to other devices.
Is this something you know about?
@JamesPoole I've seen this myself from time to time and asked the librespot team. Apparently the client doesn't gracefully handle disconnects from from the spotify servers. And can be left hanging in a running but not connected state.
I'll see if I can create a workaround restarting the client if it seem to be lost.
Super, thanks for all the work!
@forslund am running this in a raspbian instance with mycroft installed, and it seems to be failing to recognize the spotify device. Raspotify is installed, and the device name for raspotify is correctly configured. The device is properly paired with my spotify account. When I attempt inputting "pause spotify", I get the following error:
17:02:08.595 - mycroft-spotify_forslund:__pause:779 - INFO - Pausing Spotify... 17:02:08.764 - mycroft-spotify_forslund:pause:184 - ERROR - http status: 404, code:-1 - https://api.spotify.com/v1/me/player/pause?device_id=None:Device not found
Is there a config somewhere I missed?
@DeIonizedPlasma That looks like a bug, thanks. I'm not sure it'll do much harm though.
Currently mycroft can only pause spotify playback it has started in the first place. In the case above it looks like there is no current device id so the pause command fails. this would be expected if mycroft did not start playback.
Thanks for the quick reply. I know that mycroft was properly connecting to spotify, because when I stopped all mycroft processes it paused spotify playing on a different device.
I think I may have fixed it now, although I'm not sure how. I had been running mycroft in debug mode, and upon switching to just cli it seems to be partially working. It won't pause/play if I attempt to do so immediately after starting, regardless of whether I am playing music on another device. If I tell it to play a song, it will do so on whatever device is set to play through spotify, and will then play/pause properly on all devices. The only thing that seems strange about this operation is the need to queue a song first on mycroft even if all the controls are for audio on a different device.
I'm a bit confused about the suggestion to install and configure raspotify. From what I can see, the skill tries to manage "librespot" itself if the device is in MANAGED_PLATFORMS. If I disable this MANAGED_PLATFORMS check, simply having librespot installed seems to be enough to make it all work. So I'm wondering, why is this MANAGED_PLATFORMS check there? All it seems to do is break the ability to play on the speaker on Picroft without manually installing and configuring a complete Raspotify installation as well (as opposed to only having librespot installed).
Raspotify is the name of the package for the pi. It installs librespot and sets up aservice running it
The problem with picroft is that the sysyem isn't set up with the application preinstalled. The same goes for desktop installations where librespot need to be built from source or the spotify desktop app can be used.
Yeah but won't it just fall back to trying to play on another device when it can't run librespot locally?
Even if you install raspotify, that isn't enough on the Picroft, you have to manually configure that service to run it. Just installing it seems to be enough if you remove the MANAGED_PLATFORMS check though
You should also shutdown the service so two instance aren't running.
similar to #135 ?
I can't figure out if I'm being a complete newb or misunderstanding the purpose of this Skill?
I can use it to play/control Spotify on another device, but it won't stream music directly through the Mycroft.
If I ask it to list all Spotify devices, it will list my PC, or None (depending if the PC has Spotify open or not). I'd like to stream Spotify directly through my Picroft, am I missing a trick here?
Thanks