Plexmusic Skill - Test and Feedback

Hey malevolent :slight_smile: thanks for testing.

try configuring it with the IP ( http://192.168.1.100 ).
It should load your library on startup, it will say something as it is done loading, after that the search should work.
The “refresh library” Intent should also work then, in case it doesn’t try changing the skill priorities in your mycroft.conf .

And let me know if you get it running :wink:

Sorry, I forgot to tell I also tried the URL without the port. No luck.

I don’t know how to change priorities. And that means to set higher priority for plexmusic over Pandora or spotify skills?

hey :slight_smile:

forget the priorities … we’ll fix that problem when and if it arises at all :slight_smile: /
My best guess at the moment is, the skill throws an exception on init and doesn’t load at all :confused:
Would you please try it this way:

-msm uninstall plexmusic-skill > wait for it to uninstall correctly.
-stop mycroft through “stop-mycroft.sh”
-clear the content of /var/log/mycroft/skills.log
-write the configuration in your mycroft.conf

“plexmusic-skill”: {
“musicsource”: “http://192.168,1,100”,
“plextoken”: “----8s6uP----abc4sRYe”,
“plexlib”: “music”,
“ducking”: true
}

-start mycroft through command “mycroft-start.sh debug”
-let the boot process finish > send to me the content of /var/log/mycroft/skills.log

Hopefully I can find out how the problem arises.
Thank you for your help :slight_smile:

Sorry for the late response… I think we’re are on a opposite timezone :pensive:

I had to do it a bit different as you suggested, as I have a Mark I, but I think it will be valid for you:

msm remove plexmusic-skill
systemctl stop mycroft-skills.service
truncate --size=0 /var/log/mycroft/skills.log

Edited mycroft.conf and added the plexmusic-skill section, then:

systemctl start mycroft-skills.service

Here you have the skill.log after everything is up.
https://privatebin.net/?069749a8b24d0554#DPcNVYUvuEWyoz2xmUdRDRrsXHLyAjKrfeB9st1m4YGj

What I didn’t undestood is why you didn’t made me install back plexmusic-skill, so, to save 24h, I repeated the steps but now adding the skill, just in case :wink:

systemctl stop mycroft-skills.service
truncate --size=0 /var/log/mycroft/skills.log
msm install https://github.com/colla69/plexmusic-skill.git

The skill isn’t shown on home.mycroft.ai/skills

systemctl start mycroft-skills.service

And the skills.log:
https://privatebin.net/?4560a23ff2baa59b#DBWkqWTNmv6Sappx12DGgEnZbhoSWUKY2yro1s5n7SCw

Here we can clearly view there is a problem loading the skill

12:34:42.328 - mycroft.skills.core:load_skill:122 - INFO - ATTEMPTING TO LOAD SKILL: plexmusic-skill.colla69 with ID plexmusic-skill.colla69
12:34:43.553 - mycroft.skills.core:load_skill:169 - ERROR - Failed to load skill: plexmusic-skill.colla69
Traceback (most recent call last):
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/skills/core.py", line 135, in load_skill
    skill = skill_module.create_skill()
  File "/opt/mycroft/skills/plexmusic-skill.colla69/__init__.py", line 370, in create_skill
    return PlexMusicSkill()
  File "/opt/mycroft/skills/plexmusic-skill.colla69/__init__.py", line 168, in __init__
    self.vlc_player.get_media_player().audio_set_volume(100)
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/vlc.py", line 2654, in get_media_player
    return libvlc_media_list_player_get_media_player(self)
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/vlc.py", line 4926, in libvlc_media_list_player_get_media_player
    ctypes.c_void_p, MediaListPlayer)
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/vlc.py", line 246, in _Cfunction
    raise NameError('no function %r' % (name,))
NameError: no function 'libvlc_media_list_player_get_media_player'

By the way, vlc is installed.

pi@mark_1:~ $ dpkg -l| grep vlc
ii  libvlc5                            2.2.7-1~deb8u1                              armhf        multimedia player and streamer library
ii  libvlccore8                        2.2.7-1~deb8u1                              armhf        base library for VLC and its modules
ii  vlc                                2.2.7-1~deb8u1                              armhf        multimedia player and streamer
ii  vlc-data                           2.2.7-1~deb8u1                              all          Common data for VLC
ii  vlc-nox                            2.2.7-1~deb8u1                              armhf        multimedia player and streamer (without X support)
ii  vlc-plugin-notify                  2.2.7-1~deb8u1                              armhf        LibNotify plugin for VLC
ii  vlc-plugin-samba                   2.2.7-1~deb8u1                              armhf        Samba plugin for VLC

I think you need to upload your vlc. I am currently running 3.0.7.1

╭─cola@cola-Desktop ‹system› 
╰─$  dpkg -l| grep vlc

ii  libvlc-bin:amd64                                3.0.7.1-0ubuntu18.04.1                              amd64        tools for VLC's base library
ii  libvlc5:amd64                                   3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer library
ii  libvlccore9:amd64                               3.0.7.1-0ubuntu18.04.1                              amd64        base library for VLC and its modules
ii  phonon4qt5-backend-vlc:amd64                    0.10.1-2                                            amd64        Phonon4Qt5 VLC backend
ii  vlc                                             3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer
ii  vlc-bin                                         3.0.7.1-0ubuntu18.04.1                              amd64        binaries from VLC
ii  vlc-data                                        3.0.7.1-0ubuntu18.04.1                              all          common data for VLC
ii  vlc-l10n                                        3.0.7.1-0ubuntu18.04.1                              all          translations for VLC
ii  vlc-plugin-base:amd64                           3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (base plugins)
ii  vlc-plugin-notify:amd64                         3.0.7.1-0ubuntu18.04.1                              amd64        LibNotify plugin for VLC
ii  vlc-plugin-qt:amd64                             3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (Qt plugin)
ii  vlc-plugin-samba:amd64                          3.0.7.1-0ubuntu18.04.1                              amd64        Samba plugin for VLC
ii  vlc-plugin-skins2:amd64                         3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (Skins2 plugin)
ii  vlc-plugin-video-output:amd64                   3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (video output plugins)
ii  vlc-plugin-video-splitter:amd64                 3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (video splitter plugins)
ii  vlc-plugin-visualization:amd64                  3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (visualization plugins)

I hope this fixes the problem :slight_smile: good luck

The I Heart Radio Skill was facing a similar issue with VLC, details are here:

TLDR:
from mycroft.audio.services.vlc import VlcService
https://github.com/johnbartkiw/mycroft-skill-iheartradio/blob/master/init.py

That’s exactly what i was thinking about when i wrote:
“I plan to extend functionalities, once i am happy with the VLC-backend…” :slight_smile:
I read the VlcService code and it has all the functionalities I originally had in mind :sparkler::tada:

Thank you, a lot :slight_smile:

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.