Jump to content

[SOLVED] Full sleep in the first sleep but not in the subsequent ones before shutdown or reboot


10 posts in this topic

Recommended Posts

Hello everybody. I have observed this behavior in the sleep of my hack:

  • first time it goes to sleep since boot (from Energy Saver / from power button / from Terminal command) it goes well with lights and fans completely off
  • wakes up from sleep with a single touch of keyboard or mouse or with a press of power button
  • next times it goes to sleep it does not turn off lights and fans, screen turns off but fans keep spinning and graphics card light stays on
  • if I restart the PC, the cycle starts again and the first time it goes to sleep everything is as expected, but only the first time.

 

The pmset -g assertions command shows this output which is the same after full or incomplete sleep.

Assertion status system-wide:
   BackgroundTask                 0
   ApplePushServiceTask           0
   UserIsActive                   1
   PreventUserIdleDisplaySleep    0
   PreventSystemSleep             0
   ExternalMedia                  0
   InternalPreventDisplaySleep    1
   PreventUserIdleSystemSleep     1
   NetworkClientActive            0
Listed by owning process:
   pid 147(WindowServer): [0x00000f7d000982d7] 00:00:00 UserIsActive named: "com.apple.iohideventsystem.queue.tickle serviceID:1000004e1 name:AppleHIDKeyboardEve product:Apple Keyboard eventType:3"  
	Timeout will fire in 60 secs Action=TimeoutActionRelease
   pid 415(sharingd): [0x00000fc400018346] 00:06:27 PreventUserIdleSystemSleep named: "Handoff"  
   pid 91(powerd): [0x0000113500108395] 00:00:18 InternalPreventDisplaySleep named: "com.apple.powermanagement.delayDisplayOff"  
	Timeout will fire in 42 secs Action=TimeoutActionTurnOff
Kernel Assertions: 0x4=USB
   id=502  level=255 0x4=USB creat=14/6/21 8:47 description=com.apple.usb.externaldevice.14620000 owner=BRCM20702 Hub
   id=504  level=255 0x4=USB creat=14/6/21 8:49 description=com.apple.usb.externaldevice.14840000 owner=Keyboard Hub
   id=506  level=255 0x4=USB creat=14/6/21 8:54 description=com.apple.usb.externaldevice.14843000 owner=USB Optical Mouse
Idle sleep preventers: IODisplayWrangler

Current configuration obtained with pmset -g is:

 autorestart          0
 Sleep On Power Button 1
 hibernatefile        /var/vm/sleepimage
 powernap             0
 networkoversleep     0
 disksleep            15
 sleep                20 (sleep prevented by sharingd)
 hibernatemode        0
 ttyskeepawake        0
 displaysleep         15
 tcpkeepalive         0
 womp                 0

(sleep prevented by sharingd) is shown after full or incomplete sleep.

 

I have OpenCore 0.7.0 but this behavior happens for several versions of OpenCore. Now I'm in Big Sur 11.4 with MacPro7,1 but it happens also with iMac19,1 and iMacPro1,1 and with Catalina.

 

The structure of the current EFI folder is:

├── ACPI
│   ├── SSDT-AWAC-DISABLE.aml
│   ├── SSDT-EC-USBX.aml
│   ├── SSDT-PLUG.aml
│   └── SSDT-PMC.aml
├── Drivers
│   ├── CrScreenshotDxe.efi
│   ├── OpenCanopy.efi
│   ├── OpenHfsPlus.efi
│   └── OpenRuntime.efi
├── Kexts
│   ├── CPUFriend.kext
│   ├── CPUFriendDataProvider.kext
│   ├── IntelMausi.kext
│   ├── Lilu.kext
│   ├── NVMeFix.kext
│   ├── RestrictEvents.kext│
│   ├── SMCProcessor.kext
│   ├── SMCSuperIO.kext
│   ├── USBToolBox.kext
│   ├── UTBMap.kext
│   ├── VirtualSMC.kext
│   ├── WhateverGreen.kext
├── OpenCore.efi
├── Resources
│   ├── Audio
│   ├── Font
│   ├── Image
│   └── Label
├── Tools
│   ├── CsrUtil.efi
│   └── OpenShell.efi
└── config.plist

Attached my current config.plist.

 

It happens to someone else? What can be the cause that the first sleep works well and the next ones are not complete? What parameter or setting can I look for related to this issue?
Thanks.

 

config.plist

Edited by miliuco

@miliuco - Hi Bro this is my readout from BS and Monterey, my problem is, Sleep/Wake is very flaky, sometimes it will sleep and another time it will not, Wake is not a problem it will wake with a double click of the mouse no problem. I did have a kext that would wake the machine with just one click but I cannot find it after doing numerous clean installs so now I have to do two clicks to wake the machine.

Spoiler

1861199744_ScreenShot2021-06-14at09_51_59.png.366eb19cdddf627ea36e906a27161467.png

 

Posted (edited)
40 minutes ago, eSaF said:

@miliuco - Hi Bro this is my readout from BS and Monterey, my problem is, Sleep/Wake is very flaky, sometimes it will sleep and another time it will not, Wake is not a problem it will wake with a double click of the mouse no problem. I did have a kext that would wake the machine with just one click but I cannot find it after doing numerous clean installs so now I have to do two clicks to wake the machine...

This are the 2 files, SSDT and kext, that go toghether to wake up with a single click. This is the website:
https://github.com/osy/USBWakeFixup


But before using this method, do you have acpi-wake-type property in DeviceProperties relative to USB device (PciRoot(0x0)/Pci(0x14,0x0) on my system)? Sometimes this is enough to get you out of sleep with just one touch.

usbwake.thumb.png.ed5d9dfb6b2fab86808a2fa8a1898ac6.png

As per Dortania guide:

 

"So an odd bug with Intel's 100 series chipsets and newer is that sometimes macOS requires a second keyboard press or some other wake event to power up the monitor as well, with some requiring a keypress+power button to wake. Well to fix this, we need to either:

Set acpi-wake-type to the USB Controller(Recommended...)"


You say "sometimes it will sleep and another time it will not", have you noticed if it is like in my post, the first time yes and subsequent times no?

 

 

usbw.zip

Edited by miliuco
  • Thanks 1

@eSaF

Do you need tcpkeepalive and womp enabled? Sleep works better with both disabled.

sudo pmset womp 0

sudo tcpkeepalive womp 0

@miliuco - Yea because I have 'Find My Mac' enabled whether it is of any use but I will try your suggestion - Thanks.

26 minutes ago, eSaF said:

@miliuco - Yea because I have 'Find My Mac' enabled whether it is of any use but I will try your suggestion - Thanks.

Ah! Then you have to have both pmset keys enabled.

  • Like 1
Posted (edited)

Good afternoon, It seems that this problem has been solved although the changes I have made are minor and it is hard to believe that they were the cause.

  • First is disabling Handoff in System Preferences> General. This Ben42 told me.
  • Second to set screen saver so that its timeout is NOT longer than that of screen sleep.

With these 2 modifications, the system goes to sleep several times during the same session, from Energy Saver or from power button or from Terminal. And wake up well.


Note: sometimes I have seen that, although incomplete sleep (fans spinning) always happens when the timeout expires or I press the power button, full sleep (spin off) can take a while (from seconds to 1-2 minutes). It probably has to do with the tasks that macOS is running.

 

Edited by miliuco
  • miliuco changed the title to [SOLVED] Full sleep in the first sleep but not in the subsequent ones before shutdown or reboot
2 hours ago, miliuco said:

Good afternoon, It seems that this problem has been solved although the changes I have made are minor and it is hard to believe that they were the cause.

  • First is disabling Handoff in System Preferences> General. This Ben42 told me.
  • Second to set screen saver so that its timeout is NOT longer than that of screen sleep.

With these 2 modifications, the system goes to sleep several times during the same session, from Energy Saver or from power button or from Terminal. And wake up well.


Note: sometimes I have seen that, although incomplete sleep (fans spinning) always happens when the timeout expires or I press the power button, full sleep (spin off) can take a while (from seconds to 1-2 minutes). It probably has to do with the tasks that macOS is running.

 

Interesting! It does indeed seems like 'Handoff' is the cause for Sleep/Wake problem in Monterey (at least on my system). Just tried with Handoff disabled and problem solved, another bug to be added to the list, we are after all in the first Beta stage so these anomalies are to be expected. :(

  • Like 1
2 hours ago, eSaF said:

Interesting! It does indeed seems like 'Handoff' is the cause for Sleep/Wake problem in Monterey (at least on my system). Just tried with Handoff disabled and problem solved, another bug to be added to the list, we are after all in the first Beta stage so these anomalies are to be expected. :(

But this was happening to me also in Big Sur, not only Monterey.

45 minutes ago, miliuco said:

But this was happening to me also in Big Sur, not only Monterey.

Yes I agree, on my system with BS, Sleep/Wake was hit and miss even the Screen Saver also, sometimes it would work perfect as per the settings other times Screen Saver would not activate and machine would not sleep, the only time it would sleep is if I actually force it to do so. On Mojave and Catalina no problem at all.

  • Like 1
×
×
  • Create New...