Thread Rating:
  • 0 Vote(s) - 0 Average
JSON blocking/timeout with Player.Open
#1
When starting a playlist of images using Player.Open thru a JSON request, I get no reply until the player is stopped.
Is this correct behaviour ?

This is rather annoying as it causes plugin code to completely hang.
First observed using the python api, I confirmed with curl as well.
I'm running Kodi 17.0 under Ubuntu Linux.

The request which hangs is:
{"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"playlistid":2}},"id":1}

Thank you for your help.
Reply
#2
There are quite a few RPC calls that you can make to Kodi that cause the api to stall. Just use a fire-and-forget method to send this command. You don't really care for the response anyway as it is likely to just be "OK".

Another example of an apparent hang is if you open a ISO file that has multiple tracks. The UI pops up a window asking you which track you want to open and the api will not respond to the command until this choice is made.

Another example is if you activate the Favourites window. {"id":1,"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"favourites"}}

Just send any ActivateWindow or Player.Open commands async
Reply
#3
Thanks for the explanation.
Cant seem to find an asynchronous option directly using the pythonAPI executeJSONRPC function but I'll work around it some other way.
Reply
#4
(2017-02-19, 19:48)mattm Wrote: When starting a playlist of images using Player.Open thru a JSON request, I get no reply until the player is stopped.
Is this correct behaviour ?

This is rather annoying as it causes plugin code to completely hang.
First observed using the python api, I confirmed with curl as well.
I'm running Kodi 17.0 under Ubuntu Linux.

The request which hangs is:
{"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"playlistid":2}},"id":1}

Thank you for your help.

I just upgraded from v15.0 to v17.3 on Android and this behavior is new to v17.3 (compared to v15.0). This is a bug.

What I mean by bug is that it's not described in the documentation. If you have code that checks for the OK status to know that the command was sent correctly, that it was formatted correctly, then this behavior breaks that code.

I'm using curl and the lack of a response is blocking. Any help would be appreciated.

Update: Not all my code is in curl. My other programs are proving difficult to fix because, even if I fire/forget the request the request later times out throwing an exception. This means I have to async not only the request but a try/catch wrapper around the command that eats the exception. This basically prevents me from trapping of errors like "system offline" or malformed request, etc.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
JSON blocking/timeout with Player.Open00