-
Notifications
You must be signed in to change notification settings - Fork 176
Sleep Guard #1109
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
base: master
Are you sure you want to change the base?
Sleep Guard #1109
Conversation
|
Thanks for your PR! This seems important but can't you handle it on the OS level instead with much less complexity? And screen locking would be a needed functionality while it runs. |
eb72865 to
e469619
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1109 +/- ##
==========================================
- Coverage 62.49% 62.39% -0.11%
==========================================
Files 23 24 +1
Lines 6346 6371 +25
==========================================
+ Hits 3966 3975 +9
- Misses 2380 2396 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
AFAIK, there are some things you can do outside of the application to prevent sleep. This PR is rather a convenience function, so that you do not have to call av1an from another wrapper. E.g. in linux:
The screenshot may be misleading. The sleep inhibitors I'm creating only prevent sleep. The system is still able to turn off and lock the screens. |
01752bd to
1c4f74d
Compare
I had the problem, that av1an encodes would not run through overnight, as my system would simply go into sleep - even though an encoding job was already running. In my case that would be Arch Linux. It seems like other people have this issue as well, see #889.
This PR ads a sleep guard to av1an that should prevent sleeping while an encode is running. I first tried to use the suggested crate keepawake as suggested in the Issue, but it pulled far more dependencies as expected, which were also outdated.
I sat down to write implementations for linux, windows and macOS myself, that should prevent the system from going into sleep.
I have tested the linux and the windows implementations. The macOS implementation is untested, as I was not able to get av1an to start an encoding job there.
Screenshot Linux (KDE Plasma):

Screenshot Windows 10:
