OpenELEC Testbuilds for RaspberryPi Part 2
(2014-03-20, 00:08)MilhouseVH Wrote:
(2014-03-19, 23:15)606u Wrote:
(2014-03-19, 22:42)MilhouseVH Wrote: @606u: turn on debug log (wiki), specifically JSON logging, and I'm pretty sure the reason for increased load will become clear. Unfortunately some smartphone remotes are just not that smart...
Here it is.

Pretty much as suspected, the remote control app is spamming the client with JSON requests several times a second, most likely to maintain it's own state (what's playing, seek positiion etc.). Most (if not all of these) JSON requests are completely unnecessary, as the app could get the same information via JSON notifications without spamming the client.

Code:
23:06:29  62.758083 T:2667574352   DEBUG: JSONRPC: Incoming request: {"method":"Player.GetProperties","id":-472574362,"jsonrpc":"2.0","params":{"playerid":1,"properties":["percentage","time","totaltime","partymode","position","canrepeat","canshuffle","repeat","shuffled","canseek"]}}
23:06:29  62.760704 T:2794067024   DEBUG: JSONRPC: Incoming request: {"method":"Player.GetItem","id":-613133993,"jsonrpc":"2.0","params":{"playerid":1,"properties":["album","artist","title","thumbnail","track","studio","showtitle","episode","season"]}}
23:06:29  62.881805 T:2794067024   DEBUG: GetMovieId (nfs://192.168.0.2/c/media/Series/Lilo & Stitch. The Series/s01e01 Richter (513).m4v), query = select idMovie from movie where idFile=467
23:06:29  62.891171 T:2794067024   DEBUG: GetEpisodeId (nfs://192.168.0.2/c/media/Series/Lilo & Stitch. The Series/s01e01 Richter (513).m4v), query = select idEpisode from episode where idFile=467
23:06:29  63.084656 T:2667574352   DEBUG: webserver: request received for /jsonrpc
23:06:29  63.085541 T:2667574352   DEBUG: JSONRPC: Incoming request: {"method":"XBMC.GetInfoLabels","id":456093242,"jsonrpc":"2.0","params":{"labels":["MusicPlayer.Codec","MusicPlayer.SampleRate","MusicPlayer.BitRate","VideoPlayer.VideoResolution","VideoPlayer.VideoAspect"]}}
23:06:30  63.725456 T:2794067024   DEBUG: webserver: request received for /jsonrpc
23:06:30  63.726749 T:2794067024   DEBUG: JSONRPC: Incoming request: {"method":"Player.GetActivePlayers","id":1121127974,"jsonrpc":"2.0","params":{}}

Note how there are two separate threads (T:2667574352 and T:2794067024) on the Pi both responding to JSON requests, suggesting that you have the same app running on two iOS devices and that when you start playing a movie on the XBMC client the app on each device goes into overdrive spamming the XBMC client with JSON requrests just to maintain it's own internal state. If you add this app to a third iOS device... well, you can see the problem, eventually you won't be able to play movies! ...

I've made a new log and verified with netstat:
Code:
# netstat -tn
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 192.168.0.108:22        192.168.0.106:51017     ESTABLISHED
tcp        0      0 192.168.0.108:80        192.168.0.102:54350     ESTABLISHED
tcp        0      0 192.168.0.108:756       192.168.0.2:2049        ESTABLISHED
tcp        0      0 192.168.0.108:80        192.168.0.102:54345     ESTABLISHED
tcp        0      0 ::ffff:192.168.0.108:9090 ::ffff:192.168.0.102:54346 ESTABLISHED

Multiple threads are servicing RPC requests (multiple libmicrohttpd threads visible in top), but there is only a single iOS client (192.168.0.102). Will take a look in the App Store for alternative remote control apps.


Messages In This Thread
RE: OpenELEC Testbuilds for RaspberryPi Part 2 - by 606u - 2014-03-20, 19:23
AW: RE: - by DieterLumpen - 2013-07-29, 20:50
include guires switch? - by hpbaxxter - 2013-08-01, 21:46
RE: dual audio?? - by pootler - 2013-08-03, 17:13
Help, watch 3D Film on Non 3D TV - by unix72 - 2013-08-09, 12:39
Remote Controllers - by tfft - 2013-08-14, 09:11
rbej repeatable crash - by RichG - 2013-08-19, 12:43
New Tester - by theneverstill - 2013-10-03, 17:16