JSON query while buffering video
#1
I've been working on background updating for PseudoTV. I found out that if I use executeJSONRPC in a seperate Python thread, the main thread will not run until the call has returned. I found that if I made the call through the web server then the second thread will wait for the response and the main thread still runs. Wonderful.

Just today, though, I see a seperate issue: I believe that while the thread is waiting for the JSON response (which could take in upwards of 10-15 seconds) then XBMC won't continue buffering the currently playing video. Is this a known issue? Is there any way I can get around it?
Reply
#2
Jason102 Wrote:I've been working on background updating for PseudoTV. I found out that if I use executeJSONRPC in a seperate Python thread, the main thread will not run until the call has returned. I found that if I made the call through the web server then the second thread will wait for the response and the main thread still runs. Wonderful.

Just today, though, I see a seperate issue: I believe that while the thread is waiting for the JSON response (which could take in upwards of 10-15 seconds) then XBMC won't continue buffering the currently playing video. Is this a known issue? Is there any way I can get around it?

It almost sounds like xbmc doesn't have buffering as a priority job..

BTW.. what query are you doing that takes that long?

Pulling all the info from my Movie Library only takes about 600ms...
Reply
#3
Jason102 Wrote:I've been working on background updating for PseudoTV. I found out that if I use executeJSONRPC in a seperate Python thread, the main thread will not run until the call has returned. I found that if I made the call through the web server then the second thread will wait for the response and the main thread still runs. Wonderful.

Just today, though, I see a seperate issue: I believe that while the thread is waiting for the JSON response (which could take in upwards of 10-15 seconds) then XBMC won't continue buffering the currently playing video. Is this a known issue? Is there any way I can get around it?

the executeJSONRPC will commence in the thread its called from, however depending on the action it might need to wait for mainthread to execute.

This behaviour is exactly the same in webserver although there you have one thread for webserver which processes the message and your python thread waiting for response of the webserver.

I need more info but it could be that the GIL is hold during the execution of the jsonrpc which would depending on the action cause this. I would need a full debug log, stacktrace and everything so I could reproduce.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#4
My query is Files.GetDirectory with a smart playlist as the parameter...it also specifies a few fields to grab for each video.

So as I said, the Python works just fine as long as the background thread uses the web server for the JSON call. The problem is that (based on what I see at least) XBMC stops buffering the playing video while completing the JSON query. Is there any way I can determine this for sure? I'm sure I could put in a trace in whatever function handles buffering and make a custom build, but I'd prefer a simpler way. If there is no simpler way, can someone point me to the function (or file) responsible for buffering video?
Image
Channel surfing for your video library
Development Blog Repository
Reply
#5
please create a script which causes the behaviour and upload it to trac and cc me and montellese. Add a Debug Log and a stack trace (plenty of info on the wiki about how to do those)
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply

Logout Mark Read Team Forum Stats Members Help
JSON query while buffering video0