JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174) +---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
- Zarquon - 2010-11-22 Recently noticed a problem. When I switch to another profile and then back to the Master profile, the JSON-RPC no longer responds. Works fine before the switch and after the switch to the other profile but not when I return to the master. It also starts working again if I leave the master profile. Any Ideas? FYI Running Ubuntu 10.04 Dharma RC1 on a Acer Revo 3610 - Installed xbmcFreaks Beta 4 Live CD and upgraded via apt-get to RC1 Edit Additional detail: Here is a link to the xbmc.log http://pastebin.com/44TdNW1m Note I turned on detailed logging after the first change of profile and return. So the JSONRPC worked and didn't as follows:
- grywnn - 2010-11-22 blinkseb Wrote:I've got some free time today, so here we go : http://trac.xbmc.org/ticket/10728You're my hero Music library would be nice, for example to query the review or genres for a specific album. - topfs2 - 2010-11-22 Zarquon Wrote:Recently noticed a problem. When I switch to another profile and then back to the Master profile, the JSON-RPC no longer responds. Works fine before the switch and after the switch to the other profile but not when I return to the master. It also starts working again if I leave the master profile. Please file a trac ticket so it doesn't get lost. - spiff - 2010-11-22 there's already a ticket. - topfs2 - 2010-11-24 For all client creators some changes have happened between RC1 and stable which might be valid to know about which will be in effect in Dharma. GetAnnouncementFlags now returns an object which is the same object you can send to SetAnnouncementFlags. Not that the object is case sensative and the casing is the same as in the getter. Permission have been changed to follow the same schema although there is no way to alter permissions at this point but might be added in next version. Speaking of versions with RC1 jsonrpc was bumped to 2 in Dharma and 3 in trunk. So with this odd numbers refers to development versions and should be considered moving targets and everything can happen with them . Even numbers will be for stable releases. Those that have followed trac there have been quite some activity regarding announcements in version 3 and thanks to blinksebs help jsonrpc is starting to be quite chatty. For the roadmap of version 4 is getting announcements much more reliable and informative. The hope is that the announcements should be enough so that the client just need to keep a state machine and can only get data when an announcement occurs thus lowering the bandwith. Some of the added announcements are UpdateAudio, RemoveAudio, UpdateVideo and RemoveVideo. All these will give you the same data which is a "content" field which tells you what to expect the id to be. The id is named as with the other get calls in the libraries and is usually content + "id", e.g. "tvshowid". Note that there exist no AddFoo as UpdateFoo covers this and an update can be both addition and refresh (just something you need to consider when coding). On the roadmap is also to get the actual permissions sorted and the hope is that we can get that in properly for version 4. I'd love user scenarios and thoughts on the subject but here is some scenarios that will be used for consideration:
1) just means that a client should be able to use the same token on multiple transports. 2) Is harder to fix without sending the token all the time and it might be up to the client to catch the error and re-auth. Any more feature requests for version 4? Any questions? Cheers, Tobias - Montellese - 2010-11-24 Hey I don't know if this is the right place to post this but as I think the problem is related to JSON RPC and XBMCs webserver I thought I'd post it here first and if it's not the right place someone can point me to where to post this best. When I'm running my "XBMC on iMON Display" application using JSON RPC to retrieve all the information from XBMC it often happens that XBMC crashes on shutdown. I did it a few times with debug logging enabled and compared the log files and they always look the same after a crash. This is how the end of the log file looks when the shutdown doesn't crash: Code: 08:31:23 T:5212 M:1053921280 DEBUG: CAnnouncementManager - Announcement: ApplicationStop from xbmc and this is how it looks when it crashes: Code: 08:32:03 T:4660 M:1068199936 DEBUG: CAnnouncementManager - Announcement: ApplicationStop from xbmc Of course the terminated thread numbers vary but I noticed that it never gets to Code: 08:31:23 T:5212 M:1053958144 NOTICE: WebServer: Stopped the webserver I also have an idea why this might be happening: In my application I have an option to enable polling XBMCs CurrentControl info label every 500 ms. This allows to display the label of the current control on the LCD display and therefore it is possible to use XBMC without turning on the TV. BUT on shutdown it might happen that a GetInfoLabels() call is sent right before/after the ApplicationStop announcement arrived. Now XBMC is already shutting down its webserver but receives another request and might not know what to do. I want to emphasize that this is only an idea I had because I noticed that everytime XBMC crashes on shutdown I get errors in the log of my application and when it doesn't crash there are no errors either. I'll see if I can get rid of the calls causing the problem but if it is really as I suspect XBMC shouldn't really crash just because there is some stupid application (which might not listen to the announcements) calls another JSON RPC method when XBMC doesn't expect it. - staeff - 2010-11-24 topfs2 Wrote:Any more feature requests for version 4? Any questions? Hi Tobias, considering this List following request is not yet implemented: I find it very usefull to know what the xbmc-user is currently doing. e.g. Is he in the music menu? Which album has he selected. With this knowledge it should be possible to visualize a smaller UI on LCD displays with other libraries but LCDproc, or even a webpage, but the normal remote control is still the input device. - Montellese - 2010-11-24 staeff Wrote:I find it very usefull to know what the xbmc-user is currently doing. e.g. Is he in the music menu? Which album has he selected. This is what I currently do using the System.CurrentControl and System.CurrentWindow InfoLabels. I know it's an ugly hack and you have to perdiodically poll the information (doing it every 500ms right now) but it works pretty well (apart from the XBMC crashes I mentioned above). I would love to see some support for this using Announcements and I'd be willing to look into the code to do it myself but currently I have absolutely no time at all - blinkseb - 2010-11-24 Montellese Wrote:... Indeed, XBMC should not crash at all, even with bad applications. I'll look at it right now. - Montellese - 2010-11-24 If you need any more informations I'll be happy to provide whatever I can. I played around with my application and optimized it a bit and now it doesn't happen frequently but it still happens. And everytime it happens I get an error in the log of my application that the HTTP request to XBMC failed because it timed out. If XBMC doesn't crash there is no error visible so there must be a connection between the two. I'll try to get read of it completely but the problem would still exist with applications which simply don't listen to the announcements and continue sending JSON RPC calls to XBMC until they get no response anymore. My application listens to the Announcements but as they are not foreseeable it can still happen that it sends a call right before the announcement arrives. - blinkseb - 2010-11-24 Montellese Wrote:If you need any more informations I'll be happy to provide whatever I can. I'll try to spam XBMC with json request every 100ms until it crashes I think it's because the json message is handled between the moment xbmc starts to shutdown and the moment it's actually shutdown. Some object may already be deleted -> crash. - Montellese - 2010-11-24 Two more minor information details I can provide: When it crashes and I tell Windows to start the JIT-Debugger it says: Code: An unhandled Win32 exception occured [3700] And when I start the JIT-Debugger XBMC closes and the Debugger-Output says: Code: The program '[3700] XBMC.exe: Native' has exited with code -1073740777 (0xc0000417). Not sure if this can be of any help. A short google search didn't turn up anything useful on the exit code. - blinkseb - 2010-11-24 Montellese Wrote:Two more minor information details I can provide: I was able to make it crash very easily It's fixed in r35448 (http://trac.xbmc.org/changeset/35448) Thanks for the report! - Montellese - 2010-11-24 blinkseb Wrote:I was able to make it crash very easily It's fixed in r35448 (http://trac.xbmc.org/changeset/35448) Glad to here that. Ah I see the list of all the info labels was already deleted and then JSON RPC tried to access an index in that list which didn't exist anymore. I'm glad I noticed it before you released Dharma stable Question about one of the new additions to XBMC JSON... - giftie - 2010-11-25 I'm trying to use JSON in my script to get around a problem that I have with the different DBs that people use(I don't have a problem about SQLite, just MySQL) I see one of the new additions is GetAlbumDetails. I hope I am structuring the call correctly. I'm not sure which way is the right one. Code: {"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbumDetails", "param": {"albumid": "2"}, "id": 1} or is this correct? Code: {"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbumDetails", "param": {"albumid": 2}, "id": 1} |