RoonCommandLine Version 2.0.5 Release 1

@DaveN thanks for all your help! I really appreciate it. It’s difficult to debug an issue I cannot replicate so your help is invaluable in a situation like this. I hope we did not consume too much of your time.

I’m turning in too so talk to you tomorrow.

1 Like

Not a problem. Fingers crossed we’ll get it sorted out soon.

BTW, just noticed something else …

When you play an album via RoonCommandLine it doesn’t scrobble the tracks to last.fm. Is this expected behaviour?

And now I really am turning in :slight_smile:

Both work for me. Non-Latin-1 characters in the tag names? Actually, since Python 3 is all Unicode, I’d bet there’s a tag name using Windows CP-1252 that doesn’t convert properly to Unicode.

Update: roon -l genres works, too.

Nice idea, but I’m fairly sure that’s not the case. Also, it wouldn’t explain why roon -l genres also fails (as I’m using Roon’s genres, not my own), nor why roon -l playlists now returns the following:

djn@trinity / % roon -l playlists        
No playlists found matching  __all__

I deleted the Qobuz playlist, so now have 16.

I made one discovery this morning …

I was wondering why roon -l playlists only returned the Qobuz playlist and noticed it was the only one that was set to ‘Shared (visible to all profiles)’. I changed a few others and they now show up too.

Unfortunately changing the profile / visibility didn’t work for tags, nor does it have any relevance to genres, but I thought it might spark some ideas for you … maybe there’s something going on with respect to Profiles? That said, I only have one profile, and there’s nothing odd about it that I’ve noticed.

Oh, and I also forced a backup this morning, just to check there isn’t something funky going on with my database. It ran without problems.

@DaveN , good morning. Or afternoon maybe where you are? Good to hear that playlist listing is working. But, tags and genres still need work. Let’s see if debug output from the roonapi Python module will get us any helpful info. Attached is a slightly modified list_tags.py with debug logging enabled. Replace your /usr/local/Roon/api/list_tags.py with this debug version and run the command:

