Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
47
rated 0 times [  47] [ 0]  / answers: 1 / hits: 28505  / 2 Years ago, wed, april 13, 2022, 7:26:52

I would like to use the hybrid suspend method instead of suspend when closing the lid or selecting "Suspend" from the menu.



I can imagine to change the pm-suspend script to do so automatically, but there might be a more maintainable / easier way.


More From » suspend

 Answers
5

Indirect hybrid sleep



This is the older method: first suspend and then wake up to hibernate after a delay (15 minutes by default). Use this with a Linux kernel before 3.6, or if you like that it does not use any power after 15 minutes any more.



Add the file /etc/pm/config.d/00-use-suspend-hybrid:



# Always use suspend_hybrid instead of suspend
if [ "$METHOD" = "suspend" ]; then
METHOD=suspend_hybrid
fi
# The delay after which hibernation gets triggered (default: 900 seconds, 15 minutes):
PM_HIBERNATE_DELAY=900



You might want to make sure that the hybrid method is supported on your system via the following code. If it says "0" it should work:



sudo pm-is-supported --suspend-hybrid && echo $?



Real hybrid suspending with Linux 3.6+



If you have a Linux 3.6 kernel, you can use the following, which will suspend to both disk and RAM from the beginning.



Add the file /etc/pm/config.d/00-use-suspend-hybrid:



# WORKAROUND: always set the default hibernate mode first (normal mode)
# (not required if you have the patch mentioned by Rohan below (http://askubuntu.com/a/344879/169))
HIBERNATE_MODE=platform

# Always use hibernate instead of suspend, but with "suspend to both"
if [ "$METHOD" = "suspend" ]; then
METHOD=hibernate
HIBERNATE_MODE=suspend
fi

# Make sure to use the kernel's method, in case uswsusp is installed etc.
SLEEP_MODULE=kernel


This will always write the image to disk and then suspend to RAM, having the benefits that resuming will always be fast (as long as the battery does not run out) and that the machine will not wake up for a short time (after PM_HIBERNATE_DELAY) to hibernate for real.



The drawback is that the process takes longer (because it always hibernates to disk), and that your battery might run out in the long run (e.g. after 12 hours).




[#37931] Thursday, April 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
motivengry

Total Points: 459
Total Questions: 112
Total Answers: 108

Location: Bonaire
Member since Sat, May 1, 2021
3 Years ago
motivengry questions
Tue, Oct 4, 22, 10:02, 2 Years ago
Wed, May 31, 23, 14:33, 12 Months ago
;