GUIDE How to Fix Sleep/Wake on macOS [Clover/OpenCore]

EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Messages
3,861
Motherboard
Supermicro X11SPA-T
CPU
Intel Xeon W-3275 28 Core
Graphics
2xAMD RX 580 8GB
OS X/macOS
11.0.x
Bootloader
  1. OpenCore
Mac
  1. Mac mini
  2. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
How to Fix Sleep/Wake Function on macOS [Clover/OpenCore]

Overview



The most common reason to have an improper Sleep/Wake function is due to incorrect configured Devices. Typically, for a Sleep/Wake function, the devices get an S3 Call (for sleep) and S0 (for wake), the devices must be powered down to enter the sleep state and must be active when waking up from the sleep state. However, if a device doesn't cooperate with such instructions, the Sleep/Wake function fails to work or works partially.

The main common issues lie between the following devices
  • USB Controller and USB Devices
  • Graphics
  • NVMe Drives
  • Sounds Card/USB Card/Dock/Internal USB Hub
  • Thunderbolt
  • Network (Ethernet/WiFi /BT Card)
Apart from the above devices, there are a few more other devices and functions that can cause improper Sleep/Wake Function
  • CPU Power Management
  • NVRAM
  • RTC
  • Audio
  • SMBus
  • TSC
Well, the list isn't over yet. There are a few other reasons which can affect Slee/Wake Function

RAM
  • Faulty Memory Modules
  • Mismatched Memory Frequencies
  • Mismatched Memory Timings
  • Overclocking
System Overclocking
  • CPU Overclocking
  • GPU Overclocking
QUICK INFO:
  • Sleep/Wake function is for Skylake and newer Desktops if using IGPU.
  • Sleep/Wake function is rare on X79, C602 and other HEDT/Server Chipsets.

STEP 1: Setup BIOS


The very first step is to set up BIOS to have the IGPU Enabled on your System. Follow the steps below to set up your BIOS for IGPU.

1. On your target computer, boot to BIOS. Refer to your user manual for the BIOS Key
2. Set the following parameters as shown.

SettingsValueNotes
Wake on LANDisabled
Trusted Platform ModuleDisabled
Wake on USB

3. Save & Exit Setup

NOTES:
  • If you only want to use IGPU, set the Initial PCIe Output display to IGFX.
  • The above settings are for IGPU only. See BIOS Settings for more information.
  • If your system does not have any of the above settings in BIOS, ignore such settings.

STEP 2: Fix Devices

#1 Fixing USB

One of the most common reasons to have a broken Sleep/Wake is due to improper USB Configuration done for the target system. With the release of Big Sur 11.3, the issues have been increased. To fix the USB related issues, you need to fix a few USB related components. The fix consist of the following

Fix EC and USB Power
Map USB Ports

NOTE:
  • Some USB devices that do not have proper support in macOS due to a lack of drivers, may cause sleep issues. These USB Devices include Water Coolers with USB Addressable Control, Internal Hubs, and RGB/ARGB/FAN Controllers. For users with such devices, we recommend you to disconnect such devices before testing Sleep/Wake function.
  • Some monitors with built-in USB HUB may cause sleep issues.
  • Some USB Hubs and PCIe USB Cards may cause sleep issues.

# Fixing ShutDown and Restart
On some systems, when shutting down, the system may restart instead of shutting down. This is actually due to a missing S5 call that powers down the controller. Refer to the Shutdown and Restart Fix for more information

# Fixing Instant Wake
On some systems, when entering the sleep state, the system wakes instantly after the sleep begins. On Laptops, it is very common. A PRW patch can be used to fix this issue. Refer to the Instant Wake Fix for more information.

# Fixing Keyboard Wake
On Intel's 100 series and newer chipsets, macOS requires a second keyboard press or other wake events to power up including the monitor. Some require a Power button press and some require a Keypress+Power button together. Refer to the Keyboard Wake Fix for more information.

# Fixing Graphics
Graphics can also cause Sleep/Wake issues. The Graphics fix consists of the following

