Skip to content
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

Add support for Windows 10 Battery Saver #1471

Open
martinsuchan opened this issue Jan 18, 2016 · 11 comments
Open

Add support for Windows 10 Battery Saver #1471

martinsuchan opened this issue Jan 18, 2016 · 11 comments

Comments

@martinsuchan
Copy link

Windows 10 OS contains feature called Battery Saver. It can be enabled when running on battery to conserve battery usage by lowering CPU/GPU frequency, stopping background tasks or lowering screen brightness.
It would be useful to add switch to the BOINC Manager to enable/disable computation when the device is on Battery Saver.
The Battery Saver status can be detected using this API.

@AenBleidd
Copy link
Member

Does this option not work on Windows 10?
image

@martinsuchan
Copy link
Author

@AenBleidd This works on Windows 10, but users might choose to run BOINC on battery and suspend it only when Battery Saver is On. Not sure, how common this might be, but it's recommended for Windows apps to suspend all resource intensive tasks when Battery Saver is on.
Maybe Boinc Manager should suspend the computation every time when Battery Saver is on, no matter what the settings is in the Computing preferences?

@AenBleidd
Copy link
Member

As I understand from your link above Battery Saver option means that application should exclude some 'hard' functilnality to keep less energy using. So IMHO this option in complex with existing option is unnecessary for BOINC.

@AenBleidd
Copy link
Member

AenBleidd commented Jun 4, 2018

@RichardHaselgrove, do we really need this feature to be implemented?

@davidpanderson
Copy link
Contributor

Probably not. "Compute on battery" defaults to no and I doubt anyone changes that.

@AenBleidd AenBleidd removed their assignment Mar 14, 2019
@KeithMyers
Copy link

KeithMyers commented Oct 3, 2019

Per message https://setiathome.berkeley.edu/forum_thread.php?id=84719&postid=2014098, the Suspend computation when on battery does not work in Ubuntu.

The mechanism that is used in Windows works. Whatever the mechanism is in Windows probably has the equivalent function in Linux. The code for suspending when on battery needs to be updated to handle Linux hosts also.

This command upower --enumerate produces an output that hints at which interface needs to be polled.
upower --enumerate /org/freedesktop/UPower/devices/ups_hiddev0

This is the interface that the system uses to poll the APCUPSD USB connection from the UPS. This is how the UPS signals the host to gracefully shutdown once the UPS battery level or time remaining falls below the configuration setpoint and causes the host to exit all applications and shutdown. This mechanism works fine in Linux.

What is wanted is the "Suspend all computations when on battery" Manager preferences to stop computations so the UPS battery does not have compute loads on it and the on battery time remaining is increased by dropping to idle load.

@KeithMyers
Copy link

KeithMyers commented Oct 4, 2019

Further investigation shows the daemon upowerd is running on Linux systems monitoring all battery powered devices.
upower -d
shows all the devices and the current state of all battery devices. The final output of that command is:

Daemon:
  daemon-version:  0.99.7
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  no
  critical-action: PowerOff

and could be used to hook into with whatever the Manager or Client uses to stop computing when the host is on system battery.

gboolean
up_client_get_on_battery (UpClient *client);

True=on battery False=not on battery This would be the method for the Manager to detect when the host has shifted to battery power.
https://upower.freedesktop.org/docs/

@KeithMyers
Copy link

KeithMyers commented Oct 4, 2019

upower -i /org/freedesktop/UPower/devices/ups_hiddev0 is the interface that needs to be interrogated.

The code in the module /client/hostinfo_unix.cpp needs to be updated for the correct, current interfaces in use for battery detection.

@AenBleidd
Copy link
Member

UPower solution is implemented in #3425

@bradlewt
Copy link

WIN11. Suspend when computer is on battery checked, but BOINC still computes when UPS is engaged, this runs the UPS down in 20 min. Currently UPS controlled by UPSmart.

@KeithMyers
Copy link

You will have to grab the fix in #3425 and compile your own client and give it a try.
Detecting whether the computer is on a UPS is supposed to work on Windows. At least it does for Windows laptops.
The fix in #3425 is just for polling Upower interface in Linux which changes the status polled by apcupsd.
Sounds like they need to work on detecting the same kind of interface in Windows which I assume is controlled by UPSmart.
That fix has never been merged into the Master client.

@AenBleidd AenBleidd removed this from Backlog in Client and Manager Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

6 participants