python3 /usr/local/Roon/api/list_tags.py -t __all__`

Send me the output from that command.

[EDIT]
Oops, forgot to attach. I do not see an attachment feature here.

Tell me there is a better way to do this. Copy and paste the following:

import argparse
import configparser
from os import path
import sys
import logging

config = configparser.ConfigParser()
config.read('/usr/local/Roon/etc/roon_api.ini')

# Set to IP address of your Roon Core
server = config['DEFAULT']['RoonCoreIP']
# Set to Port of your Roon Core
port = config['DEFAULT']['RoonCorePort']
# Name of the file that holds a Roon API token
tokenfile = config['DEFAULT']['TokenFileName']

parser = argparse.ArgumentParser()
parser.add_argument("-t", "--tag", help="tag search term")
parser.add_argument("-z", "--zone", help="zone selection")
args = parser.parse_args()

if args.tag:
    searchterm = args.tag
else:
    searchterm = config['DEFAULT']['DefaultTag']
if args.zone:
    target_zone = args.zone
else:
    target_zone = config['DEFAULT']['DefaultZone']

version = config['DEFAULT']['RoonCommandLineVersion']
release = config['DEFAULT']['RoonCommandLineRelease']
fullver = version + "-" + release

from roonapi import RoonApi
logging.getLogger("roonapi").setLevel(logging.DEBUG)

appinfo = {
    "extension_id": "roon_command_line",
    "display_name": "Python library for Roon",
    "display_version": fullver,
    "publisher": "RoonCommandLine",
    "email": "roon@ronrecord.com",
    "website": "https://gitlab.com/doctorfree/RoonCommandLine",
}

# Can be None if you don't yet have a token
if path.exists(tokenfile):
    token = open(tokenfile).read()
else:
    token = "None"

roonapi = RoonApi(appinfo, token, server, port)

# get target zone output_id
outputs = roonapi.outputs

output_id = None
for (k, v) in outputs.items():
    if target_zone in v["display_name"]:
        output_id = k

if output_id is None:
    err = "No zone found matching " + target_zone
    sys.exit(err)

# List matching tags
tags = roonapi.list_media(output_id, ["Library", "Tags", searchterm])

if tags:
    print(*tags, sep = "\n")
else:
    print("No tags found matching ", searchterm)

# save the token for next time
with open(tokenfile, "w") as f:
    f.write(str(roonapi.token))

This is an excellent feature request. I was unaware last.fm scrobbling was not supported via the API. I will verify that and, if indeed API calls do not scrobble as one would expect, I may be able to add this feature to RoonCommandLine utilizing the last.fm API.

1 Like

Good day to you too :slight_smile:

Yes, but only if I set the playlists to be globally available rather than just for my profile.

Here you go …

djn@trinity RoonCommandLine % python3 /usr/local/Roon/api/list_tags.py -t __all__
2022-04-18 17:18:37,256 DEBUG  roonapi -- Connecting to Roon server 192.168.68.145:9333
2022-04-18 17:18:37,273 DEBUG  roonapisocket -- Opened Websocket connection to the server...
2022-04-18 17:18:37,273 DEBUG  roonapi -- Connection with roon websockets (re)created.
2022-04-18 17:18:37,273 DEBUG  roonapi -- Confirming previous registration with Roon...
2022-04-18 17:18:37,288 DEBUG  roonapi -- Registered to Roon server Trinity
2022-04-18 17:18:37,288 DEBUG  roonapi -- {'core_id': 'c125499a-264a-4f4b-9166-3a25568f7775', 'display_name': 'Trinity', 'display_version': '1.8 (build 931) stable', 'token': 'b7e9857f-33b9-46b7-b106-d73477ac4a81', 'provided_services': ['com.roonlabs.transport:2', 'com.roonlabs.browse:1'], 'http_port': 9333}
2022-04-18 17:18:37,289 DEBUG  roonapi -- _on_state_change zones
2022-04-18 17:18:37,289 DEBUG  roonapi -- _on_state_change outputs
2022-04-18 17:18:37,311 DEBUG  roonapi -- Finished Roonapi Init
2022-04-18 17:18:37,311 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/browse
2022-04-18 17:18:37,311 DEBUG  roonapi -- _request: sending
2022-04-18 17:18:37,311 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 50, success: False
2022-04-18 17:18:37,361 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 49, success: True
2022-04-18 17:18:37,361 DEBUG  roonapi -- Looking for Library
2022-04-18 17:18:37,361 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 17:18:37,361 DEBUG  roonapi -- _request: sending
2022-04-18 17:18:37,361 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 17:18:37,416 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 17:18:37,416 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/browse
2022-04-18 17:18:37,417 DEBUG  roonapi -- _request: sending
2022-04-18 17:18:37,417 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 50, success: False
2022-04-18 17:18:37,470 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 49, success: True
2022-04-18 17:18:37,470 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 17:18:37,471 DEBUG  roonapi -- _request: sending
2022-04-18 17:18:37,471 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 17:18:37,524 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 17:18:37,524 DEBUG  roonapi -- Looking for Tags
2022-04-18 17:18:37,525 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 17:18:37,525 DEBUG  roonapi -- _request: sending
2022-04-18 17:18:37,525 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 17:18:37,580 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 17:18:37,580 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/browse
2022-04-18 17:18:37,581 DEBUG  roonapi -- _request: sending
2022-04-18 17:18:37,581 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 50, success: False
2022-04-18 17:18:37,633 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 49, success: False
2022-04-18 17:18:37,686 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 17:18:37,688 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 48, success: False
2022-04-18 17:18:37,738 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 47, success: False
2022-04-18 17:18:37,794 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 46, success: False
2022-04-18 17:18:37,849 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 45, success: False
2022-04-18 17:18:37,904 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 44, success: False
2022-04-18 17:18:37,960 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 43, success: False
2022-04-18 17:18:38,010 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 42, success: False
2022-04-18 17:18:38,061 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 41, success: False
2022-04-18 17:18:38,113 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 40, success: False
2022-04-18 17:18:38,168 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 39, success: False
2022-04-18 17:18:38,221 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 38, success: False
2022-04-18 17:18:38,277 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 37, success: False
2022-04-18 17:18:38,329 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 36, success: False
2022-04-18 17:18:38,379 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 35, success: False
2022-04-18 17:18:38,431 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 34, success: False
2022-04-18 17:18:38,484 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 33, success: False
2022-04-18 17:18:38,538 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 32, success: False
2022-04-18 17:18:38,590 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 31, success: False
2022-04-18 17:18:38,641 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 30, success: False
2022-04-18 17:18:38,692 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 29, success: False
2022-04-18 17:18:38,743 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 28, success: False
2022-04-18 17:18:38,795 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 27, success: False
2022-04-18 17:18:38,850 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 26, success: False
2022-04-18 17:18:38,901 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 25, success: False
2022-04-18 17:18:38,919 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 17:18:38,955 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 24, success: False
2022-04-18 17:18:39,008 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 23, success: False
2022-04-18 17:18:39,058 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 22, success: False
2022-04-18 17:18:39,110 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 21, success: False
2022-04-18 17:18:39,161 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 20, success: False
2022-04-18 17:18:39,211 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 19, success: False
2022-04-18 17:18:39,264 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 18, success: False
2022-04-18 17:18:39,319 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 17, success: False
2022-04-18 17:18:39,371 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 16, success: False
2022-04-18 17:18:39,422 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 15, success: False
2022-04-18 17:18:39,472 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 14, success: False
2022-04-18 17:18:39,527 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 13, success: False
2022-04-18 17:18:39,577 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 12, success: False
2022-04-18 17:18:39,627 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 11, success: False
2022-04-18 17:18:39,682 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 10, success: False
2022-04-18 17:18:39,735 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 9, success: False
2022-04-18 17:18:39,788 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 8, success: False
2022-04-18 17:18:39,828 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 17:18:39,839 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 7, success: False
2022-04-18 17:18:39,893 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 6, success: False
2022-04-18 17:18:39,948 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 5, success: False
2022-04-18 17:18:40,003 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 4, success: False
2022-04-18 17:18:40,058 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 3, success: False
2022-04-18 17:18:40,113 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 2, success: False
2022-04-18 17:18:40,166 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 1, success: False
Traceback (most recent call last):
  File "/usr/local/Roon/api/list_tags.py", line 68, in <module>
    tags = roonapi.list_media(output_id, ["Library", "Tags", searchterm])
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/roonapi/roonapi.py", line 455, in list_media
    total_count = self.browse_browse(opts)["list"]["count"]
TypeError: 'NoneType' object is not subscriptable

By the way, I’m assuming the command you wanted me to run shouldn’t have a trailing backtick?

@DaveN , yes the backtick was a typo on my part. Thanks for the debug output. I am reviewing it and comparing it with the debug output from my successful tags listing. The difference seems to be that in your tag listing, when searching for Tags it can load the browse service successfully but then when it tries to browse the browse service it fails to find a match and triggers a callback which indicates that there was a state change with key “zones_seek_changed”.

My successful tag listing is able to both load and browse the browse service when searching for Tags, does not trigger the callback indicating zone seek change, and continues to search for __all__.

Some info is provided by debug level logging but insufficient for me to fully grok what is going on. But it may help isolate the issue to something to do with accessing the browse service for Tags and Genres but not Albums etc. I do not yet understand what triggers the callback or what “zones_seek_changed” might mean. I will pursue this.

To verify, you have gone into Roon’s “My Stuff → Tags” and in the “My Tags” dropdown enabled “Shared Tags” and this did not change the behavior. Correct? Also, what type of Roon Core are you running? Do you have Roon, Roon Server or ROCK?

Yep.

This didn’t make any difference. What’s interesting is that it did work for playlists. It’s also interesting that genres fail too, and they aren’t linked to profiles. I’m not sure why tags and genres and, to a lesser extent, playlists, are different from artists and albums. There’s clearly something odd going on.

I’m running Roon Server on a Mac mini M1 (16GB RAM). I’m also running Roon on the same machine as a client.

You’ve probably already found this thread but, if not, it might be useful.

@DaveN yes, I read that thread. We are handling the callback in the Python Roon API but maybe I did not do it correctly in the list_media method. It’s an area I am looking into.

Can you do another test for me? Play by tag is not yet implemented but play_genre is so I would like to see if you can play a genre in your library even though you cannot list the genres in your library. This will give me a clue as to whether the issue is in my list_media method or not.

Run the command:

python3 /usr/local/Roon/api/play_genre.py -g "<genre>"

where <genre> is the name of a genre in your Roon library. For example:

python3 /usr/local/Roon/api/play_genre.py -g Classical

If it fails I have a debug version of play_genre.py I can get you. If it succeeds, then the problem may be in the list_media method as the play_media method does the same browse_load then browse_browse to locate the media in your library.

Same error …

djn@trinity RoonCommandLine % python3 /usr/local/Roon/api/play_genre.py -g Classical
Traceback (most recent call last):
  File "/usr/local/Roon/api/play_genre.py", line 71, in <module>
    genres = roonapi.list_media(output_id, ["Genres", genresearch])
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/roonapi/roonapi.py", line 455, in list_media
    total_count = self.browse_browse(opts)["list"]["count"]
TypeError: 'NoneType' object is not subscriptable

Oh yeah, play_genre.py calls list_media before it calls play_media so this didn’t do me any good. I still have suspicions about the list_media method. Let me go off and get lost in code for a while and I will ping you when I re-emerge. Thanks for the test.

1 Like

@DaveN , another test if you have time.

This is an updated roonapi.py in the Python Roon API module. It tries to avoid hitting sections of the code that might throw an exception when attempting to access null objects. It may not resolve the issue we are debugging but it should get us further down the execution path. I hope. I’ve tested it here but since I am not yet able to trigger the issue I don’t see how it handles that. If you have time, here is how to test.

First, make a backup copy of the installed roonapi.py so you can restore it later. Locate the roonapi Python module by running:

python3 -m pip show roonapi

The Location: field will tell you where roonapi is installed. For example, it could be something like Location: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages

Change directory to the roonapi Python module, in this example:

cd /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/roonapi

Copy roonapi.py somewhere and replace it with this updated version of roonapi.py

After copying in the updated roonapi.py rerun the debug list_tags.py I sent earlier:

python3 /usr/local/Roon/api/list_tags.py -t __all__

Send the output to me.

Copy the original roonapi.py back in to the roonapi module folder if you prefer stable rather than bleeding edge.

djn@trinity etc % python3 /usr/local/Roon/api/list_tags.py -t __all__
2022-04-18 21:51:16,964 DEBUG  roonapi -- Connecting to Roon server 192.168.68.145:9330
2022-04-18 21:51:16,969 DEBUG  roonapisocket -- Opened Websocket connection to the server...
2022-04-18 21:51:16,969 DEBUG  roonapi -- Connection with roon websockets (re)created.
2022-04-18 21:51:16,969 DEBUG  roonapi -- Confirming previous registration with Roon...
2022-04-18 21:51:16,975 DEBUG  roonapi -- Registered to Roon server Trinity
2022-04-18 21:51:16,975 DEBUG  roonapi -- {'core_id': 'c125499a-264a-4f4b-9166-3a25568f7775', 'display_name': 'Trinity', 'display_version': '1.8 (build 931) stable', 'token': '7dce66b2-7568-40d8-94a0-9bd9e4dde006', 'provided_services': ['com.roonlabs.transport:2', 'com.roonlabs.browse:1'], 'http_port': 9330}
2022-04-18 21:51:16,978 DEBUG  roonapi -- _on_state_change zones
2022-04-18 21:51:16,979 DEBUG  roonapi -- _on_state_change outputs
2022-04-18 21:51:17,020 DEBUG  roonapi -- Finished Roonapi Init
2022-04-18 21:51:17,020 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/browse
2022-04-18 21:51:17,020 DEBUG  roonapi -- _request: sending
2022-04-18 21:51:17,020 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 50, success: False
2022-04-18 21:51:17,075 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 49, success: True
2022-04-18 21:51:17,075 DEBUG  roonapi -- Looking for Library
2022-04-18 21:51:17,075 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 21:51:17,075 DEBUG  roonapi -- _request: sending
2022-04-18 21:51:17,075 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 21:51:17,130 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 21:51:17,130 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/browse
2022-04-18 21:51:17,130 DEBUG  roonapi -- _request: sending
2022-04-18 21:51:17,130 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 50, success: False
2022-04-18 21:51:17,157 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 21:51:17,186 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 49, success: True
2022-04-18 21:51:17,186 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 21:51:17,186 DEBUG  roonapi -- _request: sending
2022-04-18 21:51:17,186 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 21:51:17,241 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 21:51:17,241 DEBUG  roonapi -- Looking for Tags
2022-04-18 21:51:17,241 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 21:51:17,241 DEBUG  roonapi -- _request: sending
2022-04-18 21:51:17,242 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 21:51:17,295 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 21:51:17,295 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/browse
2022-04-18 21:51:17,295 DEBUG  roonapi -- _request: sending
2022-04-18 21:51:17,295 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 50, success: False
2022-04-18 21:51:17,346 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 49, success: False
2022-04-18 21:51:17,401 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 48, success: False
2022-04-18 21:51:17,456 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 47, success: False
2022-04-18 21:51:17,511 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 46, success: False
2022-04-18 21:51:17,567 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 45, success: False
2022-04-18 21:51:17,622 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 44, success: False
2022-04-18 21:51:17,641 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 21:51:17,673 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 43, success: False
2022-04-18 21:51:17,729 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 42, success: False
2022-04-18 21:51:17,784 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 41, success: False
2022-04-18 21:51:17,839 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 40, success: False
2022-04-18 21:51:17,894 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 39, success: False
2022-04-18 21:51:17,949 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 38, success: False
2022-04-18 21:51:18,004 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 37, success: False
2022-04-18 21:51:18,059 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 36, success: False
2022-04-18 21:51:18,114 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 35, success: False
2022-04-18 21:51:18,142 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 21:51:18,170 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 34, success: False
2022-04-18 21:51:18,225 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 33, success: False
2022-04-18 21:51:18,280 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 32, success: False
2022-04-18 21:51:18,335 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 31, success: False
2022-04-18 21:51:18,390 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 30, success: False
2022-04-18 21:51:18,445 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 29, success: False
2022-04-18 21:51:18,500 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 28, success: False
2022-04-18 21:51:18,556 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 27, success: False
2022-04-18 21:51:18,611 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 26, success: False
2022-04-18 21:51:18,643 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 21:51:18,661 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 25, success: False
2022-04-18 21:51:18,716 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 24, success: False
2022-04-18 21:51:18,771 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 23, success: False
2022-04-18 21:51:18,826 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 22, success: False
2022-04-18 21:51:18,881 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 21, success: False
2022-04-18 21:51:18,936 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 20, success: False
2022-04-18 21:51:18,992 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 19, success: False
2022-04-18 21:51:19,047 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 18, success: False
2022-04-18 21:51:19,102 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 17, success: False
2022-04-18 21:51:19,147 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 21:51:19,157 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 16, success: False
2022-04-18 21:51:19,212 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 15, success: False
2022-04-18 21:51:19,267 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 14, success: False
2022-04-18 21:51:19,322 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 13, success: False
2022-04-18 21:51:19,377 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 12, success: False
2022-04-18 21:51:19,433 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 11, success: False
2022-04-18 21:51:19,488 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 10, success: False
2022-04-18 21:51:19,543 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 9, success: False
2022-04-18 21:51:19,598 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 8, success: False
2022-04-18 21:51:19,653 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 7, success: False
2022-04-18 21:51:19,655 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 21:51:19,708 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 6, success: False
2022-04-18 21:51:19,763 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 5, success: False
2022-04-18 21:51:19,819 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 4, success: False
2022-04-18 21:51:19,874 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 3, success: False
2022-04-18 21:51:19,929 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 2, success: False
2022-04-18 21:51:19,984 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 1, success: False
2022-04-18 21:51:20,039 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 21:51:20,039 DEBUG  roonapi -- _request: sending
2022-04-18 21:51:20,039 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 21:51:20,095 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 21:51:20,095 DEBUG  roonapi -- Searching for __all__
No tags found matching  __all__
Traceback (most recent call last):
  File "/usr/local/Roon/api/list_tags.py", line 76, in <module>
    with open(tokenfile, "w") as f:
PermissionError: [Errno 13] Permission denied: '/usr/local/Roon/etc/roontoken.txt'

And in case the ‘permission denied’ is important …

djn@trinity etc % ls -lah
total 72
drwxr-xr-x  8 root  wheel   256B 18 Apr 21:42 .
drwxr-xr-x  6 root  wheel   192B 18 Apr 21:40 ..
-rw-r--r--  1 root  wheel    13K 17 Apr 22:00 postinstall
-rw-r--r--  1 root  wheel   1.7K 17 Apr 22:00 preremove
-rw-r--r--@ 1 root  wheel   104B 18 Apr 21:42 pyroonconf
-rw-r--r--@ 1 root  wheel   1.1K 18 Apr 21:42 roon_api.ini
-rw-r--r--  1 root  wheel   1.2K 17 Apr 22:00 roon_api.ini-dist
-rw-r--r--  1 root  wheel    36B 18 Apr 21:41 roontoken.txt

EDIT: Sorry, posted the wrong output first. I needed to change back to the debugging version.

Thanks! I will look through this for any more clues. It does what I expected, avoids the exceptions we were seeing earlier, gets to the actual search for tags after loading the browse service successfully, but doesn’t find any tags.

The permissions on your /usr/local/Roon/etc/ directory and contents do not look right. The ./Install command should have been run as the user that will be running Roon. It invokes the ./macInstall command and sets ownership of the etc directory and its contents to that user.

So maybe your RoonCommandLine installation failed in some way.

You can manually correct this permissions/ownership error with the command:

sudo chown -R <username> /usr/local/Roon/etc

Where <username> is the username of your RoonCommandLine user (I think that is djn). Maybe there is a bug in the macInstall script. I will review it.

Ran it with sudo …

djn@trinity ~ % sudo python3 /usr/local/Roon/api/list_tags.py -t __all__
Password:
2022-04-18 22:01:57,843 DEBUG  roonapi -- Connecting to Roon server 192.168.68.145:9330
2022-04-18 22:01:57,847 DEBUG  roonapisocket -- Opened Websocket connection to the server...
2022-04-18 22:01:57,847 DEBUG  roonapi -- Connection with roon websockets (re)created.
2022-04-18 22:01:57,847 DEBUG  roonapi -- Confirming previous registration with Roon...
2022-04-18 22:01:57,856 DEBUG  roonapi -- Registered to Roon server Trinity
2022-04-18 22:01:57,856 DEBUG  roonapi -- {'core_id': 'c125499a-264a-4f4b-9166-3a25568f7775', 'display_name': 'Trinity', 'display_version': '1.8 (build 931) stable', 'token': '7dce66b2-7568-40d8-94a0-9bd9e4dde006', 'provided_services': ['com.roonlabs.transport:2', 'com.roonlabs.browse:1'], 'http_port': 9330}
2022-04-18 22:01:57,860 DEBUG  roonapi -- _on_state_change zones
2022-04-18 22:01:57,862 DEBUG  roonapi -- _on_state_change outputs
2022-04-18 22:01:57,899 DEBUG  roonapi -- Finished Roonapi Init
2022-04-18 22:01:57,899 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/browse
2022-04-18 22:01:57,899 DEBUG  roonapi -- _request: sending
2022-04-18 22:01:57,899 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 50, success: False
2022-04-18 22:01:57,954 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 49, success: True
2022-04-18 22:01:57,954 DEBUG  roonapi -- Looking for Library
2022-04-18 22:01:57,954 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 22:01:57,954 DEBUG  roonapi -- _request: sending
2022-04-18 22:01:57,954 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 22:01:58,008 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 22:01:58,009 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/browse
2022-04-18 22:01:58,009 DEBUG  roonapi -- _request: sending
2022-04-18 22:01:58,009 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 50, success: False
2022-04-18 22:01:58,064 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 49, success: True
2022-04-18 22:01:58,064 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 22:01:58,064 DEBUG  roonapi -- _request: sending
2022-04-18 22:01:58,065 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 22:01:58,116 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 22:01:58,116 DEBUG  roonapi -- Looking for Tags
2022-04-18 22:01:58,116 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 22:01:58,117 DEBUG  roonapi -- _request: sending
2022-04-18 22:01:58,117 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 22:01:58,171 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 22:01:58,171 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/browse
2022-04-18 22:01:58,171 DEBUG  roonapi -- _request: sending
2022-04-18 22:01:58,172 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 50, success: False
2022-04-18 22:01:58,227 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 49, success: False
2022-04-18 22:01:58,282 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 48, success: False
2022-04-18 22:01:58,338 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 47, success: False
2022-04-18 22:01:58,390 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 46, success: False
2022-04-18 22:01:58,443 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 45, success: False
2022-04-18 22:01:58,498 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 44, success: False
2022-04-18 22:01:58,554 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 43, success: False
2022-04-18 22:01:58,609 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 42, success: False
2022-04-18 22:01:58,664 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 41, success: False
2022-04-18 22:01:58,719 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 40, success: False
2022-04-18 22:01:58,774 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 39, success: False
2022-04-18 22:01:58,829 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 38, success: False
2022-04-18 22:01:58,884 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 37, success: False
2022-04-18 22:01:58,940 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 36, success: False
2022-04-18 22:01:58,995 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 35, success: False
2022-04-18 22:01:59,050 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 34, success: False
2022-04-18 22:01:59,105 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 33, success: False
2022-04-18 22:01:59,160 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 32, success: False
2022-04-18 22:01:59,215 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 31, success: False
2022-04-18 22:01:59,270 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 30, success: False
2022-04-18 22:01:59,285 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 22:01:59,325 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 29, success: False
2022-04-18 22:01:59,380 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 28, success: False
2022-04-18 22:01:59,436 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 27, success: False
2022-04-18 22:01:59,488 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 26, success: False
2022-04-18 22:01:59,543 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 25, success: False
2022-04-18 22:01:59,598 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 24, success: False
2022-04-18 22:01:59,653 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 23, success: False
2022-04-18 22:01:59,708 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 22, success: False
2022-04-18 22:01:59,763 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 21, success: False
2022-04-18 22:01:59,818 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 20, success: False
2022-04-18 22:01:59,873 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 19, success: False
2022-04-18 22:01:59,906 DEBUG  roonapi -- _on_state_change zones_seek_changed
2022-04-18 22:01:59,929 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 18, success: False
2022-04-18 22:01:59,984 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 17, success: False
2022-04-18 22:02:00,039 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 16, success: False
2022-04-18 22:02:00,094 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 15, success: False
2022-04-18 22:02:00,149 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 14, success: False
2022-04-18 22:02:00,204 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 13, success: False
2022-04-18 22:02:00,259 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 12, success: False
2022-04-18 22:02:00,315 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 11, success: False
2022-04-18 22:02:00,370 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 10, success: False
2022-04-18 22:02:00,425 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 9, success: False
2022-04-18 22:02:00,480 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 8, success: False
2022-04-18 22:02:00,535 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 7, success: False
2022-04-18 22:02:00,590 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 6, success: False
2022-04-18 22:02:00,645 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 5, success: False
2022-04-18 22:02:00,700 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 4, success: False
2022-04-18 22:02:00,756 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 3, success: False
2022-04-18 22:02:00,811 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 2, success: False
2022-04-18 22:02:00,866 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/browse, retry: 1, success: False
2022-04-18 22:02:00,921 DEBUG  roonapi -- _request: command: com.roonlabs.browse:1/load
2022-04-18 22:02:00,921 DEBUG  roonapi -- _request: sending
2022-04-18 22:02:00,921 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 50, success: False
2022-04-18 22:02:00,976 DEBUG  roonapi -- request: command: com.roonlabs.browse:1/load, retry: 49, success: True
2022-04-18 22:02:00,976 DEBUG  roonapi -- Searching for __all__
No tags found matching  __all__

It’s just not seeing any of my tags. So, just in case you were wondering, here’s the first few …

And not all, but at least some of them, are shared …

My bad. I thought I read somewhere that it was better to run ./Install with sudo. I’ve corrected the permissions now and re-ran python3 /usr/local/Roon/api/list_tags.py -t _all … Same output, just without the permissions error.

drwxr-xr-x  8 djn   wheel   256B 18 Apr 21:42 .
drwxr-xr-x  6 root  wheel   192B 18 Apr 21:40 ..
-rw-r--r--  1 djn   wheel    13K 17 Apr 22:00 postinstall
-rw-r--r--  1 djn   wheel   1.7K 17 Apr 22:00 preremove
-rw-r--r--@ 1 djn   wheel   104B 18 Apr 21:42 pyroonconf
-rw-r--r--@ 1 djn   wheel   1.1K 18 Apr 21:42 roon_api.ini
-rw-r--r--  1 djn   wheel   1.2K 17 Apr 22:00 roon_api.ini-dist
-rw-r--r--  1 djn   wheel    36B 18 Apr 22:06 roontoken.txt

EDIT:
And I guess the following is to be expected, given the change in roonapi.py

djn@trinity etc % roon -l genres
No genres found matching __all__

I could imagine that there was something amiss with my tags, but I can’t see how genres could have got messed up too … I definitely have a whole bunch of them :slight_smile:

I’ve some strange behaviour installing RoonCommandLine on my Raspberry Pi (Buster)

Removed the old RoonCommandLine folder. The GIT Cloned using command:

git clone Ron Record / RoonCommandLine · GitLab

A new RoonCommandLine is created. From this new folder I start ./Install and then I get noticed about 2.0.3 versions, not 2.0.5. Any suggestions???

pi@domoticz:~ $ cd RoonCommandLine/
pi@domoticz:~/RoonCommandLine $ ./Install

No packages for version 2.0.3 are currently available.
Would you like to perform a scripted install on this platform?

Install ? (‘Y’/‘N’): y
Install RoonCommandLine version 2.0.3r2 ? (‘Y’/‘N’): ^C