Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ApexDE

macrumors regular
Nov 27, 2008
113
38
yes, i can confirm that sleep is fixed with the modified powerd.plist. Two long sleeps (8 hours and 12 hours) with not a single wakeup.
 
  • Like
Reactions: davidlv and krvld

krvld

macrumors member
Jul 20, 2023
62
49
What about keeping WiFi and BT on? Is there a way to prevent DarkWake without turning both off before sleep?
 

davidlv

macrumors 68020
Apr 5, 2009
2,291
874
Kyoto, Japan
On another forum a solution was found by somebody:
#------------------------------------------------------------------------------
Having investigated this further I found that there is a MacOS FeatureFlag for enabling CoreSmartPowerNap in powerd.plist in the system folder /System/Library/FeatureFlags/Domain/

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CoreSmartPowerNap</key>
<dict>
<key>Enabled</key>
<true/>
</dict>
</dict>
</plist>



We cant change this plist directly because the file is in the secure system enclave but another user pointed out that we can override MacOS FeatureFlags by setting in them in the /Library/Preferences/FeatureFlags/Domain/ folder.

I've tried this approach and since implementing I have not seen any CSPNEvaluation wake reasons.

If you want to try this for yourself do the following :-

1. Open Terminal

2. Create the folder structure in terminal with: sudo mkdir -p /Library/Preferences/FeatureFlags/Domain/

3. Copy the above code into a editor and change the boolean flag <true/> to <false/>

4. Save the file as powerd.plist into the new folder: /Library/Preferences/FeatureFlags/Domain/

5. Reboot
#------------------------------------------------------------------------------

Tried and tested this:
1. put the machine into sleep
2. wake it up
3. pmset -g log > pmset.txt.
4. Voila -> no CSPNEvaluation Wake Request for this sleep action

Best regards!
Assume that we must repeat this process after every new install or update, right?
(unless Apple adopts it, however unlikely that is).
I used CCC to backup my internal SSD (Sonoma 14.2 b3, with the sleep fix noted above installed) to an external SSD, copied the Sonoma 14.1.1 install app to the Applications folder on that target disk, and ran the installer. After the install finished, I ran the OCLP root patches, and rebooted. I did not clear the NVRAM . Then I checked and the powerd.plist was still installed on the new Sonoma 14.1.1.
 
Last edited:

ApexDE

macrumors regular
Nov 27, 2008
113
38
@davidlv

my guess is that the modified powerd.plist in the user-editable-folder will survive updates. We will see :)
At least we have a solution now to the really nasty hourly wake issue and know how to fix it, if it's deleted by an update.
I will never ever immediately go to a new major macOS release again, although i waited until 14.1 to update....
 
  • Like
Reactions: krvld

SoYoung

macrumors 68000
Jul 3, 2015
1,545
955
I have a sleep/standby issue as well since Somona. My mac doesn't lock automatically after 30 minutes if I leave it open like before and don't ask for my password anymore. I have to lock it manually each time I leave the mac to be sure. Everyone else?
 

stiffy

macrumors newbie
Apr 29, 2014
6
1
Code:
sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true
sudo pmset disksleep 0
sudo pmset womp 0
sudo pmset powernap 0
sudo pmset ttyskeepawake 0
sudo pmset tcpkeepalive 1
sudo pmset schedule cancelall
sudo pmset repeat cancel
sudo chflags schg /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
sudo mkdir -p /Library/Preferences/FeatureFlags/Domain
sudo cp /System/Library/FeatureFlags/Domain/powerd.plist /Library/Preferences/FeatureFlags/Domain
sudo nano /Library/Preferences/FeatureFlags/Domain/powerd.plist
replace <true/> to <false/>
reboot

mac mini m2 pro w/ thunderbolt external nvme ssd, macos 14.1.1, never encountered an unexpected wakeup again!

