pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

Disable Screensaver Screen / Prevent Low Power Mode not preventing screensaver or LPM

Open CeruleanSky opened this issue 10 years ago • 9 comments

This is the commit that overhauled that feature:

https://github.com/PCSX2/pcsx2/commit/8a5c8ab91ca6968e49799fcb12dfc3c4c6502fc0

Either the setting from the ini file isn't propagating(I didn't trace it or check for logic issues) or the flags are incorrect.

I do know that SetThreadExecutionState(ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED) works for x360ce and some other applications so maybe that would be better than the currently used ES_CONTINUOUS | ES_DISPLAY_REQUIRED

System Specs: Windows 7 64 Bit Using extended monitor graphics: nvidia geoforce 555m, also includes and intel hd 3000 onboard

v1.3.1-1478-g9f2fa79 lilypad also with disable screensaver enabled(but I believe it is ignored due to pcsx2 having that option)

CeruleanSky avatar Nov 27 '15 17:11 CeruleanSky

You didn't describe the scenario exactly. I.e. I do 1... 2... 3..., I expect X, but instead Z happens.

According to the docs, multimedia applications that need to keep the screen without mouse or KB input should use ES_DISPLAY_REQUIRED, and according to my experiments and others, the current code (the commit you pointed to) does prevent screen saver from activating.

The screen saver prevention should only activate while the GS window is focused and a game is running. If you minimize the game window or have other window focused or the emulation is not running, then by design it doesn't prevent the screen saver. We might reconsider this behavior if it turns out that this is what you were experiencing and we didn't consider all cases.

But for this, we'll need to know your exact steps to reproduce the issue.

About the "LPM". That commit was not designed to prevent low power mode (I'm assuming that refers to power saving mode or throttling or something similar). Whether or not the system throttles the CPU/GPU or enters some power saving mode is not within the scope of PCSX2 to control. It's a system thing and the system should do a good enough job of controlling it.

The LilyPad feature was disabled some months ago since that solution was very hacky. It also had nothing to do with "low power mode" and it was only preventing the OS from activating the screen saver via a hack.

So, describe the exact steps please to reproduce the issue and let's take it from there.

avih avatar Nov 27 '15 19:11 avih

I apologize for any lack of details required and am more than happy to elaborated or provide more information.

  1. Open PCSX2 1.3.1 using GSD10 plugin with D3D11
  2. System-> Boot CDVD either full or fast (using tales of the abyss)
  3. Take window with game and drag to extended desktop
  4. alt-enter or full screen it.
  5. Play game with direct input game controller for a 10 minutes without moving mouse of keyboard
  6. Monitor turns off.

This does not occur when using the code from x360ce which had a similiar issue until they set the ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED flags, of course which thread those flags are being used on might be important also.

By low power mode, I mean the monitor shutting off to conserve power, and am not referring to GPU/CPU throttling, I referring to the turn off the display in the below image.

image

CeruleanSky avatar Nov 27 '15 20:11 CeruleanSky

Is there also an issue if you play on the main display? or if the main PCSX2 window is also at the extended display?

Also, do both monitors turn off?

avih avatar Nov 27 '15 20:11 avih

Sure, glad to try that out. I set "Turn off the display" to 2 minutes for testing purposes.

  1. Open PCSX2 1.3.1 using GSD10 plugin with D3D11
  2. System-> Boot CDVD either full or fast (using tales of the abyss)
  3. alt-enter to full screen it.
  4. Play game with direct input game controller for a 2 minutes without moving mouse of keyboard
  5. Monitor turns off.

CeruleanSky avatar Nov 27 '15 20:11 CeruleanSky

Let me ask it another way. Does it work at all on any of the cases you tried? what about with only a single display connected?

This does not occur when using the code from x360ce which had a similiar issue until they set the ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED

Do you mean that you edited the code, used this instead of the previous flags, built PCSX2 and it didn't turn off the monitors?

Also, note that without ES_CONTINUOUS, one needs to call this function periodically to reset the timers, but if adding this flag then it will remember the requested state. So if we're changing it, I'll only add ES_SYSTEM_REQUIRED to the existing flags instead of replacing ES_CONTINUOUS with ES_SYSTEM_REQUIRED.

avih avatar Nov 27 '15 20:11 avih

what about with only a single display connected? Does it work at all on any of the cases you tried?

It seems to work as intended when only one display is plugged in. I will reboot my computer and try some other cases to see if it is a fluke.

But in no cases so far with a second monitor plugged in has ES_CONTINUOUS | ES_DISPLAY_REQUIRED

Do you mean that you edited the code

I'm on vacation right now thus no environment to do builds, but I'll see about doing some custom builds and testing when I get back next week as time allows.

Thus I did not test those flags out, but only suggested them as it seems to of fixed the issue with another program. Unfortunately, I'm not too familiar with winapi methods that prevent monitor sleeping and their sideeffects/limitations.

You might consider these alternatives more hackish, but I do know that Pokopom uses a mouse thread that sends null events.

And there is another program that sends periodic F15 keyup events.

If nothing we can do here helps, I'll be testing out those methods in the future and will provide feedback.

CeruleanSky avatar Nov 27 '15 21:11 CeruleanSky

Thanks for the info. Take your time, post more data when you have some, and let's take it from there. Feel free to send a PR if you want (after you verify it fixes the issue).

avih avatar Nov 27 '15 21:11 avih

I retested this in Win 10, still seems to be an issue.

MrCK1 avatar Apr 24 '19 00:04 MrCK1

is this still an issue on latest master ?

Mrlinkwii avatar Aug 30 '22 10:08 Mrlinkwii