JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC

  Thread Rating:
  • 8 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Mizaki Offline
Fan
Posts: 726
Joined: Apr 2011
Reputation: 14
Post: #1906
I've figured out where I went wrong. When turning on the remote control option you have to exit XBMC and restart for it to take effect. Switching off works without a restart. This is for "other systems", I don't know about local.

[Image: watched-clearlogo.jpg]
AWXi - Ajax web interface. Wiki
find quote
Mizaki Offline
Fan
Posts: 726
Joined: Apr 2011
Reputation: 14
Post: #1907
To confirm all Player.OnPlay give the error:
Code:
Received unexpected continuation frame.
and closes the socket.

[Image: watched-clearlogo.jpg]
AWXi - Ajax web interface. Wiki
find quote
Mizaki Offline
Fan
Posts: 726
Joined: Apr 2011
Reputation: 14
Post: #1908
Question Sunday: Is there a reason why I can't request the "file" property for albums?

I do it with TV Shows to get the logo's and I'm thinking of seeing what I can do with the cdart files in case you want to know why.

[Image: watched-clearlogo.jpg]
AWXi - Ajax web interface. Wiki
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #1909
I'll have to look into both the "Received unexpected continuation frame" and the "other systems" setting not being available immediately after changing it. Could you please create bug tickets for these and CC me so I don't forget. Thanks.

IIRC the initial reasoning behind "file" not being available for albums (and artists) is because an album may be scattered over multiple directories so there's no "unique" path to the album. But the same reasoning could apply to tvshows. I guess a feature request can't hurt Wink

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: badge.gif]
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #1910
@Montellese: The same argument does apply to tvshows (which the db handles really badly - multiple ids for a show rather than multiple paths and a single id).

@Mizaki: I think the main problem here is you shouldn't need to assume anything about where images may or may not lie, and furthermore you shouldn't assume you have access to said potential images on the filesystem.

You may, however, assume that filesystem access can and will be shutdown come Frodo. Hopefully by then you won't need it for what you're doing Smile

Cheers,
Jonathan

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: badge.gif]
find quote
Mizaki Offline
Fan
Posts: 726
Joined: Apr 2011
Reputation: 14
Post: #1911
Done.

Artists isn't so much of a problem as I do the same the skins and require people to enter the path.

[Image: watched-clearlogo.jpg]
AWXi - Ajax web interface. Wiki
find quote
N3MIS15 Offline
Donor
Posts: 504
Joined: Jul 2010
Reputation: 13
Location: Melbourne, VIC
Post: #1912
(2012-05-06 13:28)Mizaki Wrote:  To confirm all Player.OnPlay give the error:
Code:
Received unexpected continuation frame.
and closes the socket.
Same here.

Using python websocket client lib i get
Code:
string index out of range
Also happens on ffd/seek
find quote
sjroesink Offline
Junior Member
Posts: 4
Joined: May 2012
Reputation: 0
Post: #1913
(2012-05-07 08:16)N3MIS15 Wrote:  
(2012-05-06 13:28)Mizaki Wrote:  To confirm all Player.OnPlay give the error:
Code:
Received unexpected continuation frame.
and closes the socket.
Same here.

Using python websocket client lib i get
Code:
string index out of range
Also happens on ffd/seek

Yeah, this is very annoying.

@Montellese: this error seems to occur when the message contains 0x00 (new line perhaps?)

For those interested: websockets can be debugged using fiddler (see the Log tab). The only problem is that fiddler throws an exception when the error "Received unexpected continuation frame" occurs:
Quote:13:35:29:0439 [WebSocket #222] Server->Client (150 bytes)
TYPE: TEXT.
MESSAGE: 13:35:29:0468 [WebSocket #222] Read from Client returned error: 0
13:35:29:0898 Close WebSocket Tunnel: at System.Environment.get_StackTrace()
at Fiddler.WebSocket.CloseTunnel()
at Fiddler.WebSocket.OnClientReceive(IAsyncResult ar)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
13:35:29:0917 [WebSocket #222] Read from Server failed... Object reference not set to an instance of an object.
13:35:29:0927 Close WebSocket Tunnel: at System.Environment.get_StackTrace()
at Fiddler.WebSocket.CloseTunnel()
at Fiddler.WebSocket.OnRemoteReceive(IAsyncResult ar)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
find quote
Tolriq Offline
Donor
Posts: 2,377
Joined: Jun 2009
Reputation: 70
Location: France
Post: #1914
Hello,

2 little questions Smile

Why is VideoLibrary.GetSeasons parameter tvshowid mandatory when it's not the case for GetEpisodes for examples. Getting all seasons for all shows makes a lot's of requests when it's not needed for episodes (and it's good Tongue)

And other one about performances, it seems on some low end Xbmc machine a query that will return more than 1000 results will be really really really really .... slow, is it due to slow database or too much data to encode to Json ?
(Well the final question is : Does putting limits to query to get bunch of say 500 items will be quicker or slower).

Yatse 2 : Media Center Remote Control for Touch Screens
Yatse, the Xbmc Remote and Widgets for Android
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #1915
(2012-05-11 21:04)Tolriq Wrote:  Why is VideoLibrary.GetSeasons parameter tvshowid mandatory when it's not the case for GetEpisodes for examples. Getting all seasons for all shows makes a lot's of requests when it's not needed for episodes (and it's good Tongue)
Because up until a few days ago XBMC didn't really store seasons. It just stored tvshows and episodes and then season were deduced from the episodes. That's also why there is no "seasonid" (compared to "tvshowid" and "episodeid") so XBMC doesn't offer a method to retrieve all seasons (and IMO it doesn't really make any sense either).

