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

Hibernation #126

Closed
1Revenger1 opened this issue Jan 22, 2025 · 4 comments
Closed

Hibernation #126

1Revenger1 opened this issue Jan 22, 2025 · 4 comments

Comments

@1Revenger1
Copy link
Contributor

Just some corrections and new info here. For the purposes of this doc, S0 is the working state, S3 is sleep (Suspend to ram) and S4 is hibernation (Suspend to disk).

Hibernation mode 3 will transition from S3 to S4 depending on the timeout and battery thresholds set in pmset (Will expand upon this in a following comment). I myself prefer this mode as it does quicken the wakeup time when the device is being used quickly while still providing the benefits of hibernation when the device is not in use overnight. This mode does require HibernationFixup to work as I have otherwise noticed that the device stays in S3 and never transition to S4. You do also need to set hbfx-ahbm to a value with at least bit 0 set! (I use 0x37).

Hibernation mode 25 will always go directly from S0 to S4.

For hibernation to work, there is a few things required:

  • Storage must be marked as built-in. I had to set the built-in property and add an ACPI device to represent the NVMe device in my KLED Chromebook for this to work. This was not needed on my Lenovo X1E1.
  • Many devices will likely need to set UEFI->ReservedMemory for region 0x8B000 (size 0x1000) to fix black screens on wakeup using Intel laptops. This is an entry that comes as part of the Sample.plist for OC. No clue with AMD/Intel Desktops.
  • Block writes to RTC regions 0x80-0xAB and possibly 0xB0-0xB4 (Reference https://github.com/acidanthera/RTCMemoryFixup)
  • By blocking RTC writes to those regions, you prevent hibernation data being written to the RTC. Make sure to allow OC to read hibernation data from NVRAM instead (Misc->Boot->HibernateMode = "Auto") and that you have HibernationFixup so that the data does get written into NVRAM.
  • I would strongly suggest setting Misc->Boot->HibernationSkipsPicker to true. That way you do not inadvertently boot into another OS and change the environment/whatever assumptions the hibernated OS makes. It's generally a really dumb idea to change BIOS settings in the middle of hibernation so please don't :)

Using all the above, I've gotten hibernation mode 3 working on both my KLED chromebook and my Lenovo X1 Extreme Gen 1.

@1Revenger1
Copy link
Contributor Author

Can find this and more pmset settings using man pmset. Generally you want standby on though and hibernatemode=3 (imo) unless you explicitely want hibernation only.
Image

Interpreting this output from pmset -g, standbydelaylow/high is how long it takes to transition from S3 to S4. In this case, it is 24 hours and 3 hours. I find 24 hours a little ridiculous but haven't changed it on this chromebook yet haha. highstandbythreshold is the battery percentage it switches between the two standby timers. You will probably want to double check that is actually uses this threshold value though or whether it always uses high/low values.

Image

These values can be changed using sudo pmset <name> <value>.
Ex: sudo pmset standbydelayhigh 86400

@5T33Z0
Copy link
Owner

5T33Z0 commented Jan 23, 2025

Thnks for the explanations. I will update the Hibernation section accordingly soon.

@1Revenger1
Copy link
Contributor Author

Reference: tylernguyen/x1c6-hackintosh#44 (comment)

@5T33Z0
Copy link
Owner

5T33Z0 commented Jan 29, 2025

I did some research on my own as well and completely updated the chapter Changing Hibernation Modes.

I managed to actuallly get the complete hibernation sequence working on my Lenovo T530: From idle → sleep → hibernation → autopoweroff.

@5T33Z0 5T33Z0 closed this as completed Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants