Contribute
Register

<< Solved >> Still can't solve the problem of instant wake

Status
Not open for further replies.
Joined
Oct 19, 2016
Messages
4
Motherboard
Hasee Z7-KP7GZ
CPU
i7-8750H
Graphics
UHD 630 / GTX 1060
Hello,

after days of investigation I have solved the sleep stuck problem by changing the Clover configs. But I'm running into another problem: when I sleep, the computer sleeps for several seconds and then it wakes. I'm using a Coffee Lake laptop and running macOS Mojave 10.14.2.

I searched for some cases in Google and I knew that it was related to USB; the followings were what I did:

- hibernatemode has already been set to 0, and sleepimage was disabled
- tried dartwake=0,8.. etc. and none of them made a difference (now I'm running in dartwake=0)
- patched SSDT-UIAC-ALL.aml, not working
- directly modified the value of UsbConnector in 8086_a36d part of USBInjectAll.kext/Info.plist, not working
- DSDT was patched with usb_prw_0x6d_xhc.txt and usb_prw_0x6d_xhc_skl.txt, there were some errors while patching, I tried to fix them, but after a reboot it still went through an instant wake :( (btw my laptop is coffee lake)
- deleted USBInjectAll.kext, it didn't wake instantly after sleep any more, but in the meanwhile all of the USB ports won't work any more....

When I run `log show --style syslog | grep "Wake reason"`, it shows:
Code:
2019-01-27 19:01:27.040831+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:01:27.040833+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:04:30.665931+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:04:30.665933+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:05:28.644127+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:05:28.644129+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:14:43.759206+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:14:43.759209+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:30:48.507359+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: CNVW XHC (Network)
2019-01-27 19:30:48.507363+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: CNVW XHC (Network)


`pmset -g log` gives:
Code:
Time stamp                Domain                  Message                                                                        Duration      Delay     
==========                ======                  =======                                                                        ========      =====     
UUID: D89E1482-33DD-4436-A8FD-54EDAB4DFD7E
2019-01-27 19:30:40 +0800 Sleep                   Entering Sleep state due to 'Low Power Sleep': Using Batt (Charge:91%) 14 secs   
2019-01-27 19:30:52 +0800 Kernel Client Acks      Delays to Sleep notifications: [AppleIntelFramebuffer driver is slow(msg: SetState to 1)(417 ms)] [IOBluetoothHostControllerUSBTransport driver is slow(msg: WillChangeState to 2)(5000 ms)] [AppleAHCIDiskQueueManager driver is slow(msg: SetState to 0)(910 ms)]           
2019-01-27 19:30:52 +0800 Assertions              PID 181(mDNSResponder) Created MaintenanceWake "mDNSResponder:maintenance" 00:00:00  id:0x0xd0000805d [System: DeclUser kDisp]         
2019-01-27 19:30:52 +0800 Assertions              Kernel Idle sleep preventers: IODisplayWrangler         
2019-01-27 19:30:52 +0800 Notification            Display is turned on                                                                     
2019-01-27 19:30:54 +0800 Assertions              PID 181(mDNSResponder) Released MaintenanceWake "mDNSResponder:maintenance" 00:00:02  id:0x0xd0000805d [System: DeclUser kDisp]         
2019-01-27 19:30:54 +0800 Wake                    Wake from Standby [CDNVA] due to CNVW XHC/Lid Open: Using BATT (Charge:90%)           
2019-01-27 19:30:54 +0800 WakeDetails             DriverReason:XHC - DriverDetails:                                         
2019-01-27 19:30:54 +0800 HibernateStats          hibmode=0 standbydelay=10800                                                             5             
2019-01-27 19:30:54 +0800 WakeTime                WakeTime: 2.300 sec                                                                     
2019-01-27 19:30:54 +0800 Kernel Client Acks      Delays to Wake notifications: [AppleHDADriver driver is slow(msg: SetState to 1)(532 ms)] [AppleIntelFramebuffer driver is slow(msg: SetState to 2)(691 ms)] [PRT0 driver is slow(msg: SetState to 2)(856 ms)]           
2019-01-27 19:31:01 +0800 Assertions              PID 63(mds) Released BackgroundTask "com.apple.metadata.mds.power" 00:01:52  id:0x0xb00008019 [System: DeclUser kDisp]         
2019-01-27 19:31:35 +0800 Assertions              Summary- [System: DeclUser kDisp] Using AC(Charge: 90)         
2019-01-27 19:31:36 +0800 Assertions              PID 541(PowerChime) Created DisplayWake "com.apple.chimeOnAttach" 00:00:00  id:0x0xe0000806a [System: PrevIdle DeclUser DispWake kDisp]         
2019-01-27 19:31:37 +0800 Assertions              PID 541(PowerChime) Released DisplayWake "com.apple.chimeOnAttach" 00:00:00  id:0x0xe0000806a [System: PrevIdle DeclUser kDisp]         
2019-01-27 19:31:52 +0800 Assertions              PID 180(backupd) ClientDied PreventUserIdleSystemSleep "Time Machine backup" 00:02:56  id:0x0x100008003 [System: DeclUser kDisp]         
2019-01-27 19:31:52 +0800 Assertions              PID 180(backupd) ClientDied BackgroundTask "Time Machine backup" 00:02:56  id:0x0xb00008002 [System: DeclUser kDisp]         
2019-01-27 19:45:54 +0800 Assertions              PID 93(hidd) Summary UserIsActive "com.apple.iohideventsystem.queue.tickle.4294968168.3" 00:00:00  id:0x0x900008023 [System: DeclUser BGTask kDisp]         
2019-01-27 19:45:54 +0800 Assertions              PID 39(UserEventAgent) Summary BackgroundTask "com.apple.apfs.defrag.disk2s1" 00:12:20  id:0x0xb0000807e [System: DeclUser BGTask kDisp]         
2019-01-27 19:46:43 +0800 Assertions              PID 39(UserEventAgent) Released BackgroundTask "com.apple.apfs.defrag.disk2s1" 00:13:09  id:0x0xb0000807e [System: DeclUser kDisp]         
2019-01-27 19:56:33 +0800 Assertions              PID 39(UserEventAgent) Released BackgroundTask "com.apple.apfs.defrag.disk2s1" 00:04:13  id:0x0xb000080f3 [System: DeclUser kDisp]         

Total Sleep/Wakes since boot at 2019-01-28 03:28:49 +0800 :1

2019-01-27 19:59:28 +0800 : Showing all currently held IOKit power assertions
Assertion status system-wide:
   BackgroundTask                 0
   ApplePushServiceTask           0
   UserIsActive                   1
   PreventUserIdleDisplaySleep    0
   PreventSystemSleep             0
   ExternalMedia                  0
   PreventUserIdleSystemSleep     0
   NetworkClientActive            0
Listed by owning process:
   pid 93(hidd): [0x0000006f00098023] 00:00:00 UserIsActive named: "com.apple.iohideventsystem.queue.tickle.4294968168.3"
    Timeout will fire in 600 secs Action=TimeoutActionRelease
Kernel Assertions: 0x4=USB
   id=500  level=255 0x4=USB mod=1970/1/1 08:00 description=com.apple.usb.externaldevice.14900000 owner=USB Optical Mouse
   id=503  level=255 0x4=USB mod=1970/1/1 08:00 description=com.apple.usb.externaldevice.14c00000 owner=SDM636-MTP _SN:2E0EC6D7
Idle sleep preventers: IODisplayWrangler

So I have tried every methods I could find in both EN and CH forums but it still not work... I wonder that whether there were mistakes in my patching process. What else should I do? I would be grateful if anyone could give me some suggestions ;_;

Problem reporting files and EFI/CLOVERS are attached.
 

Attachments

  • CLOVER.zip
    3.4 MB · Views: 81
  • debug_32157.zip
    1 MB · Views: 73
Hello,

after days of investigation I have solved the sleep stuck problem by changing the Clover configs. But I'm running into another problem: when I sleep, the computer sleeps for several seconds and then it wakes. I'm using a Coffee Lake laptop and running macOS Mojave 10.14.2.

I searched for some cases in Google and I knew that it was related to USB; the followings were what I did:

- hibernatemode has already been set to 0, and sleepimage was disabled
- tried dartwake=0,8.. etc. and none of them made a difference (now I'm running in dartwake=0)
- patched SSDT-UIAC-ALL.aml, not working
- directly modified the value of UsbConnector in 8086_a36d part of USBInjectAll.kext/Info.plist, not working
- DSDT was patched with usb_prw_0x6d_xhc.txt and usb_prw_0x6d_xhc_skl.txt, there were some errors while patching, I tried to fix them, but after a reboot it still went through an instant wake :( (btw my laptop is coffee lake)
- deleted USBInjectAll.kext, it didn't wake instantly after sleep any more, but in the meanwhile all of the USB ports won't work any more....

When I run `log show --style syslog | grep "Wake reason"`, it shows:
Code:
2019-01-27 19:01:27.040831+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:01:27.040833+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:04:30.665931+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:04:30.665933+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:05:28.644127+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:05:28.644129+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:14:43.759206+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:14:43.759209+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC
2019-01-27 19:30:48.507359+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: CNVW XHC (Network)
2019-01-27 19:30:48.507363+0800  localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: CNVW XHC (Network)


`pmset -g log` gives:
Code:
Time stamp                Domain                  Message                                                                        Duration      Delay    
==========                ======                  =======                                                                        ========      =====    
UUID: D89E1482-33DD-4436-A8FD-54EDAB4DFD7E
2019-01-27 19:30:40 +0800 Sleep                   Entering Sleep state due to 'Low Power Sleep': Using Batt (Charge:91%) 14 secs  
2019-01-27 19:30:52 +0800 Kernel Client Acks      Delays to Sleep notifications: [AppleIntelFramebuffer driver is slow(msg: SetState to 1)(417 ms)] [IOBluetoothHostControllerUSBTransport driver is slow(msg: WillChangeState to 2)(5000 ms)] [AppleAHCIDiskQueueManager driver is slow(msg: SetState to 0)(910 ms)]          
2019-01-27 19:30:52 +0800 Assertions              PID 181(mDNSResponder) Created MaintenanceWake "mDNSResponder:maintenance" 00:00:00  id:0x0xd0000805d [System: DeclUser kDisp]        
2019-01-27 19:30:52 +0800 Assertions              Kernel Idle sleep preventers: IODisplayWrangler        
2019-01-27 19:30:52 +0800 Notification            Display is turned on                                                                    
2019-01-27 19:30:54 +0800 Assertions              PID 181(mDNSResponder) Released MaintenanceWake "mDNSResponder:maintenance" 00:00:02  id:0x0xd0000805d [System: DeclUser kDisp]        
2019-01-27 19:30:54 +0800 Wake                    Wake from Standby [CDNVA] due to CNVW XHC/Lid Open: Using BATT (Charge:90%)          
2019-01-27 19:30:54 +0800 WakeDetails             DriverReason:XHC - DriverDetails:                                        
2019-01-27 19:30:54 +0800 HibernateStats          hibmode=0 standbydelay=10800                                                             5            
2019-01-27 19:30:54 +0800 WakeTime                WakeTime: 2.300 sec                                                                    
2019-01-27 19:30:54 +0800 Kernel Client Acks      Delays to Wake notifications: [AppleHDADriver driver is slow(msg: SetState to 1)(532 ms)] [AppleIntelFramebuffer driver is slow(msg: SetState to 2)(691 ms)] [PRT0 driver is slow(msg: SetState to 2)(856 ms)]          
2019-01-27 19:31:01 +0800 Assertions              PID 63(mds) Released BackgroundTask "com.apple.metadata.mds.power" 00:01:52  id:0x0xb00008019 [System: DeclUser kDisp]        
2019-01-27 19:31:35 +0800 Assertions              Summary- [System: DeclUser kDisp] Using AC(Charge: 90)        
2019-01-27 19:31:36 +0800 Assertions              PID 541(PowerChime) Created DisplayWake "com.apple.chimeOnAttach" 00:00:00  id:0x0xe0000806a [System: PrevIdle DeclUser DispWake kDisp]        
2019-01-27 19:31:37 +0800 Assertions              PID 541(PowerChime) Released DisplayWake "com.apple.chimeOnAttach" 00:00:00  id:0x0xe0000806a [System: PrevIdle DeclUser kDisp]        
2019-01-27 19:31:52 +0800 Assertions              PID 180(backupd) ClientDied PreventUserIdleSystemSleep "Time Machine backup" 00:02:56  id:0x0x100008003 [System: DeclUser kDisp]        
2019-01-27 19:31:52 +0800 Assertions              PID 180(backupd) ClientDied BackgroundTask "Time Machine backup" 00:02:56  id:0x0xb00008002 [System: DeclUser kDisp]        
2019-01-27 19:45:54 +0800 Assertions              PID 93(hidd) Summary UserIsActive "com.apple.iohideventsystem.queue.tickle.4294968168.3" 00:00:00  id:0x0x900008023 [System: DeclUser BGTask kDisp]        
2019-01-27 19:45:54 +0800 Assertions              PID 39(UserEventAgent) Summary BackgroundTask "com.apple.apfs.defrag.disk2s1" 00:12:20  id:0x0xb0000807e [System: DeclUser BGTask kDisp]        
2019-01-27 19:46:43 +0800 Assertions              PID 39(UserEventAgent) Released BackgroundTask "com.apple.apfs.defrag.disk2s1" 00:13:09  id:0x0xb0000807e [System: DeclUser kDisp]        
2019-01-27 19:56:33 +0800 Assertions              PID 39(UserEventAgent) Released BackgroundTask "com.apple.apfs.defrag.disk2s1" 00:04:13  id:0x0xb000080f3 [System: DeclUser kDisp]        

Total Sleep/Wakes since boot at 2019-01-28 03:28:49 +0800 :1

2019-01-27 19:59:28 +0800 : Showing all currently held IOKit power assertions
Assertion status system-wide:
   BackgroundTask                 0
   ApplePushServiceTask           0
   UserIsActive                   1
   PreventUserIdleDisplaySleep    0
   PreventSystemSleep             0
   ExternalMedia                  0
   PreventUserIdleSystemSleep     0
   NetworkClientActive            0
Listed by owning process:
   pid 93(hidd): [0x0000006f00098023] 00:00:00 UserIsActive named: "com.apple.iohideventsystem.queue.tickle.4294968168.3"
    Timeout will fire in 600 secs Action=TimeoutActionRelease
Kernel Assertions: 0x4=USB
   id=500  level=255 0x4=USB mod=1970/1/1 08:00 description=com.apple.usb.externaldevice.14900000 owner=USB Optical Mouse
   id=503  level=255 0x4=USB mod=1970/1/1 08:00 description=com.apple.usb.externaldevice.14c00000 owner=SDM636-MTP _SN:2E0EC6D7
Idle sleep preventers: IODisplayWrangler

So I have tried every methods I could find in both EN and CH forums but it still not work... I wonder that whether there were mistakes in my patching process. What else should I do? I would be grateful if anyone could give me some suggestions ;_;

Problem reporting files and EFI/CLOVERS are attached.
you have failed to install FakeSMC.kext to /Library/Extensions
 
you have failed to install FakeSMC.kext to /Library/Extensions

After several experiments I managed to solve the problem. It's not about FakeSMC.kext, I put the kext in CLOVER/Kexts/Others and it loaded. I found that Rehabman's USB _PRW patch didn't patch some of the _PRW Method in other related Scopes (for my case it didn't patch CVNW and HDAS). I patched them manually and solved the problem finally. Anyway, thanks for your help.
 
Can you make a tutorial? Im having same issues

I don't know whether what I have done is correct and I'm not sure it will work for your case. I can briefly show you what I did:

1. run pmset -g log and log show --style syslog | grep "Wake reason" to know what caused your computer to wake instantly. In my case it was related to XHC.

2. Correctly installed USBInjectAll.kext and create a custom SSDT-UIAC.aml to inject USB Ports. Find ports that connected to internal devices(bluetooth, webcam, etc.), change the UsbConnector value of these internal port to 255(0xff). You can find a guide for this part easily. You can see the result in IORegistryExplorer if you successfully inject USB ports.

3. If you failed to inject USB ports using USBInjectAll.kext, then try to use Hackintool to create a USBPorts.kext. If you managed to do (2), then continue.

4. Patch your DSDT with the patch usb_prw_0x0d_xhc_skl.txt or usb_prw_0x6d_xhc_skl.txt using MaciASL. This step requires you to have basic knowledge about DSDT patching and error fixing. I don't know what's the difference between the two patches, but from the apply number you can easily tell which patch fits your computer. In my case I used the latter.

5. You may meet with some errors while patching your DSDT. You should know how to fix errors in your DSDT. Most cases the errors occurred were not so complex. If you don't meet errors, that will be great. Load your DSDT on next boot.

6. See if your problem is solved. If yes then congrats, if not, repeat (1) to find more details about wake reason. If it still gives "XHC", you may need to check your DSDT manually to see whether _PRW method or name is correctly patched in Device XHC. If it is correctly patched, the _PRW method should be like this:
Code:
            Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
            {
                Return (Package (0x02)
                {
                    0x6D,          // here is 0x6D because I used usb_prw_0x6d_xhc_skl.txt
                    Zero
                })
            }

If not, you can try to change _PRW method into this, or directly delete _PRW method(I don't know what will happen if you delete it).

7. If the wake reason gives other value, you can do as (6), but you should find _PRW in the scope that (1) gives. For example, after I did (5), the wake reason has changed into "CNVW XHC", then I checked the _PRW method in CNVW scope. Patch the _PRW method manually.

8. Compile DSDT and reboot.

That's what I did. My expression may be hard to understand as my English is poor...If you have any problem I will try to answer.

PS. My laptop is Coffee lake. If your computer is not skylake/kaby lake/coffee lake or higher, the above patch may not work.
 
Status
Not open for further replies.
Back
Top