Hi
I’ve been trying to use the automation API (downloaded 0.9.0 wheel and installed in python3.9.13, with Logic 2.3.59) on an M1 Mac. When I try and use the python API to launch Logic2
manager = automation.Manager.launch(application_path="/Applications/Logic2.app/Contents/MacOS/Logic")
It fails about 50% of the time with this message:
Traceback (most recent call last):
File "/Users/robertd/development/sandbox/salaea/salae.py", line 5, in <module>
manager = automation.Manager.launch(application_path="/Applications/Logic2.app/Contents/MacOS/Logic")
File "/Users/robertd/development/sandbox/salaea/lib/python3.9/site-packages/saleae/automation/manager.py", line 362, in launch
return cls(address=_DEFAULT_GRPC_ADDRESS, port=_DEFAULT_GRPC_PORT, logic2_process=process)
File "/Users/robertd/development/sandbox/salaea/lib/python3.9/site-packages/saleae/automation/manager.py", line 296, in __init__
raise exc from None
File "/Users/robertd/development/sandbox/salaea/lib/python3.9/site-packages/saleae/automation/manager.py", line 281, in __init__
app_info = self.get_app_info()
File "/Users/robertd/development/sandbox/salaea/lib/python3.9/site-packages/saleae/automation/manager.py", line 380, in get_app_info
reply: saleae_pb2.GetAppInfoReply = self.stub.GetAppInfo(saleae_pb2.GetAppInfoRequest())
File "/Users/robertd/development/sandbox/salaea/lib/python3.9/site-packages/grpc/_channel.py", line 946, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/Users/robertd/development/sandbox/salaea/lib/python3.9/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses"
debug_error_string = "{"created":"@1662738152.548349000","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3218,"referenced_errors":[{"created":"@1662738152.548349000","description":"failed to connect to all addresses","file":"src/core/lib/transport/error_utils.cc","file_line":165,"grpc_status":14}]}"
The other 50% of the time it runs to completion and grabs my traces. Note, I don’t see this problem if I instead manually start the APP and then use run my remaining automation script to capture traces.
automation.Manager.connect()
I’m wondering if it is possibly a timing issue waiting for the Logic.app to start, connect to the logic device, etc, before it starts querying it? I do notice about 10 seconds of delay for the app to get spawned and perform it’s initialization, connection, etc.
Regards,
Robert