Open oscarsantillana opened 1 year ago
Hey, I know, this repo is very much a mess at the moment. By the end of the week, I will rebuild EFI with latest OC and kexts and upload it here.
Have you made sure, that you modified the correct bios registers? They might be at a different offset due to different bios version. However, I will try to get you updated by the end of the week. Cheers
Yes before any modification I have double checked that previous values where the expected ones from documentation.
I look forward to getting your update! Many thanks in advance!
cheers, looking forward this project cause you mentioned HibernationFixup. have you achieved s4 sleep ,which save current status into ssd?
Sorry for the delay, haven't had that much spare time in the end. Also I will await the upcoming OC version which will hopefully be released somewhat around Monday 8th of May.
I included HibernationFixup, but I haven't tested that much around sleep as it was working so far. Don't take my word whether it is S3 or S4. Close and reopen lid, manual selecting sleep worked fine. Battery drain was very small. One small issue is where in Windows the screen would stay black. But this might be my fault for changing something.
If you want to dig deeper into the 9360, checkout dark-void's repo and forum. It might be a little outdated, but most stuff like ACPI patching is still good to go. Watch for OC and not Clover ones.
Cheers
Just dropped in a new release. More description will follow when I have more time spare, especially on obtaining the IFR values for bios modification to unlock DVMT etc.
Many thanks, you have been a life saver! After including platform info I am able to boot and start installation.
Cheers!
Glad to hear it worked out!
Last night I just closed the lid and unplugged the charger, battery was at 100%. Opening back up 8-9 Hours later, battery is at 95%. So I guess it was in S3 sleep, not S4. Not perfect, but fine for me. My battery capacity also is sadly only 71%.
@wanghuangjie How would I be able to measure if it is S3 or S4.
After digging in a little. My pmset hibernate mode was set to 0. According to the pmset man page:
SAFE SLEEP ARGUMENTS
hibernatemode supports values of 0, 3, or 25. Whether or not a hibernation image gets written is also dependent on the values of standby and autopoweroff
For example, on desktops that support standby a hibernation image will be written after the specified standbydelay time. To disable hibernation images completely, ensure
hibernatemode standby and autopoweroff are all set to 0.
hibernatemode = 0 by default on desktops. The system will not back memory up to persistent storage. The system must wake from the contents of memory; the system will lose context
on power loss. This is, historically, plain old sleep.
hibernatemode = 3 by default on portables. The system will store a copy of memory to persistent storage (the disk), and will power memory during sleep. The system will wake from
memory, unless a power loss forces it to restore from hibernate image.
hibernatemode = 25 is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will remove power to memory. The system will restore
from disk image. If you want "hibernation" - slower sleeps, slower wakes, and better battery life, you should use this setting.
Please note that hibernatefile may only point to a file located on the root volume.
I set it now to 25 and adjusted standby and autopoweroff. Lets see how it does in the next days.
ferris@DellXPS13 ~ % sudo pmset -g
System-wide power settings:
Currently in use:
lidwake 1
autopoweroff 1
lowpowermode 0
standbydelayhigh 86400
autopoweroffdelay 259200
standbydelaylow 10800
standby 1
proximitywake 0
ttyskeepawake 1
hibernatemode 25
gpuswitch 2
powernap 0
hibernatefile /var/vm/sleepimage
highstandbythreshold 50
displaysleep 5
womp 0
networkoversleep 0
sleep 1 (sleep prevented by identityservicesd)
tcpkeepalive 1
halfdim 1
disksleep 10
Ok after manually testing a little bit, it seems to work fine. I close the lid or select sleep from the top left apple icon, wait a few seconds until the power button is no longer lit. Wait a few more seconds just to be sure.
Nothing, but the power button, can wake the device. Pressing the power button, the Dell Logo appears, the screen is scrambled for a second and I am shown the login screen or desktop. I would say S4 is working!
Consult man pmset
for more info.
My go to settings now would be:
sudo pmset -a hibernatemode 3
sudo pmset -a standby 1
sudo pmset -a autopoweroff 1
# Adjust standby low/high delay/threshold for battery only.
# Set threshold to 70% instead of 50% because my battery is kinda shit.
sudo pmset -b highstandbythreshold 70
# Set delay from standby to hibernation from 3h to 1h if below 70% if on battery.
sudo pmset -b standbydelaylow 3600
# Set delay from standby to hibernation from 24h to 3h if above 70% if on battery.
sudo pmset -b standbydelayhigh 10800
# Maybe adjust autopoweroffdelay from 72h to 24h
sudo pmset autopoweroffdelay 86400
# I don't quite get the difference between autopoweroff and standby, but it seems to be used for when connected to ac.
# https://apple.stackexchange.com/questions/113954/difference-between-autopoweroff-and-standby-in-pmset
macOS Version 12.3.1 (21E258). modify your EFI file two place, one is PlatformInfo, the other is boot-args hbfx-ahbm=1 EnableAutoHibernation = 1: If this flag is set, system will hibernate instead of regular sleep (flags below can be used to limit this behavior.
Currently in use:
standby 1
standbydelaylow 60
halfdim 1
hibernatefile /var/vm/sleepimage
proximitywake 0
powernap 0
gpuswitch 2
disksleep 10
standbydelayhigh 60
sleep 1 (sleep prevented by sharingd)
hibernatemode 3
ttyskeepawake 0
displaysleep 2
tcpkeepalive 0
highstandbythreshold 90
lowpowermode 1
lidwake 1
Unfortunately, when my system goes into hibernation mode and I wake it up by pressing the power button, it shows the Dell logo, then a black screen, followed by the Dell logo again, before booting up normally. This seems to be a panic caused by the hibernation process.
I am planning to perform a clean installation of macOS on my device and then attempt the process again.
I haven't tried manipulating hibernation via boot-args of HibernationFixup.
You could try to achieve the same with
sudo pmset hibernatemode 25
This should force hibernation instead of sleep.
Do you by have any different hardware? Like an nvme ssd that might cause trouble, or some other WiFi card?
I will try to update the repo soon with more detailed BIOS settings, maybe there is a difference.
mine hardware is slightly different than yours.
Wifi: BCM94360cs2 SSD:Toshiba XG5 Display: FHD and not touchable CPU:i7-8550U
thanks for you help and looking forward bios settings to figure it out.
Ok, for smbios I would suggest you take mbp 15,2 instead of 14,1. Ssd shouldn't be a problem, especially with nvme fix kext. Is trim shown as supported?
Another thing might be the ACPI patches. Can be that your dsdt differs from mine. Check that out.
@wanghuangjie thank you for pointing me towards checking out hibernation!
My test this night went perfect. Battery at 100%, unplug charger, close the lid. After ~9h open lid, press power button, dell logo, macOS login screen. Battery still at 100%.
Finally , it works. No more panic after Dell logo.
rm /var/vm/sleepimage && pmset restoredefaults
and boot-args is hbfx-ahbm=1
(will tweak it later).
then reset nvram.
Will test the power consumption in next 24hrs and report back here.
hours | battery lose | |
---|---|---|
0h | 77% | |
+8h | 77% | |
last ten day battery usage. hibernation is working
This is very meaningful to me because I often keep this computer in my car as a backup. Although I only use it when necessary, but the battery often drains itself due to the lack of hibernation.(about -8%/day) Thank you @dsbferris once again for your help and support.
Hello, I have the same laptop but with different wifi card and different bios version 2.16.0. Bios registers have been already modified CFG Lock, DVMT Pre-Alloc, and DVMT TOTAL. I have tried building the EFI following your config.plist and ACPI since it is missing in the repo. Which Opencore version are you using? I have tried with 0.90 with no success.
Thanks!