(2012-05-11 21:04)Tolriq Wrote:  And other one about performances, it seems on some low end Xbmc machine a query that will return more than 1000 results will be really really really really .... slow, is it due to slow database or too much data to encode to Json ?
(Well the final question is : Does putting limits to query to get bunch of say 500 items will be quicker or slower).
It's because of the database queries. Especially if you retrieve properties like "cast" or "resume" or "set" it will get really slow because it has to do an extra query for every retrieved item. Currently it also won't be faster if you put a limit on the item retrieval but I have some unfinished work which will improve that.

So the best you can do is not to retrieve those properties I mentioned (they are also mentioned in introspect so you might wanna check there because I might have forgotten one or two) when using FooLibrary.GetFoo and only retrieve those properties with FooLibrary.GetFooDetails.

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: badge.gif]
find quote
Tolriq Offline
Donor
Posts: 2,377
Joined: Jun 2009
Reputation: 70
Location: France
Post: #1916
Well yes getting all seasons does not makes sense but Xbmc is really stupid on season thumbs Smile Since the thumb can't be calculated because of language translations (ie the thumb value change if you change xbmc language ....) it's very hard to get them, so the GetSeasons is great for that and creating seasons from episodes does not work Sad
For full datasync for off-line browsing getting allseasons of all show in one query is interesting for remote writers.

About performances for example for audio songs I only get : DetailsSong.ALBUM, DetailsSong.TRACK, DetailsSong.ALBUMID, DetailsSong.ARTISTID, DetailsSong.ALBUMARTIST, DetailsSong.DURATION, DetailsSong.THUMBNAIL, DetailsSong.GENRE, DetailsSong.TITLE, DetailsSong.ARTIST, DetailsSong.YEAR those should not slow the query.
But on some Xbmc it can takes more than 30sec to get the result for 20k songs. (And I really mean 30 secs to get the first { not to download the data).

Yatse 2 : Media Center Remote Control for Touch Screens
Yatse, the Xbmc Remote and Widgets for Android
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #1917
Tolriq: Also merged in the May window was moving video thumbs to the texture cache. No more silly storage techniques for them now. Smile

ATM they're not retrievable over the webserver - Montellese and I are deciding the best way to get them there (backward compatibility concerns + how to best move away from using the VFS for it) at the moment, so I expect that it will be ironed out in the next week or so.

Cheers,
Jonathan

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: badge.gif]
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #1918
(2012-05-11 21:33)Tolriq Wrote:  About performances for example for audio songs I only get : DetailsSong.ALBUM, DetailsSong.TRACK, DetailsSong.ALBUMID, DetailsSong.ARTISTID, DetailsSong.ALBUMARTIST, DetailsSong.DURATION, DetailsSong.THUMBNAIL, DetailsSong.GENRE, DetailsSong.TITLE, DetailsSong.ARTIST, DetailsSong.YEAR those should not slow the query.
But on some Xbmc it can takes more than 30sec to get the result for 20k songs. (And I really mean 30 secs to get the first { not to download the data).

Well 20k songs is a lot of data to retrieve from the database and to write into JSON and will result in a huge JSON-RPC response. If the machine is an ATV or something like that it will take a while. The best solution to get around this would be to only retrieve e.g. 200 songs with one request so you can already display those but that approach currently doesn't make it faster, but like I said I'm working on that.

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: badge.gif]
find quote
Tolriq Offline
Donor
Posts: 2,377
Joined: Jun 2009
Reputation: 70
Location: France
Post: #1919
Good news for the texture cache Smile This will also allow easy cleanup.
I hope the new out of VFS way will still allow to get multiple thumb at once.

About songs or other big data, the final goal is not to just display but but make full database sync, for off-line remote browsing for example.
This will be less a problem in Frodo due to dateAdded and such new fields but not an easy task in Eden.

Is there a timeout in Xbmc Web Server part that would make such very long request to fail ? Like 60s or something ? I think I'll stick to get a full data request since you said it would be slower to get multiple request and I can play with read uncommitted on my client side.

Yatse 2 : Media Center Remote Control for Touch Screens
Yatse, the Xbmc Remote and Widgets for Android
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #1920
(2012-05-12 11:34)Tolriq Wrote:  Good news for the texture cache Smile This will also allow easy cleanup.
I hope the new out of VFS way will still allow to get multiple thumb at once.
What do you mean by "get multiple thumbs at once"? Multiple HTTP requests in parallel? That will not change.

(2012-05-12 11:34)Tolriq Wrote:  Is there a timeout in Xbmc Web Server part that would make such very long request to fail ? Like 60s or something ?
XBMC's webserver has a timeout of 24 hours Wink but your browser or your HTTP implementation may have it's own timeout.

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: badge.gif]
find quote
Post Reply