Code:
pmset -g log | grep "Wake from"                           
before:       
2023-11-20 04:27:14 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 645 secs  
2023-11-20 06:38:01 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/UserActivity Assertion Using AC (Charge:0%) 614 secs  
2023-11-20 08:48:17 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 615 secs  
2023-11-20 10:58:34 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 615 secs  
2023-11-20 13:08:51 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 615 secs  
2023-11-20 15:19:08 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 615 secs  
2023-11-20 17:29:25 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 615 secs  

after:
2023-11-20 18:04:23 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 usb3 pcie-xhci/UserActivity Assertion Using AC (Charge:0%)           
2023-11-21 08:58:51 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 usb3 pcie-xhci/HID Activity Using AC (Charge:0%) 285 secs  
2023-11-21 18:31:38 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 usb3 pcie-xhci/HID Activity Using AC (Charge:0%)           
2023-11-21 20:31:22 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 usb3 pcie-xhci/HID Activity Using AC (Charge:0%)           
2023-11-21 22:40:22 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 usb3 pcie-xhci/HID Activity Using AC (Charge:0%)

the usb3 is my mouse :)
 
  • Love
Reactions: krvld

davidlv

macrumors 68020
Apr 5, 2009
2,291
874
Kyoto, Japan
Code:
sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true
sudo pmset disksleep 0
sudo pmset womp 0
sudo pmset powernap 0
sudo pmset ttyskeepawake 0
sudo pmset tcpkeepalive 1
sudo pmset schedule cancelall
sudo pmset repeat cancel
sudo chflags schg /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
sudo mkdir -p /Library/Preferences/FeatureFlags/Domain
sudo cp /System/Library/FeatureFlags/Domain/powerd.plist /Library/Preferences/FeatureFlags/Domain
sudo nano /Library/Preferences/FeatureFlags/Domain/powerd.plist
replace <true/> to <false/>
reboot

mac mini m2 pro w/ thunderbolt external nvme ssd, macos 14.1.1, never encountered an unexpected wakeup again!

Code:
pmset -g log | grep "Wake from"                          
before:      
2023-11-20 04:27:14 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 645 secs 
2023-11-20 06:38:01 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/UserActivity Assertion Using AC (Charge:0%) 614 secs 
2023-11-20 08:48:17 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 615 secs 
2023-11-20 10:58:34 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 615 secs 
2023-11-20 13:08:51 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 615 secs 
2023-11-20 15:19:08 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 615 secs 
2023-11-20 17:29:25 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to NUB.SPMI0Sw3IRQ nub-spmi0.0x02 rtc/HID Activity Using AC (Charge:0%) 615 secs 

after:
2023-11-20 18:04:23 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 usb3 pcie-xhci/UserActivity Assertion Using AC (Charge:0%)          
2023-11-21 08:58:51 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 usb3 pcie-xhci/HID Activity Using AC (Charge:0%) 285 secs 
2023-11-21 18:31:38 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 usb3 pcie-xhci/HID Activity Using AC (Charge:0%)          
2023-11-21 20:31:22 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 usb3 pcie-xhci/HID Activity Using AC (Charge:0%)          
2023-11-21 22:40:22 +0800 Wake                    Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 usb3 pcie-xhci/HID Activity Using AC (Charge:0%)

the usb3 is my mouse :)
Thanks for the input!
I have seen this:
sudo pmset -b tcpkeepalive 0
--This command may produce a warning saying some features may not work properly. This is fine, it simply disables Internet access during sleep. This is the same as disabling "PowerNap" Apple's badly implemented (demented?) attempt to have apps update themselves during sleep behind the users back.
So, why do you recommend it being set to enabled? Also is the "-b" in the command above necessary? It was included in a text file I found on a Japanese forum (all in Japanese! except the commands of course). All of the other commands used -a after the pmset.
 
  • Like
Reactions: krvld

stiffy

macrumors newbie
Apr 29, 2014
6
1
The -a, -b, -c, -u flags determine whether the settings apply to battery ( -b ), charger (wall power) ( -c ), UPS ( -u ) or all ( -a ).

