[Music] Squeeze box / Logitech Media Server control

I’m a long-time LMS user, and I picked up on this skill a few days ago via @sanderant post on the Squeezebox forums. I repurposed a Pi3+ with a Jabra borrowed from work and had some fun getting it all to work, at least with some of the standard skills.

I have installed your Squeezebox skill, and configured it with details of my LMS server and main player. But I just can’t see how to use the skill (I am new to this Mycroft/Picroft thing) - or even check whether it’s functioning, so any pointers would be helpful. For example, where do I find the various logs that I could use to identify the issues? And even, what are the commands to ask Mycroft to play from LMS?

Robert

1 Like

Hey @GrumpyBob the best thing is to check the skills log. The process can be a little frustrating to be sure, but if you can grep the skills log that is where I found the most help.

grep -i squeeze /var/log/mycroft/skills.log | less

2 Likes

Hi JOPS & others
Thank you for the skill!! This would be phenomenal if I could get it to work, but it doesn’t :frowning:
Each time I get following error. Tried to change some things in code, Pi can ping the server and all, so I don’t know where to look from here. (I added the settings debuglog also to the errorlog to make it easier to verify)

20:41:02.073 - mycroft.skills.core:load_skill:123 - INFO - ATTEMPTING TO LOAD SKILL: skill-squeezebox with ID skill-squeezebox
20:41:03.704 - mycroft.skills.settings:_poll_skill_settings:412 - INFO - SqueezeBox Media Skill: Delaying next settings fetch
20:41:04.019 - skill-squeezebox:initialize:24 - INFO - Initializing SqueezeBox Media skill
20:41:04.048 - skill-squeezebox:initialize:33 - ERROR - Settings: {'server': '<IPADDRESS>', 'speak_dialog_enabled': False, 'default_player_name': 'Squeezebox_Radio', 'media_library_source_enabled': True, 'playlist_source_enabled': True, 'podcast_source_enabled': True, 'username': '', 'port': '<PORTOFWEBCLIENT', 'password': '', 'favorite_source_enabled': True}
20:41:04.060 - skill-squeezebox:get_sources:94 - INFO - Loading content
20:41:04.301 - skill-squeezebox:load_library_total_duration:241 - INFO - Loading library total duration state
20:41:04.307 - skill-squeezebox:load_library_total_duration:247 - INFO - Loaded library total duration state
20:41:04.312 - skill-squeezebox:update_sources_cache:444 - INFO - Library total duration changed. Updating cache.
20:41:04.358 - skill-squeezebox:load_library_total_duration:241 - INFO - Loading library total duration state
20:41:04.364 - skill-squeezebox:load_library_total_duration:247 - INFO - Loaded library total duration state
20:41:04.371 - skill-squeezebox:update_library_cache:421 - INFO - Library total duration unchanged. Not updating cache.
20:41:04.381 - skill-squeezebox:load_library_cache:231 - INFO - Loading library cache
20:41:04.389 - skill-squeezebox:load_library_cache:237 - ERROR - Library cache not found. Exception: Expecting value: line 1 column 1 (char 0)
20:41:04.616 - mycroft.skills.core:load_skill:170 - ERROR - Failed to load skill: skill-squeezebox
  File "/opt/mycroft/skills/skill-squeezebox/__init__.py", line 80, in initialize
  File "/opt/mycroft/skills/skill-squeezebox/__init__.py", line 101, in get_sources
  File "/opt/mycroft/skills/skill-squeezebox/__init__.py", line 445, in update_sources_cache
  File "/opt/mycroft/skills/skill-squeezebox/__init__.py", line 308, in save_sources_cache
AttributeError: 'SqueezeBoxMediaSkill' object has no attribute 'results'

Hi all

I am quite new to Mycroft and still learning so be kind if I ask something stupid.

Anyway I installed it on a Google AIY kit to test and it all works well. Then I discovered the Squeeze box skill which I have installed.
(.venv) pi@picroft:~ $ mycroft-msm list|grep squee

INFO - building SkillEntry objects for all skills
INFO - building SkillEntry objects for all skills
INFO - invalidating skills cache
skill-squeezebox.johanpalmqvist	[installed]

Problem is that I can’t work out how to configure it. If I go to the mycroft.ai page it is not listed in the list of skil.
Am I supposed to populate the setting.json file myself? if so what is the format?

Thank for you help.

Hi ppmt,

Not a stupid question at all, I just downloaded the Skill and had the same issue.

I’ve submitted a fix back to Johan the original author but if you want to get going straight away you can replace this file:
/opt/mycroft/skills/skill-squeezebox.johanpalmqvist/__init__.py
with my updated version:
https://raw.githubusercontent.com/krisgesling/skill-squeezebox/fix/get-settings/__init__.py

@gez-mycroft

I tried to download your file but it is the same file as the one I have

-rw-r--r--  1 pi pi 42828 Dec 19 15:24 __init__.py
-rw-r--r--  1 pi pi 42828 Dec  9 13:25 __init__.py.org

cksum is the same as well

edit: I found your file in the main repository. And now I can see it in the mycroft.ai

Thanks. Now I need to figure out how to use it

Sorry wrong link:
https://raw.githubusercontent.com/krisgesling/skill-squeezebox/fix/get-settings/__init__.py

1 Like

I got it to work so thanks a lot for that @gez-mycroft

1 Like

Anyone here still using the squeezebox skill with mycroft? I just started to use picroft and installed te skill successfully but cannot configure it. Even after the exchanging the init.py, the skill is not shown at Account and I am struggling to set the setting file manually.

I have not, but just put it on my TODO list. I’ve been having issues with Emby/Jellyfin. I will report back …

-Mike M

I was actually able to solve it! After a fresh Picroft installation with the latest release candidate (https://mycroft.ai/to/picroft-rc), the Squeezebox skill config page is now available.

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).

I believe you have to setup and connect with a Username and Password on LMS. That is what worked for me. I can now use voice commands to play genres and artists but it doesn’t seem to be loading playlists even though it recognizes the command.