Mycroft Community Forum

Plexmusic Skill - Test and Feedback

Hey @malevolent , i just swapped my VLC service with the one suggested by @gez-mycroft.

Could please reinstall the skill, and let me know if it solves your problem?
( Just to be sure…
you should be using commit a9dc40ff77ef7125e8e81046c15e05e8dca2a99c or later :wink: )

Thank you both, :slight_smile:
colla

Unfortunately, Mark I is still on Debian 8. And its VLC its frozen at version 2.2.
So no luck until Mark I will be upgraded to Debian 10 (hopefully some day)…

I can try the skill on arch linux, but it would have been great to listen music directly on the Mark I.

Thanks for the note, Malevolent. I too am a Mark I user, and also very interesting in Plex capability. That would be really fun functionality to add to Mycroft, and one of those features that could be a real differentiator (with respect to the other “big” names in digital assistant/voice automaton/etc).

I tried this skill on an arch linux desktop. It doesn’t install via mycroft-msm, and git cloning the repo and pip installing the requirements, either work

Traceback (most recent call last):
  File "/home/malevolent/development/mycroft-core/mycroft/skills/skill_loader.py", line 204, in _load_skill_source
    skill_module = imp.load_module(
  File "/usr/lib/python3.8/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.8/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 779, in exec_module
  File "<frozen importlib._bootstrap_external>", line 916, in get_code
  File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/mycroft/skills/plexmusic-skill/__init__.py", line 22
    <<<<<<< Updated upstream
    ^
SyntaxError: invalid syntax
 19:31:24.538 | ERROR    | 217249 | mycroft.skills.skill_loader:_communicate_load_status:287 | Skill plexmusic-skill failed to load

Looks like an unresolved git merge conflict.

@malevolent @j1nx
Hey guys … sorry for taking so long…

I corrected the errors … that is kind of embarassing i should have foreseen that happening.
I also had to install a new Mycroft device and set it up from scratch, it had some problems loading the configuration.
It eventually loaded the values after a couple restarts.
You can see that the configuration hasn’t loaded right when it logs:

 connecting to:

Without any content.

If you still have the motivation to do so you should be able to test it now.

I broke it as i was implementing a set of new features that are still missing documentation, they should be working now.

  • by search -> “Hey Mycroft, play {Title} by {Author}”
    If you had the skill running before you should reload the config to get the new search keys built. Call “Hey Mycroft, reload library” and wait for it to confirm completition.
  • random music -> “Hey Mycroft, play [some] random music”
    it will shuffle all the titles from your library
  • add to playlist -> “Hey Mycroft, add to playlist {playlistName}”
    will add the title you are listening to to the named playlist. The playlist needs to exist and be loaded in your local config. so if you add a playlist after downloading your track list. you should “Hey Mycroft, reload library” before you can add anything to it.

Let me know how it goes :slight_smile: I am happy to get any kind of contribuition.
Have a Nice Weekend and Happy Testing!

EDIT: added explanation for reloading config to init by search on an existing installation

Humm, I cannot see Plexmusic skill on home.mycroft.ai to configure it now.
and mycroft says configuration is missing, configure plexskill

I’ve rm -rf the skill and msm installed again, but it still doesn’t appears on home.mycroft.ai… can I be able to configure it via configuration file?

you removed the ~/.mycroft/skills/plex plugin/ folder as well? It might bite you because of old configuration files

I don’t have that directory…

Yeah, sorry, not exactly that folder. Skill settings are saved within their own folder in ~/.mycroft/skills/

Check if there is a folder referencing to the plex plugin. It might contain a setting.json which is “old”.

I have it configured at home.mycroft.ai as in my mycroft.conf…
i am not sure which one got it working :confused: sorry

sorry, it appeared after a few minutes on home.mycroft.ai, but it doesn’t create any directory under ~/.mycroft/skills, so I cannot configure it manually.

On the other hand it seems to conflict with News skill and youtube skill. I’ve removed both of them, but still fails with this error:

 19:00:17.232 | INFO     | 75232 | mesh-skill:send_MQTT:226 | address: 192.168.1.100, Port: 1883
 19:00:17.649 | INFO     | 75232 | Playback Control Skill | Resolving Player for: autumn tears
~~~~INFO     | 75232 | mycroft.util:wait_while_speaking:58 | mycroft.utils.wait_while_speaking() is depreciated, use mycroft.audio.wait_while_speaking() instead.
 19:00:17.652 | INFO     | 75232 | mesh-skill:send_MQTT:224 | MQTT: Mycroft/RemoteDevices/c8600098ed99/response, "Just a second"
 19:00:17.652 | INFO     | 75232 | mesh-skill:send_MQTT:226 | address: 192.168.1.100, Port: 1883
 19:00:17.654 | INFO     | 75232 | mesh-skill:handle_speak:206 | Response Location Length: 0
 Plex Music skill
    Title        0.000000
    Artist       0
    Album        0
    Playlist     0
    by Search    0

It seems it did not create any music lists …
could you please try reloading by “reload library” and send me the log?
it should spam the logs with all the songs its loading one after the other … when it’s done it will say “we are ready to roll” or something similar.

it should create a folder ~/.config/plexSkill and a json in it, containing info on your music.
could you check if that is happening?
that’s the information it’s going to use to respond to your queries.

Well, got finally working!

Something happened after installing this skill, don’t know if it was a coincidence but my mycroft instance stopped working completely, it didn’t respond to anything, weird.

All I had to do was:

git config pull.rebase false
git pull
./dev_setup.sh

and start mycroft again. Then, the library was scanned automatically

Now listening my beloved music. I will test the new features and report back! :smiley:

First impressions.

  • Search works impressively well. As I am not an English speaker, I expected to have issues it understood the 100% of the searches I did, even mycroft itself didn’t understand me well. For instance when I say “play the garden of dreams from autumn tears”, Mycroft understands
play the garden of dreams from out to theaters

The skill says:

 Plex Music skill
    Title      The Garden Of Crystalline Dreams - Act One  63.000000
    Artist     Lethian Dreams (FRA)  50
    Album      The Gardens Of Soulles (Split Ankhagram & Renascentia)  53
    Playlist     0
    by Search  The Garden Of Crystalline Dreams - Act One by Autumn Tears  63

And plays the proper album: The Garden Of Crystalline Dreams - Act One
Which is impressive, because I forgot to mention “crystalline” in the title and mycroft understood “out of theaters” instead “autumn tears” (yes, my pronunciation sucks).

I guess all those “Title”, “Artist”, “Album”, and so means all the matches and the probability.

  • Saying “next song” works!

The not-so-good

  • When I say to play a single song, it plays one time after another. I did the test and it plays the same song three times. I think it should play just once if I don’t say to play it endlessly or N times.
  • When I say to play an album, it plays the album randomly, I think people like me with some years in his back, used to CDs or vinyls, are more used to listen the album songs in order.
  • When I say “play random music”, it plays the News, not music. It works as expected when I say “play some random music”, though.

Ideas and nice-to-have
As my coding skills are too poor to contribute by coding, I can contribute with a few ideas that can make this skill even more awesome.

  • When I say “previous song” does nothing, it would be nice to tell mycroft “play previous song again”
  • It would be nice to obtain some info of the current song. On Mark II/Desktop Mycroft instances they will show this information on the screen, even on the Mark I the info could be displayed on its LED screen. But telling something like “what song is playing” and let mycroft speak the title and album, or “what is this artist”/“who is playing this song” would be awesome for people like me who has hundreds of albums and many of them listened a handful of times to recognize even the artist.
  • Support for multiple libraries and shared libraries. As a hardcore plex user, I have a premium account and have multiple users in my home, so my stuff doesn’t mess with my wife’s one, but I would like her to listen her music as well. The way I do this is by creating several libraries with my admin account, one for me and one for her, and sharing her library to her account. I have also several libraries from other plex accounts, shared with me. Currently I can just listen my own library, so she cannot listen her music nor I can hear my friend’s libraries.
  • Play best rated artist/albums. In plex, you can rate from 1 to 5 stars the song, the album or the artist. It would be great to say “play the best rated songs”, “play best rated albums” or “play best rated artists” so you can listen what you like most.
  • Rate current song, album or artist from 1 to 5 stars
  • Play by mood. In plex, you can set the “mood” of a track, album or artist. So you can listen music by tags.
  • Add tag to current track, album or artist with "set mood to this song|album|artist to <tag>"

In general, I’m quite impressed how well and fast this skill works. I HATE cloud services where I cannot find almost any artist I listen (the genres I listen are very underground) and I have to buy all the discs by myself, so I refuse to pay for a streaming service which can offer a poor selection of artists and I also hate not owning my own content.

Very, very good job. I’m going to use this skill as everyday skill.
Thank you very much!

I went to dinner and see a tv show for a while, and when I’ve return, it seems it doesn’t work now, I’ve refreshed the library and that’s the output

done loading library
 01:11:06.854 | INFO     | 147787 | mesh-skill:send_MQTT:224 | MQTT: Mycroft/RemoteDevices/c8600098ed99/response, "we are ready to go"
 01:11:06.854 | INFO     | 147787 | mesh-skill:send_MQTT:226 | address: 192.168.1.100, Port: 1883
 01:11:06.856 | INFO     | 147787 | mesh-skill:handle_speak:206 | Response Location Length: 0
 01:11:12.253 | INFO     | 147787 | mesh-skill:send_MQTT:224 | MQTT: Mycroft/RemoteDevices/c8600098ed99/request, "play clouds"
 01:11:12.254 | INFO     | 147787 | mesh-skill:send_MQTT:226 | address: 192.168.1.100, Port: 1883
 01:11:12.869 | INFO     | 147787 | Playback Control Skill | Resolving Player for: clouds
 01:11:12.870 | INFO     | 147787 | mycroft.util:wait_while_speaking:58 | mycroft.utils.wait_while_speaking() is depreciated, use mycroft.audio.wait_while_speaking() instead.
 01:11:12.871 | INFO     | 147787 | mesh-skill:send_MQTT:224 | MQTT: Mycroft/RemoteDevices/c8600098ed99/response, "Give me a moment to check for that"
 01:11:12.872 | INFO     | 147787 | mesh-skill:send_MQTT:226 | address: 192.168.1.100, Port: 1883
 01:11:12.874 | INFO     | 147787 | mesh-skill:handle_speak:206 | Response Location Length: 0
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 Plex Music skill
    Title      Closer  67.000000
    Artist     Clouds  100
    Album      Melancholy clouds  52
    Playlist   Gothic playlist  29
    by Search  Dor by Clouds  63

Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 01:11:19.215 | INFO     | 147787 | Playback Control Skill | Playing with: plexmusic-skill.colla69
 01:11:19.263 | INFO     | 147787 | Mark2 | Cancelling Idle screen
Removing event mycroft-mark-2.mycroftai:IdleCheck
 01:11:19.484 | INFO     | 147787 | mycroft.audio.services.vlc:stop:79 | VLCService Stop
 01:11:19.684 | INFO     | 147787 | Playback Control Skill | Audio service status: {}
 01:11:21.491 | INFO     | 147787 | mesh-skill:send_MQTT:224 | MQTT: Mycroft/RemoteDevices/c8600098ed99/response, "a playback error occurred"
 01:11:21.493 | INFO     | 147787 | mesh-skill:send_MQTT:226 | address: 192.168.1.100, Port: 1883
 01:11:21.493 | INFO     | 147787 | mesh-skill:send_MQTT:224 | MQTT: Mycroft/RemoteDevices/c8600098ed99/response, "sorry"
 01:11:21.495 | INFO     | 147787 | mesh-skill:send_MQTT:226 | address: 192.168.1.100, Port: 1883
 01:11:21.499 | INFO     | 147787 | mesh-skill:handle_speak:206 | Response Location Length: 0
 01:11:21.499 | INFO     | 147787 | mesh-skill:handle_speak:206 | Response Location Length: 0

as you can see it says a playback error occurred, sorry

EDITED: by restarting mycroft services the skill went back to life. Let’s see if that happens again

That kind of error “playback error” comes directly out of the VLC Backend.
sadly I have no idea when and why… anyways it normally works on a second call…
if it is in fact reproducible on a single title, then it means there’s some problem with the saved link…
moving music in PMS without “reload library” could also bring your links out of sync.

i am still thinking how to get a fast cache working … but i don’t see that happening anytime soon

Hey @malevolent,
I really appreciate you taking the time to write your impresssions.
That really helps a lot.

To explain the function of the skill further, i need to tell you that it always gets a
“list of content” to play back.
I gave it some thought and, at the time I came up with the following answers/questions:
(thinking about the usability of a feature-complete all-around music-player only using voice commands was not as easy as I would have expected, especially without a visual support)

  • The single song playing more than one Title is a “feature” as you can ask for a title
    and get more than a single result (covers, live & concert versions… )

  • The Randmization of the album is also intended by I understand how you feel.
    I never had anybody else using the skill so it simply randomizes any search result.
    Would you prefer to have a “shuffle mode” that you put on an off,
    or would you rather say “hey mycroft, play randomized AlbumName” or something else… I personally couldn’t decide how i want to use it and postponed developement.

  • about the “previous song” not working right, no idea … need to look into that ^^

  • you can ask what song is playing by saying one of the following
    music info |
    music information |
    what are you playing |
    what is this |
    what is this song

  • i started working the screen features … i stopped as i couldn’t programmatically decide where to play my music … since the GUI as i remember it … almost a year ago had it’s own player built in …
    and i had to use the vlc backend from the skill OR the GUI player… and there was no way to ask the framework if a GUI is active … I should simply give it another try when i have time… using the screen as a support to voice is a lot of help :slight_smile:

  • multiple libraries is something i never thought of as i am the only “friend with data to share” ^^ i think it’s a good idea… with a followup question… i would simply configure multiple comma separated names … and load more than one library… the question at this point is … do you activate a library ? (hey myc,Activate music library LibraryName) or just mix it all together in one searchable library …? I think “hey myc, play song by Artist from LibraryName” starts to get ridicolously long for a spoken query…

  • i had no idea we have moods in plex … I honestly implemented the “add to playlist” with that specific intention… i have playlists like “energy” or “relaxing” … i will definitely look into that as i am highly interested in using the feature

  • i personally don’t use ratings … but the whole backend to it is already there … so it would simply need the implementation through voice…

And I totally feel your pain about music and contents… let me know if you want some of the changes prioritized …
it will take some time but i am happy to help :slight_smile:

and thanks again, you giving me feedback mmotivated me quite a lot :wink:

Hi there @colla69!

You don’t need to thank anything, I’m the one who is grateful and enjoying your skill :wink: , I hope more users would feedback you about your skill, I even thought to announce it on plex forums, as many of their users are linux users and I would bet they would be as excited as I am. Besides, perhaps it would bring even more users to this community :slight_smile:

I expect from a voice-only music player has its limitations, but after testing other music skills, I must admit, this is from far what works the best. So keep doing the good job!! And regarding the GUI, I’ve just realized that your skill already has one!!

Yes, I know. I can search for an Album, Live concert and others and it will play the entire record, is just when I specifically ask for a single song when this behavior happened. I’ll do more tests and report back.

IMO, I think when a user ask for an album, it should play the album in sequential order, unless he or she says “shuffle this album” when playing or "play randomized|shuffled AlbumName"when invoking the skill.
It should be fine, though, to listen random songs when you ask for an Artist, as you didn’t ask for an explicit album name. I guess playing entire discography sequentially, in chronological order could be fine and a cool feature for some users, and thus you could ask for “play next album”. I like the idea, but I admit it would add more complexity.

Nice! Sometimes I like so much a song I would like to hear it more than once in a row!

I just tested this, and Mycroft didn’t speak anything, so I fired up the plasma widget and… tadaaa, the info was just there! I need to extensively test it, because I ask for the weather and asked back for the info, and it seemed to me that “music info” didn’t work, but “what are you playing” did. As I say, I’ll do more tests.

Multiple libraries could be activated on the configuration delimited with commas as you suggested. Bearing in mind Library names can have blank spaces in the name. I can share my music libraries (I don’t think my tvshows or movies, most of them only in spanish, will be of interest for you) with you if you need to do some tests with shared libraries. Regarding invoking one or other library… I would do like plex does: you don’t need to specify any library name, it searches in all libraries, local and remote, son I guess API will do the same. If there is a match in multiple libraries, local and remote, play local first.

I don’t use mood either, but surely there are people out there tagging all their music. I find tagging more flexible than creating lists.

I rate exclusively the songs I really like the most, but I certainly use rating a lot more if I could do it via voice, as usually I listen my music when working, and stopping what I’m doing, going to the browser, search the tab where plex is living, and clicking on the rating star will slow down my productivity. Telling mycroft to set X stars to the current song will help me to have my library more tidy. And that also applies to the tagging feature.

So, glad to hear you are motivated to work in this skill and add more cool features!!

I’ve just realized of another cool feature: “play on X device”.
Plex can reach chromecast and another plex clients on the network, so I can “send” it to wherever I want. (That can be useful as well for a future "PlexTV-Skill :wink: )