Use Compatible Graphics
If you're using an unsupported GPU and expect that the target system will have a working Sleep/Wake function, you're likely wrong. This is because the unsupported GPU will use VESA drivers. The system may have a display but functions such as acceleration will not work along with the GPU Power Management.

IGPU Compatibility
NVIDIA GPU Compatibility
AMD GPU Compatibility

Fix Graphics
A Graphics which is not correctly enabled within macOS can also cause Sleep/Wake issues.

Intel Graphics
Enable Intel Graphics
Skylake and Ventura

NVIDIA Graphics
Enable NVIDIA Graphics
Monterey and Later
WebDrivers on Big Sur and Later

AMD Graphics
Enable AMD Graphics
AMD NAVI RDNA 2

Disable Graphics
On Laptops, it's strongly recommended to disable the discrete Graphics in Dual GPU Laptops. On Desktops, if you're having an Unsupported Graphics, it is strongly recommended to disable it and use the compatible DGPU or IGPU on macOS.

Disable Unsupported GPU on Desktop
Disable Discrete GPUs on Laptops

# Fixing NVMe
Not all NVMe drives are supported on macOS. With some specific NVMe drivers, you may not even be able to boot the installer and perform a clean installation. Apple's Power Management in terms of NVMe drives is limited to Apple branded drives only. The fix consists of the following

Use Compatible NVMe Drives
Like CPU and Graphics, NVMe has also the same importance when it comes to NVMe Compatibility. Refer to the Storage Compatibility for more information

Use Latest Firmware
Some NVMe such as Samsung 970 Evo Plus were introduced in the market with a known problematic firmware that had Kernel Panic issues when used on macOS.

Disable NVMe
In some special cases, where you don't want to void the warranty or want to avoid the risk of damage by disassembling your Laptop, you have the option to disable NVMe.

# Fixing Thunderbolt
Having a working Thunderbolt is quite complex and it becomes more complex due to certain system limitations. The common cause for a broken Sleep/Wake Function is due to the lack of HotPlug function. If implemented properly, the Thunderbolt can work with no Sleep/Wake issues. The fix consist of the following

Use Compatible Thunderbolt
Like CPU and Graphics, Thunderbolt has also the same importance when it comes to Thunderbolt Compatibility. Refer to the Thunderbolt Compatibility for more information

Enable Thunderbolt 3 HotPlug
Enable Thunderbolt 4 HotPlug

NOTE:
  • If you do not require a Thunderbolt function, you can simply disable the Thunderbolt in BIOS.
  • If you really require a Thunderbolt function and are unable to implement a HotPlug function, the Sleep/Wake function can be disabled.

# Fixing Network
Yes, you heard it right. A bad Network Device such as Ethernet or WiFi Card can likely break the Sleep/Wake function. The fix consist of the following

Disable Wake for Network Access in System Preferences>Energy Saver

Use compatible Network Cards
There are known WiFi Cards that are problematic with the Sleep/Wake function. USB WiFi Adapters may break Sleep/Wake. Refer to the Network Compatibility threads linked below.

Ethernet Compatibility
WiFi Compatibility
USB WiFi Compatibiliuty
USB Bluetooth Compatibility

STEP 3: Fix Functions


After fixing the Devices, you need to fix some of the functions which have an impact on Sleep/Wake. The functions are described below.

#1 Fixing Power Management
Power Management is important on any OS. Like other factors, Power Management can affect Sleep/Wake functions. It is necessary to fix the Power Management function, CPU, and GPU respectively. If the target system has no power management or improper power management, a common indication would be Sleep Wake failure in EFI. Refer to the CPU Power Management for fixing. The other possible fixes consist of the following

Chipset Specific Power Management
Graphics Power Management
#2 Fixing Displays
This section is mainly relevant for Laptops. This includes lid detection and related issues. The fix consists of the following

Backlight

# Fixing NVRAM
Without a native NVRAM, Sleep/Wake issues can occur. Other potential issues are boot loops when updating the system to Big Sur or newer. Refer to NVRAM Fix Guide for more information.

# Fixing RTC
RTC function is important as other functions on macOS. On a few systems, the RTC is not compatible with macOS which causes issues like entering into safe mode error while booting into macOS and restarting from macOS. Refer to RTC Fix Guide for more information.

# Fixing IRQ Conflicts
On a few devices, patching IRQ might be required and is required on almost all laptops. The IRQ patching is not required by every system, but mostly Dell systems and other branded systems. IRQ issues usually occur during boot. IRQ calls can break the Sleep function. Refer to IRQ Fix Guide for more information.

# Fixing Audio
Unsupported Audio or if the Audio function is not implemented correctly can cause Sleep/Wake issues. Refer to Audio Fix Guide for more information.

Use Compatible Audio Device
Like other factors, Audio has also the same importance when it comes to Audio Compatibility. Refer to the Storage Compatibility for more information

# Fixing SMBus
The SMBus (System Management Bus) is a two-wire interface through which various system components chips can communicate with each other and with the rest of the system. AppleSMBus can help to properly manage SMBus and PCI devices with the Power States. However, the issue is on non-Apple computers, this AppleSMBus kext may not load by default on some systems. See SMBus Fix Guide for more information.

# Fixing TSC
The TSC (Time Stamp Counter) is responsible for ensuring that your CPU is running at its correct defined speed with the correct cores count. However, some firmware (mostly HEDT/Server and ASUS Laptops) will not write the TSC to all cores which causes a slowdown and every running process is at extremely slow speed. Due to this, when attempting a clean install, the system may enter the boot loop state. Refer to TSC Fix Guide for more information.

STEP 4: Modify config.plist
The next step is to modify the config.plist. All you need to do is enable some patches and/or Quirks to your config.plist. To add them, follow the steps below.

1. Mount your ESP.

#1 Disable Hibernation

For Clover

1. Open your config.plist
2. Uncheck the NeverHibernate option in the Boot section of your config.plist

For OpenCore
1. Open your config.plist
2. Set Hibernate Mode to None in the Misc>Boot section of your config.plist

#2 Add Boot Args

Add the following boot args in your config.plist

Boot ArgPurpose
debug=0x100
  • This disables macOS's watchdog which helps prevents a reboot on a kernel panic.
keepsyms=1
  • This is a companion setting to debug=0x100 that tells the OS to also print the symbols on a kernel panic.
  • This can give some more helpful insight as to what's causing the panic itself.
  • If a Kernel Panic occurs during sleep, get all important information
swd_panic=1Prevents issues when going to sleep state results in a reboot.
This provides a panic log on the occurrence of such panic.

For Clover
1. Open config.plist from EFI/Clover directory
2. Go to the Boot section. Add the required boot args under Boot Arguments.
3. Save your config.plist

For OpenCore
1. Open config.plist from EFI/OC directory.
2. Go to the NVRAM section. In the UUID 7C436110-AB2A-4BBB-A880-FE41995C9F82 add the required boot args under boot-args line, space after one arg
3. Save your config.plist

STEP 5: Setup macOS

On Hackintoshes, hibernation (suspend to disk or S4 sleep) is not supported. Therefore, it's recommended to disable it.

#1. Disable Hibernation Related Functions
1. Open Terminal and execute the following commands one by one.

CommandsPurpose
sudo pmset -a autopoweroff 0
sudo pmset -a standby 0

Code:
sudo pmset -a hibernatemode 0
sudo rm /var/vm/sleepimage
sudo mkdir /var/vm/sleepimage

Also, it's a good idea to disable the other hibernation related functions.

NOTE:
  • When updating your system, make sure that the hibernation is disabled as the system updates re-enables it.
 
Last edited:

oldman20

Member
Joined
Nov 6, 2021
Messages
123
Motherboard
Dell 3558
CPU
Broadwell 5200U
Graphics
Intel HD5500
OS X/macOS
12.0.x
Bootloader
  1. Clover (UEFI)
  2. OpenCore
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
In my bios I enable Wake USB, So I can wake-up my hackintosh with Bluetooth mouse, I don't run any commands to disable similars bottom thread. Seem sleep/ wake working fine currently

Don't know running pmset is necessary, is Necessary and sufficient conditions? Or for any system has trouble with sleep/ wake?
 

Forum statistics

Threads
749
Messages
7,930
Members
6,855
Latest member
Breakthru81