Windows screensaver and Hyperion

  • In the Windows interface everything works fine, when watching Videos, the same. But when the screensaver is activated (e.g. photo display), Hyperion still transmits colours from the desktop and not from the screensaver, is there any way to fix this?

    Windows 10 + Hyperion 2.0.15 + Direct X Screen grabber + WLED

    • Offizieller Beitrag

    Start the Screensaver with Locking then Hyperion Idle mode will kick in.

    Only Locking or Suspend will trigger Idle or suspend mode (see release notes). Just a Screensaver on Windows is not enough (this is different on Linux).


    In Idle mode, all instances, components will be disabled besides the output processing (LED-Devices, smoothing).

    The current priorities will be cleared and the background effect per instance will be executed, if enabled.


    In case you do not run a background effect, the LEDs switch of.

  • I checked it by changing the wallpaper on the desktop, waiting, the screensaver came on, when the wallpaper was changed the display changed to LEDs. So I understand Hyperion is working, but it's grabbing the image on the desktop.

    The screensaver is not in locking mode, i.e. wiggle the mouse or keyboard and go straight to the desktop.

    • Offizieller Beitrag

    On Windows the Idle mode is not triggered by Screensaver, but screen locking.

    Do not expect that the screensaver without locking will switch off LEDs.

    • Offizieller Beitrag

    You and everybody else can contribute to the project and enhance/change the functionality.


    I have not found an easy way, given that hyperion runs without a window and Windows Screensaver is linked to windows.

    But it might also be because of my limited Windows skills….


    Alternatively, you can switch to Linux, there it works :)

  • This not Help?

    Windows.UI.Composition-Win32-Samples/cpp/ScreenCaptureforHWND at master · microsoft/Windows.UI.Composition-Win32-Samples
    Windows.UI.Composition Win32 Samples. Contribute to microsoft/Windows.UI.Composition-Win32-Samples development by creating an account on GitHub.
    github.com

    Screen Capture Specific Window
    Is it possible to screen capture a specific window (also possibly of another process)? Currently I am capturing the entire desktop of a specific monitor,…
    stackoverflow.com

    PS: I've looked at the source code, so far it's hard to understand the structure and how it all works...

    • Offizieller Beitrag

    This not Help?

    Eh.. NO.

    The links are about capturing screens...


    You need to look for how to identify the event that the screensaver kicked in while the application (Hyperion) has no window.

    You can then update the code here
    and do a emit lock(true) to trigger Hyperion's behaviour on screensaver/locking.

  • You need to look for how to identify the event that the screensaver kicked in while the application (Hyperion) has no window.

    If there is an active screensaver window, then the screensaver is enabled. In Windows the screensaver window has its own name. And there is a HWID. But I'll have a look, I think we did something similar in Mediaportal.


    There is no window (if I'm not mistaken) at the services. But the events they receive ... have to look at the documentation.

    • Offizieller Beitrag

    If there is an active screensaver window, then the screensaver is enabled.

    Until now, I avoided to do active polling, if there is an active Screengrabber.

    The current code is event driven.

  • Lord-Grey

    Look https://github.com/MediaPortal…n32Functions.cs#L244-L249

    Code
    SPI_GETSCREENSAVERRUNNING
    0x0072
    Determines whether a screen saver is currently running on the window station of the calling process. The pvParam parameter must point to a BOOL variable that receives TRUE if a screen saver is currently running, or FALSE otherwise. Note that only the interactive window station, WinSta0, can have a screen saver running.

    SystemParametersInfoW function (winuser.h) - Win32 apps
    Retrieves or sets the value of one of the system-wide parameters. (Unicode)
    learn.microsoft.com


    Until now, I avoided to do active polling, if there is an active Screengrabber.

    The current code is event driven.

    Got it, i.e. we need to find an event that occurs when the screensaver starts. I'll keep looking. :)


    At first glance, does this solution look like the right one?

    Screen Saver notifications


    I'll try this option if I can build Hyperion from the source code :)

    Code
    private const int WM_SYSCOMMAND = 0x0112;
    private const int SC_SCREENSAVE = 0xF140;
    
    if (m.Msg == WM_SYSCOMMAND && (m.WParam.ToInt32() & 0xfff0) == SC_SCREENSAVE) ScreenSaverActive();

    5 Mal editiert, zuletzt von ajs () aus folgendem Grund: Merged a post created by ajs into this post.

    • Offizieller Beitrag

    I'll try this option if I can build Hyperion from the source code

    Great. Give it a try!


    "Your top-level application window gets a WM_SYSCOMMAND message with WParam == SC_SCREENSAVER"

    Bear in mind that Hyperion has no top-level window and therefore you might not see the SC_SCREESAVER event.
    Only in case you are wondering...

  • and do a emit lock(true) to trigger Hyperion's behaviour on screensaver/locking.

    I probably don't understand how Hyperion works, but if we have Lock, as in your example, Hyperion stops working and just waits for Unlock.

    But in case of screensaver we don't get WM_POWERBROADCAST or WM_WTSSESSION_CHANGE event and Hyperion continues to work. It is supposed to continue capturing screen content (in our case the screensaver image) and should synchronize it with the LED strip. But it does not.

    Or am I wrong again?

    • Offizieller Beitrag

    As outlined before.

    I was not able to find an easy way to identify screensaver events on Windows without polling (maybe due to my lack of knowledge and/or understanding).

    Therefore, on Windows the screensaver scenario is not identified by Hyperion and Hyperion continues grabbing the screen painted by the screensaver.

    The only scenario where the screen is not grabbed in a screensaver scenario, is when you do a screensaver with screen locking.
    There the screen locking event will trigger Hyperion's idle state.


    Edit: I assume that you use Hyperion‘s internal Screengrabber and not an external one.

  • Therefore, on Windows the screensaver scenario is not identified by Hyperion and Hyperion continues grabbing the screen painted by the screensaver.

    For some reason it doesn't grab the screensaver image, grab the contents of the screen that was there before the screensaver was called up. The screensaver is in normal mode, without locking. The screensaver is out of the box, showing a photo on the screen from a folder.

    How can you check what is happening when the screensaver is called?


    I was not able to find an easy way to identify screensaver events on Windows without polling (maybe due to my lack of knowledge and/or understanding).

    I couldn't find it either, just check in a loop to see if the screensaver is working or not. Maybe Hyperion has some process that runs at least once every couple of seconds? And add a check there? Of course, you could run a timer in the next thread and check it ... But I'm not an expert here.

    Einmal editiert, zuletzt von ajs () aus folgendem Grund: Merged a post created by ajs into this post.

    • Offizieller Beitrag

    How can you check what is happening when the screensaver is called?

    ajs You can open the UI from a different device and open the LED Visualisation with Live Video on.
    There you see what Hyperion captures and will send to LEDs.


    I tested your scenario myself and confirm that on my end it behaves the same regardless, if I use the DX or QT grabber.
    If I do a Preview on the Screen Saver configuration dialog, the screenoutput is available as per screensaver selected.
    If I let the screensaver kick in after a timeout, the image stays black (for DX and Qt), but I verified that images are sent.
    (you can monitor the websocket messages in the browser).

    I recall that some users "complained" that during screen saving, the LEDs are still on and represent what the screen saver shows.
    So I do not know, what is the differentiating factor :(

  • So there is still no clear answer, I will try to look deeper into the problem and see if I can find anything. If you have any ideas, I can test or look into it.

  • Hi Lord-Grey !

    I read the article above again, and an idea appeared that does not break the architecture and concept of Hyperion.

    We add to Hyperion the processing of two custom events HyperionScreenSaverStarted and HyperionScreenSaverStoped, using them to grab the picture from ScreenSaver, or the main screen.

    And any third-party service or program can receive the status that ScreenSaver is running in any way and send these two events to all programs in the system.

    Is it possible?

    • Offizieller Beitrag

    Hi ajs


    just copying some stuff from other sites...

    That would explain why the capturing is black when the screensaver desktop is used.

    I currently do not know how to circumvent this "security feature",


    From https://docs.microsoft.com/en-…win32/winstation/desktops (emphasis mine):

    Zitat
    By default, there are three desktops in the interactive window station: Default, ScreenSaver, and Winlogon.
    The Default desktop is created when Winlogon starts the initial process as the logged-on user. At that point, the Default desktop becomes active, and it is used to interact with the user.
    Whenever a secure screen saver activates, the system automatically switches to the ScreenSaver desktop, which protects the processes on the default desktop from unauthorized users. Unsecured screen savers run on Winsta0\Default.


    Desktop Availabilty?-VBForums

    Zitat
    One issue I think you might have is that when the workstation is locked, or the screensaver is active, GDI functions such as BitBlt would fail when you try to copy the locked desktop. So you might end up with black screen. This is part of a feature that was introduced in Windows 2000 called "Secure Desktop". It was supposed to block the keyboard, but Microsoft added the whole display as well as a quick fix, the result is difficulty for programs that do remote control like yours.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!