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

WIP Windows Grabber

Discussion in 'Development' started by Brindosch, 10 May 2016.

  1. TPmodding

    TPmodding Administrator Staff Member Administrator

    Messages:
    676
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino
    Yeah, would try that too, comment all out, only the framegrabber for the forwarder signals, just only to try
     
  2. Doc.Ex

    Doc.Ex Member

    Messages:
    73
    Hardware:
    RPi2, +PhilipsHue
    I found the error. In the Windows Grabber config it says capture interval. I thought it would be the frequency because the default value is 60. I thought it would be 60 Hz, because that makes sense for capturing a PC screen, especially games. But it is indeed as stated the interval. That means, the default value is 60ms which is 16,7 Hz. That of course results in stuttering. I set it to 10 ms and now I have a buttery smooth 100Hz screen capture.

    But I still have one problem. It only works when I have both screens turned on. Usually I only use one screen, because I am either on the desk, or on my couch. But for whatever reason it does not work when only on screen is enabled. I tried to set the monitor to 0,1,2,3,-1, nothing works and I get the failed to capture error. Any thoughts on that?

    Edit: It also works when I only have the Desktop Monitor only. But that doesn't help because the leds are behind the TV. Could this be a graphics driver problem? I have got the latest driver now and the TV is connected via HDMI while the monitor is connected via DVI.
     
    Last edited: 24 June 2016
    • Like Like x 1
  3. Brindosch

    Brindosch Administrator Administrator

    Messages:
    607
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Not sure if there is a good multi monitor setup implemented
     
  4. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    160
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Multi-monitor can be a bit buggy with the SlimDX library used in this, the monitor index in config should work however with multiple adapters (IGPU + dedicated) and AMD I've seen detection being off (detecting incorrect surface).

    @Doc.Ex thanks for reporting the issue, corrected the default delay to 10ms as I indeed mixed the two up so pushed new release :)
    Will improve auto-detection in a later release so that delay is based on refresh rate.
     
    Last edited: 25 June 2016
  5. Doc.Ex

    Doc.Ex Member

    Messages:
    73
    Hardware:
    RPi2, +PhilipsHue
    No problem :) Another thing that would be nice, maybe also as a long term goal, would be to have the grabber as a service, so that it runs also while no user is logged in.

    Regarding the multi monitor issue. I got a "D3DERR - Invalid call" (I think it was saying that)
    Btw. both displays are connected to the graphics card and referring to the grabber, 0 is my monitor and 1 is my tv. When I only use the monitor (let windows disable the tv output via projection settings) I works using 0 in the config. When I only use the tv, it doesn't matter whether it is set to 0 or 1, it doesn't work for both. How ever the above invalid call error only appears when I set it to 1. A "failed to take screenshot" message appears either way.
     
    • Informative Informative x 1
  6. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    160
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Think we need to add some proper fallback and auto-detection for monitors and include those in an UI as well for manual selection, bit busy with work but added to to-do list for enhancements and will get around to it early next month :)
    Right now it can't always get the right D3D surface for multi-monitor setups which results in that error as there's no info for it to read back, looked at SharpDX which might be a good alternative as well.
     
    • Agree Agree x 1
  7. danielfmo

    danielfmo New Member

    Messages:
    14
    Hardware:
    RPi2, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Hello all,

    First of all thank you for your great work :)

    Now, can someone guide me throw on how to make this work?
    I have an Rpi2 with OSMC running latest version of hyperion with the "Internal frame grabber", "Kodi checker" and JSON and Proto server activated.
    And if I start the HyperionScreenCap in my Windows 10 x64 machine (i5-6600k+GTX970) I see the message "PROTOSERVER INFO: New connection" in the hyperion logs but nothing happens.

    Any help?

    Thank you in advance,
    Daniel
     
  8. Doc.Ex

    Doc.Ex Member

    Messages:
    73
    Hardware:
    RPi2, +PhilipsHue
    Do you have a multimonitor setup? check if the monitor index is correct. For one monitor it is usually 0, but try 1 as well. Also if you have multiple monitors that might cause problems at the moment.
    Furthermore check if the priority value of the windows grabber is lower than that of the framegrabber in the hyperion config. lower channel means higher priority.
     
  9. danielfmo

    danielfmo New Member

    Messages:
    14
    Hardware:
    RPi2, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Thank you for the help,

    But unfortunately still no luck.

    I have only one monitor connected using HDMI, I've tried the values 0, 1 and 2 for monitor index.
    Priority on config file is 10, others are 790 and 810.
    I've also started HyperionScreenCap in administrator mode.

    Does the HyperionScreenCap start immediately to capture, desktop included? Or I must start an application?
     
  10. Doc.Ex

    Doc.Ex Member

    Messages:
    73
    Hardware:
    RPi2, +PhilipsHue
    It captures right away. If it fails to capture it spits out an error message via a windows notification. Keep in mind that, after every change to the config, you have to restart the grabber. Double clicking the tray icon does not reinitialise with the updated config.
     
  11. danielfmo

    danielfmo New Member

    Messages:
    14
    Hardware:
    RPi2, 32/64bit, +Arduino, +nodeMCU/ESP8266
    I've just used wireshark to check if something is being sent, but nothing other than the TCP handshake.
    Is there a way to start HyperionScreenCap in "debug mode" and have real time logs?
     
  12. Doc.Ex

    Doc.Ex Member

    Messages:
    73
    Hardware:
    RPi2, +PhilipsHue
    That I can not answer, @Rick164 can help you there I guess. There is however a debug level entry in the config, but I am not sure how much info you can get out of it.
     
  13. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    160
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Not easy to debug yet but you do have multiple notifcation level options for the config:

    No messages
    <add key="notificationLevel" value="None"/>

    All messages both debug and error
    <add key="notificationLevel" value="Info"/>

    Only error messages
    <add key="notificationLevel" value="Error"/>

    Uploaded version which has Info notifcation level in config and will also write a debug.log file to the app location:

    https://1drv.ms/u/s!Aik_1r9bUPQAihD1ueGyKzg-5uhI
     
  14. danielfmo

    danielfmo New Member

    Messages:
    14
    Hardware:
    RPi2, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Thanks a lot,
    I just get an "Connected to Hyperion server on 192.168.0.110!" message in the debug.log and nothing else.
    Any suggestions?

    Thank you all.
     
  15. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    160
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Maybe it can't read out the surface for some reason but it should report an error then, might be that you set it to the Hyperion JSON port instead of the ProtoBuffer port.
    Both will connect but only ProtoBuffer port (19445) will work so worth double checking :)
     
  16. danielfmo

    danielfmo New Member

    Messages:
    14
    Hardware:
    RPi2, 32/64bit, +Arduino, +nodeMCU/ESP8266
    I've double checked and it's correct. Actually as in a previous post I get the message "PROTOSERVER INFO: New connection" in the hyperion logs, so I guess that the connection is properly handled.

    As a developer and tester myself it would be a pleasure if I can somehow help you debugging this, though I'm not an expert with Visual Studio.
    I'll give it a try and let you know if I'm able to find anything.

    Regards
     
  17. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    160
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Another thing to try is to clear all priorities via the app or hyperion-remote, because maybe another process (Kodi for instance) is claiming access with a higher priority :)
    Will double check the priority code in case it's hard coded but believe that was migrated from AtmoLight correctly.
     
  18. danielfmo

    danielfmo New Member

    Messages:
    14
    Hardware:
    RPi2, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Found out why I don't get any notification, I was facing THIS issue with Windows :/

    Now I get the error D3DERR_INVALIDCALL (-2005530516) :(

    Also disabled everything except the JSON/protobuffer

    Any other clue?
     
    • Like Like x 1
  19. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    160
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    That invalid call usually means it can't read the DirectX surface (failed to attach), if it's only one monitor at index 0 it should have worked.
    Could you post your config and hardware specs + used OS, only tested here on gtx900/1000 series and intel IGP (HD520) on Windows 8.1 / 10 so far but worked right away :)

    Some other process might also be claiming exclusive access (game / directx interface) but that is pretty rare.
     
  20. danielfmo

    danielfmo New Member

    Messages:
    14
    Hardware:
    RPi2, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Hi,

    So bellow is the config that I use plus the DxDiag file with my PC specs in attachement.
    Regarding the exclusive access... I use rainmeter in my desktop, but I've also tried with it disabled and all other background programs including Kaspersky and MSI afterburner, still no luck.


    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <appSettings>
    <add key="hyperionServerIP" value="192.168.0.110"/>
    <add key="hyperionServerPort" value="19445"/>
    <add key="hyperionMessagePriority" value="10"/> <!-- Lower number means higher priority -->
    <add key="hyperionMessageDuration" value="1000"/> <!-- How long will each captured screenshot stay on LEDs -->
    <add key="width" value="64"/> <!-- Keep these values small -->
    <add key="height" value="64"/> <!-- Keep these values small -->
    <add key="captureInterval" value="10"/>
    <add key="notificationLevel" value="Info"/>
    <add key="monitorIndex" value="0"/> <!-- 0 is the main monitor -->
    </appSettings>
    <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup>
    </configuration>
     

    Attached Files: