1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FIXED KodiCheck: Picture modus bad detection rate

Discussion in 'Bug Reports' started by Brindosch, 15 May 2016.

  1. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    The json input follows no longer the code pattern of Hyperion.
    If someone is able to commit a fix regarding this i would appreciate it.

    Thank you
     
  2. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
  3. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Not sure which version this started, i could confirm it for v15 and v16. If i saw that right, Hyperion expects first a id until it filters for pictures. Which is not given (or no longer) with pictures.
    A method "picture" was sent after a ("\"method\":\"Player.OnPlay\"") and not after a ID

    -> else if (reply.contains("\"id\":666")) -> else if (reply.contains("picture"))
     
  4. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    So we can skip the id check or does it need that as well?
    Do you know if there any Kodi wiki docs for its implementation (on their end)?
     
  5. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
  6. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    And there is another error that could be fixed :D
    Code:
    Kodi Message: {"error":{"code":-32601,"message":"Method not found."},"id":666,"jsonrpc":"2.0"}
     
  7. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Thanks, will compare the changes in API spec and fix tomorrow :)
     
  8. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Would really appreciate it! That we get rid a little bit of annoying bugs. Thank you very much!
     
  9. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Looks like it's mostly the order of the json string that was off (id before spec) as the commands themselves look valid against V6, not sure if there's a good json reader for QT as right now the code is based on string matches which isn't perfect (really would prefer JSON objects) so we can improve that later but first fix :)

    Here's the changed libsrc/xbmcvideochecker/XBMCVideoChecker.cpp for testing :) , can just copy it in and compile.
    Haven't got Kodi around right now for testing but can do that later.

    // Update

    Added missing brace in one of the commands, they only have examples for V4 but those still look fine the way we use it at least:

    http://kodi.wiki/view/JSON-RPC_API/Examples

    Code:
    {"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}
    
    which has the id listed last there instead of before jsonrpc :)

     
    Last edited: 16 May 2016
  10. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Thank you, i will test it tomorrow!
    You just need a Kodi on your dekstop and a Hyperion :)
     
  11. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Installed Kodi and testing now, we might lose some backwards compatibility with (very old) Kodi versions but I don't think that can be helped :)
     
  12. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    No problem i think. V15 V16 should be enough. If you want to update Hyperion you may need to update Kodi too :)
     
  13. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Enabled the Kodi webserver on port 9090 and seeing a successful connection with no errors during playback or pictures however when I display a picture I don't get any lights but not sure how that one is supposed to works as I also have the Hyperion addon installed there.

    Have it setup like this right now:

    Code:
      "xbmcVideoChecker" :
       {
         "xbmcAddress" : "10.1.2.54",
         "xbmcTcpPort" : 9090,
         "grabVideo" : true,
         "grabPictures" : true,
         "grabAudio" : true,
         "grabMenu" : false,
         "grabScreensaver" : true,
         "enable3DDetection" : true
       },
    
     
  14. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    The hyperion log should indicate the switch to the mode.
     
  15. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Ah ok, now I get an error which is a sign that it's least getting a response so will fix the typo and retry :)

    Code:
    KODICHECK INFO: Kodi Message: {"error":{"code":-32700,"message":"Parse error."},"id":n
    
     
  16. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Much better :)

    Code:
    KODICHECK INFO: Kodi Message: {"id":670,"jsonrpc":"2.0","result":{"version":{"major":1│EFFECTENGINE INFO: Cleaning up Python interpreter
    6,"minor":1,"revision":"20160424-c327c53","tag":"stable"}}}
    
    KODICHECK INFO: switching to PHOTO mode
    
    KODICHECK INFO: switching to VIDEO mode
    KODICHECK INFO: Kodi Message: {"id":667,"jsonrpc":"2.0","result":{"item":{"file":"smb:│BLACKBORDER INFO: mode:default
    <ommitted>
    <ommitted>","id":4287,"label":"<ommitted>
    e, Rich Eisen","type":"episode"}}} 
    KODICHECK INFO: Kodi Message: {"id":669,"jsonrpc":"2.0","result":{"stereoscopicmode":{
    "label":"Disabled","mode":"off"}}}
    
    New XBMCvideochecker code is online:

     
  17. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    I also thought it report(ed) the wrong version right?
    Great work Rick!
     
  18. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Kodi version looks ok however not that familiar with it though but the tag and version / revision seems valid :)

    Code:
    {"major":1
    6,"minor":1,"revision":"20160424-c327c53","tag":"stable"}}}
    
    Tmux is messing up my copy / paste again with the multiple screens :p , will make a PR now so we can test on beta branch.
     
  19. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    No, not yours, the old one!
     
  20. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Could be that that it didn't get a valid reply before due to it breaking on the id or Kodi bug :)