Set tcpkeepalive to 1 will not trigger unexpected wakeup and to 0 may break Find-My-Mac.
 

davidlv

macrumors 68020
Apr 5, 2009
2,291
874
Kyoto, Japan
The -a, -b, -c, -u flags determine whether the settings apply to battery ( -b ), charger (wall power) ( -c ), UPS ( -u ) or all ( -a ).

Set tcpkeepalive to 1 will not trigger unexpected wakeup and to 0 may break Find-My-Mac.
Thanks for the clarification! Much appreciated.
 

maccan

macrumors regular
Feb 22, 2019
100
39
Updated to 14.1.2 yesterday and the CSPNEvaluation fix was conserved. No sleep-issues anymore!
 

Mattyman

macrumors regular
Nov 2, 2019
222
34
In the same boat. 2020 i5 MacBook Pro has no sleep issues but this upgrade wakes up all the time and although slow drain it’s definately draining faster without the sleep. I’m not a technical as you folks so thinking of downgrading.

Question. If I go back to Ventura I have to install it clean and use migration assistant and use a recent Time Machine backup. Should the Time Machine backup match the correct macOS? Thanks.
 

maccan

macrumors regular
Feb 22, 2019
100
39
In the same boat. 2020 i5 MacBook Pro has no sleep issues but this upgrade wakes up all the time and although slow drain it’s definately draining faster without the sleep. I’m not a technical as you folks so thinking of downgrading.

Question. If I go back to Ventura I have to install it clean and use migration assistant and use a recent Time Machine backup. Should the Time Machine backup match the correct macOS? Thanks.
I wold give the procedure summarized by stiffy a try. Chances are very good you can resolve the sleep issues. It is just a couple of minutes, while downgrading is much more time consuming and you do not get the benefits of the new OS.
 

Mattyman

macrumors regular
Nov 2, 2019
222
34
I wold give the procedure summarized by stiffy a try. Chances are very good you can resolve the sleep issues. It is just a couple of minutes, while downgrading is much more time consuming and you do not get the benefits of the new OS.
Is it just a copy and paste into terminal?

is this potentially a one time solution. Next update could be back to the issue?

thanks
 

gilby101

macrumors 68030
Mar 17, 2010
2,946
1,630
Tasmania
If I go back to Ventura I have to install it clean and use migration assistant and use a recent Time Machine backup. Should the Time Machine backup match the correct macOS?
For Migration Assistant:
Best: TM backup version matches installed macOS.
OK: TM backup version is older than installed macOS - get tricky when much older.
Not good: TM backup version is newer than installed. Old macOS does not know everything about future macOS and its backup - in many cases it will not be able to read the newer TM disk (e.g. if APFS TM format has changed).
Exception: The underlying differences between macOS 13.6 and 14.0 are fairly small, so likely that macOS 13 Migration Assistant will be mostly successful recovering a macOS 14.0 backup. You could test this :)
 

maccan

macrumors regular
Feb 22, 2019
100
39
In the same boat. 2020 i5 MacBook Pro has no sleep issues but this upgrade wakes up all the time and although slow drain it’s definately draining faster without the sleep. I’m not a technical as you folks so thinking of downgrading.

Question. If I go back to Ventura I have to install it clean and use migration assistant and use a recent Time Machine backup. Should the Time Machine backup match the correct macOS? Thanks.
yes it is, except editing the powerd.plist file with nano. If you are not familiar with nano you may use TextEdit.app for convinience. It may also better to first copy powerd.plist to your Desktop and try to edit it before copy it to the final destination. Double check that it is correct.
 

Mattyman

macrumors regular
Nov 2, 2019
222
34
For Migration Assistant:
Best: TM backup version matches installed macOS.
OK: TM backup version is older than installed macOS - get tricky when much older.
Not good: TM backup version is newer than installed. Old macOS does not know everything about future macOS and its backup - in many cases it will not be able to read the newer TM disk (e.g. if APFS TM format has changed).
Exception: The underlying differences between macOS 13.6 and 14.0 are fairly small, so likely that macOS 13 Migration Assistant will be mostly successful recovering a macOS 14.0 backup. You could test this :)
So I’ve realised to downgrade I must create a bootable disk with Venture loaded on. Is this correct? I can’t see any other way.
 

