-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQ] Prevent automatic idle mode during active video playback #265
Comments
The solution is to not use the idle mode feature. Instead, set your screen power off time out in the Windows power settings. LGTVCompanion notices when Windows attempts to turn off the screen and will send the corresponding signal to shut down the TV. The Windows screen timeout is smarter and will not trigger on full screen apps. |
Hi thanks for the request! @dechamps is correct that the user idle mode is configured to be different than the mechanisms in windows. I e it was designed to always trigger in absence of user input (mouse, keyboard, controller) regardless of whatever logic was applied in windows to avoid situations where the PC inadvertently shows static HUD elements a full night, f e because someone fell asleep in front of the keyboard. Still the functionality was extended with user configurable whitelists and fullscreen detection on user request. This request (detection of playing videos) has also been requested several times earlier, with some variations. Your suggestion is interesting @neolorn because you also hint at a practical solution. And incidentally I wonder if this or a similar method can potentially also solve an old issue where Valve's steam input does not trigger GetLastInputInfo() properly. I know that Steam, because of this, need to set SetThreadExecutionState() to prevent the PC shutting down mid-game. It seems possible to work a bit on this and investigate more Edit: this reverse powercfg and illustrate how to enumerate the power request objects. Unfortunately it seem to require admin rights according to documentation. @neolorn can you detail your approach to using the IMFMediaSession API |
Yes, it is true I can set screen off in power management instead of using the idle mode. But the problem is, I can't restrict the power management detection method to only video playback, meaning that any application using SetThreadExecutionState(ES_DISPLAY_REQUIRED) will also prevent display from turning off. And now that I think about it, IMFMediaSession isn't a reliable solution to detect video playback exclusively. Let me research further for a precise detection method in case you're interested. Regarding PowerEnumerate, requiring admin privileges, there's no going around that. The only possible way I could poll requests from a user-mode app is through a signed driver. As for the problem with steam controllers, AV flagging raw input detection can also be mitigated by a signed driver, but why not just use Steam Input API directly to detect inputs? Maybe then use Steamworks API to run detections only during gameplay sessions or big picture mode. Here's a simple method I tested:
|
Yes I'd be interested in the findings. Not having to use admin rights is definitely preferrable. Thanks also for the steam input boilerplate code. Was meaning to look into if your suggestion was feasible so I'll have a look starting with this |
Is your feature request related to a problem? Please describe.
When using automatic idle mode, TV will idle during active video playback in the foreground (e.g. watching a movie or a video that exceeds configured idle time).
Describe the solution you'd like
An option to prevent idle mode during active video playback in the foreground.
Describe alternatives you've considered
Get the processes requesting Video Wake Lock from powercfg (aka. "powercfg -requests" in PowerShell) check if any of it is in the foreground. If true, then disable automatic idle mode.
Additional context
I used IMFMediaSession API to get a list of processes requesting "Video Wake Lock".
The text was updated successfully, but these errors were encountered: