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 function to prevent screen turning off / laptop going to sleep during say all #14036

Open
Qchristensen opened this issue Aug 19, 2022 · 9 comments
Labels
bug/regression bug feature/say-all p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.

Comments

@Qchristensen
Copy link
Member

Is your feature request related to a problem? Please describe.

While listening to NVDA"s Say All (NVDA+down arrow / NVDA+a) read a document, it is likely the user will not touch the keyboard. If the document takes a long time to read, the system may go to sleep, which will interrupt reading.

Describe the solution you'd like

An option to prevent the system going to sleep while NVDA is reading with say all.

Describe alternatives you've considered

Setting a longer time before the system goes to sleep may be an option, however not all users have the ability to change this (eg company machines) and this may impact battery life overall.

Additional context

Reported by a user (Frederik, via email).

@lukaszgo1
Copy link
Contributor

This is already implemented in #10643 - the system should not sleep when say all is in progress. Now the question is why it is not working for this particular user, debugging something like this remotely is going to be painful tough.

@ABuffEr
Copy link
Contributor

ABuffEr commented Aug 20, 2022

I'm not so sure that the situation is so clear.

I discover now #10643, so for years I tought NVDA dosn't prevent sleep during say all (that I use for book reading).

Now I played with screen timeout and screensaver settings, and I noticed that NVDA stops reading if screensaver starts and "return to access screen at restore" checkbox is enabled in screensaver settings (label may differ, I translated from Italian).

And, sure, this is not stand-by/sleep exactly...

Maybe the user refer to this?

@lukaszgo1
Copy link
Contributor

@ABuffEr Can you run NVDA from sources on your system? If you can it would be interesting to check what happens if you'd change

winKernel.SetThreadExecutionState(winKernel.ES_SYSTEM_REQUIRED)

to:
winKernel.SetThreadExecutionState(winKernel.ES_SYSTEM_REQUIRED | winKernel.ES_DISPLAY_REQUIRED)

@seanbudd seanbudd added bug bug/regression blocked/needs-info The issue can not be progressed until more information is provided. and removed feature labels Aug 25, 2022
@seanbudd
Copy link
Member

Is this with an installed version?

Without a log it is difficult to understand the cause here.

@seanbudd seanbudd added the triaged Has been triaged, issue is waiting for implementation. label Aug 25, 2022
@seanbudd
Copy link
Member

@michaelDCurran michaelDCurran added the p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority label Sep 5, 2022
@ABuffEr
Copy link
Contributor

ABuffEr commented Jan 31, 2023

Hi,
sorry for delay, I'm now able to follow @lukaszgo1 's suggestion, running from source.

Due to the line is changed in the meantime, I changed both occurrences of

winKernel.SetThreadExecutionState(winKernel.ES_SYSTEM_REQUIRED)

in sayAll.py, with:

winKernel.SetThreadExecutionState(winKernel.ES_SYSTEM_REQUIRED | winKernel.ES_DISPLAY_REQUIRED)

I then set display and screensaver timeout to 1 min (respectively 10 and 20 minutes previously), and ensure to have enabled the checkbox to return to access screen in screensaver settings (already enabled).

I can confirm that now no sleep/unlock screen raises and say all runs for more than a minute without stopping.

@XLTechie
Copy link
Contributor

@seanbudd is this still blocked-waiting for info? If so, what info?
It just came up again, with a group of users complaining about it on the main NVDA users list.
The above discussion suggests that a solution is known but hasn't been implemented.

@pranavlal
Copy link

Hi all,
I am the user who started the discussion about this. I have a work laptop where this situation comes up frequently. I need to read long documents as a part of my job and this gets really painful because if I am in a browser or in thorium reader, which is a daisy book player, I lose my place. Tyler Spivey suggested running a number of commands on the nvda python console which appear to help in early testing. These commands are below.
`import winKernel;winKernel.SetThreadExecutionState = lambda x: True import ctypes;ctypes.windll.kernel32.SetThreadExecutionState(0x80000003)

`

@pranavlal
Copy link

In addition, I am ok with the laptop going to sleep at other t imes without user interaction hence changing power settings is not an option.

@seanbudd seanbudd removed the blocked/needs-info The issue can not be progressed until more information is provided. label May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/regression bug feature/say-all p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

No branches or pull requests

7 participants