Loyola

macrumors regular
Sep 9, 2004
247
85
I have to do some more research to determine how to fix. The issue I have is only 1 of my 2 monitors goes to sleep. The one goes to a black screen and the other I still see the background.

Update: if I manually select Sleep it works fine but I have the issue if the computer goes to sleep on it own after inactivity.

Update 12/7: I had to reinstall the driver for the j5create JUA214 adapter. Now sleep works fine.
 
Last edited:

rimvydukas

macrumors member
Sep 3, 2009
31
5
This is very nice thread about wakeups. I've implemented all of them but still have sad problem. When I put my mac into sleep mode, I can still ping my mac via the network:/ Could someone try the same? I more than need some insight how to fix this, as I think that my mac is not fully sleeping. Have several macs with sonoma with the same nonsense:/ Or must I understant that it is not possible to achieve if I put mac into sleep with wifi and bt turned on?
 

rimvydukas

macrumors member
Sep 3, 2009
31
5
When you are fully sleeping, your body is alert to some stimuli and can wake you very rapidly. Macs are the same. In both cases that is a good thing.

If you want to reduce network stimuli, set tcpkeepalive to zero.
I did everything that is mentioned below:

sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true
sudo pmset disksleep 0
sudo pmset womp 0
sudo pmset powernap 0
sudo pmset ttyskeepawake 0
sudo pmset tcpkeepalive 0
sudo pmset schedule cancelall
sudo pmset repeat cancel
sudo chflags schg /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
sudo mkdir -p /Library/Preferences/FeatureFlags/Domain
sudo cp /System/Library/FeatureFlags/Domain/powerd.plist /Library/Preferences/FeatureFlags/Domain
sudo nano /Library/Preferences/FeatureFlags/Domain/powerd.plist
replace <true/> to <false/>
reboot

I'm still able to see regular wakeups and my mac is still answering pings while in sleep. I'm asking how to fix this because I can perfectly remember that macs were able to sleep without any wakeups in the past. I could have my mac in sleep mode for over a months without any battery drainage - and as for now, mac which is in sleep mode gets dead pretty quickly:(
 

Mattyman

macrumors regular
Nov 2, 2019
222
34
so - finally back to Ventura and we get gaps in the bars in the battery setting.

Its interesting the trigger of gaps in the bar is when TCP keep alive becomes inactive.

I thought it was idle sleep that made the battery bars have a gap - but it appears it's this.

All default settings to achieve this.



Screenshot 2023-12-15 at 20.50.47.png



Screenshot 2023-12-15 at 20.51.31.png
 

jmstilly

macrumors newbie
Jan 6, 2022
3
3
Brief thanks to all for posting these details! I've been dealing with Magic Trackpad and Keyboard battery drain (seems related) while my MacBook is supposed to be sleeping, and look forward to trying some of this out.

Meanwhile, it appears there is an app called Sleep Aid that can assist in identifying these issues in a manner more friendly to a user like myself... https://ohanaware.com/sleepaid/

I will try a clean install when I have time, and am realizing it is probably best in the future to wait until late spring to upgrade. Apple’s software quality being what it is these days. Meanwhile, I hope this helps others, and am really grateful to those posting here!
 

frou

macrumors 65816
Mar 14, 2009
1,392
2,002
What surprises me about this is... Apple have been making OS X for over 20 years. You'd think there would be some institutional memory that would cause engineering management to not greenlight a new thing (CSPN) that unconditionally wakes the Mac every hour, and isn't configurable in System Settings, because it would be known that that would annoy users in a bunch of scenarios.

There's currently a lack of adult supervision in the MacOS development team I guess!
 
Last edited:
  • Like
Reactions: Alwis
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.