Sorry for necromancing an old thread, but it seems not too many people are using Mycroft together with LMS (Logitech Media Server, aka SqueezeboxServer aka Slimserver), albeit this is a great solution.
I use LMS v8.2.1 (on an Ubuntu machine) with about 10 players (some hardware, some Squeezelite), and a library of about 153,000 titles. My Mycroft is currently a test installation on my Linux Mint 20.3/Cinnamon laptop, version 21.2.2, and I’ve installed the skill-squeezebox by git cloning it into my /opt/mycroft/skills
folder.
My initial setup problem was the LMS host name on my account’s skill setup page: I had to use studio1
as my host name, not studio1.local
or studio1.fritz.box
, because the latter two would produce AttributeError: 'SqueezeBoxMediaSkill' object has no attribute 'lms'
. (I almost never use fixed IP addresses—we do have DHCP and DNS, after all!)
After having this fixed, the skill managed to get to the total library duration (/opt/mycroft/skills/skill-squeezebox/library_total_duration_state.json.gz
), song list (/opt/mycroft/skills/skill-squeezebox/library_cache.json.gz
) and album list (/opt/mycroft/skills/skill-squeezebox/sources_cache.json.gz
) from my LMS. As far as I can manually check, these look okay, even for the “odd” titles using fancy UTF-8 filenames (like Bowie’s “star” album, or Chinese/Japanese songs).
My current problem is now that, upon spoken (or typed) input like
play electronic music
-
play artist acdc
(AC/DC, but it seems able to resolve that!)
play thunderstruck
play thunderstruck by acdc
-
play album let’s rock
(by The Black Keys)
the skill comes up with error AttributeError: 'SqueezeBoxMediaSkill' object has no attribute 'default_player_name'
. It should know this, I entered it on my account’s skill settings page (tried both a hardware player Wohnzimmer
and a Squeezelite player e6510
), and it also has the info in /home/matthias/.config/mycroft/skills/skill-squeezebox/settings.json
:
{"__mycroft_skill_firstrun": false, "port": "9000", "server": "studio1", "password": "", "username": "", "default_player_name": "e6510", "speak_dialog_enabled": false, "podcast_source_enabled": true, "favorite_source_enabled": true, "playlist_source_enabled": true, "media_library_source_enabled": true}
The error message in Mycroft is:
10:08:50.183 | ERROR | 39566 | mycroft.skills.mycroft_skill.mycroft_skill:on_error:923 | An error occurred while processing a request in Squeeze Box Media Skill
Traceback (most recent call last):
File "/home/matthias/Projekte/mycroft-core/mycroft/skills/mycroft_skill/event_container.py", line 73, in wrapper
handler(message)
File "/home/matthias/Projekte/mycroft-core/mycroft/skills/common_play_skill.py", line 97, in __handle_play_query
result = self.CPS_match_query_phrase(search_phrase)
File "/opt/mycroft/skills/skill-squeezebox/__init__.py", line 617, in CPS_match_query_phrase
backend, playerid = self.get_playerid(self.get_backend(phrase))
File "/opt/mycroft/skills/skill-squeezebox/__init__.py", line 184, in get_playerid
backend = self.default_player_name.title()
AttributeError: 'SqueezeBoxMediaSkill' object has no attribute 'default_player_name'
10:08:55.361 | INFO | 39566 | Playback Control Skill | No matches
For the life of me, I can’t find out what the reason might be. Anyone who can help me debug or has an idea? I’d so much like to have Mycroft interact with my LMS!
Interesting also: If I try to specify a different player by saying play album let's rock on player Wohnzimmer
, it also now brings up an AttributeError: 'SqueezeBoxMediaSkill' object has no attribute 'lms'
, although it could previously use lms
to read the library:
10:21:14.635 | INFO | 39566 | Playback Control Skill | Resolving Player for: album let's rock on player Wohnzimmer
10:21:16.969 | ERROR | 39566 | mycroft.skills.mycroft_skill.mycroft_skill:on_error:923 | An error occurred while processing a request in Squeeze Box Media Skill
Traceback (most recent call last):
File "/home/matthias/Projekte/mycroft-core/mycroft/skills/mycroft_skill/event_container.py", line 73, in wrapper
handler(message)
File "/home/matthias/Projekte/mycroft-core/mycroft/skills/common_play_skill.py", line 97, in __handle_play_query
result = self.CPS_match_query_phrase(search_phrase)
File "/opt/mycroft/skills/skill-squeezebox/__init__.py", line 617, in CPS_match_query_phrase
backend, playerid = self.get_playerid(self.get_backend(phrase))
File "/opt/mycroft/skills/skill-squeezebox/__init__.py", line 186, in get_playerid
players = self.lms.get_players()
AttributeError: 'SqueezeBoxMediaSkill' object has no attribute 'lms'
10:21:22.347 | INFO | 39566 | Playback Control Skill | No matches
I wonder if this might be some Python and/or threading problem… (I run Linux Mint 20.3 and Python 3.8.10 on this laptop, Intel Core i7 Q740 [4 cores/8 threads], 16 GB RAM, 1 TB SSD).