aleixsr / Ryzentosh

OpenCore EFI for running OS X on Gigabyte B550i Aorus Pro AX
31 stars 3 forks source link

Resumed immedaitely after sleep #1

Closed evenlee closed 3 years ago

evenlee commented 3 years ago

Hi @aleixsr, I made a build based on your efi, and all works fine at the beginning. My build: CPU: 5800X NetworkCard: DW1560 Graphics: ASRock RX 5500 XT Challenger ITX 8G

but last week I met bluetooth problem(update to 11.2.1), my bluetooth cannot work. Then I googled a while, and most of people suggest it should be USB Issue, then I visited the bios page, it do have a new version F13c, which claims a usb fix, so I upgraded the bios and my bluetooth is back.

But I found an sleep issue, the computer resumed immediately after sleep. I do see the lights on board turned off, but turns up immediately again(CPU Fan runs), and my screen is still black, bluetooth device can lead to the screen again without login. do you have any advice for the issue, thanks in advance.

aleixsr commented 3 years ago

I'll check and keep you updated.

evenlee commented 3 years ago

Thanks @aleixsr .

I've tried make dw1560 internal with hackintool, and replaced USBPorts.kext, still not work. I aslo updated OC to 0.6.6, the issue still exists.

image

here's logs for reference:

      ❯ log show --last 1d | grep "Wake reason"
      2021-03-01 23:12:51.537121+0800 0x3b7      Default     0x0                  81     0    powerd: [powerd:sleepWake] Wake reason: "<private>"  identity: "<private>"
      2021-03-01 23:13:26.876481+0800 0x74       Default     0x0                  0      0    kernel: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: GPP0
      2021-03-01 23:13:26.876481+0800 0x74       Default     0x0                  0      0    kernel: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: GPP0
      2021-03-01 23:13:34.106652+0800 0x1dec     Default     0x0                  0      0    kernel: (AppleTopCaseHIDEventDriver) [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Button (0x03)
      2021-03-02 18:52:09.339713+0800 0xad8      Default     0x0                  0      0    kernel: (AppleTopCaseHIDEventDriver) [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Button (0x03)
      2021-03-02 18:52:55.265481+0800 0x36a      Default     0x0                  81     0    powerd: [powerd:sleepWake] Wake reason: "<private>"  identity: "<private>"
      2021-03-02 18:53:29.369598+0800 0x74       Default     0x0                  0      0    kernel: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: GPP0
      2021-03-02 18:53:29.369599+0800 0x74       Default     0x0                  0      0    kernel: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: GPP0
      2021-03-02 18:53:36.077420+0800 0x1d09     Default     0x0                  0      0    kernel: (AppleTopCaseHIDEventDriver) [HID] [ATC] AppleDeviceManagementHIDEventService::processWakeReason Wake reason: Host (0x01)

log from I click sleep to it resumes and I click mouse or keyboard pmset -g log

 2021-03-02 18:52:55 +0800 Notification         Display is turned off
      2021-03-02 18:52:55 +0800 Assertions              PID 222(runningboardd) Summary PreventUserIdleSystemSleep "daemon<com.apple.akd(501)>222-427-197:com.apple.CFNetwork.StorageDB" 00:00:00  id:0x0x100008277 [System: PrevIdle DeclUser BGTask IPushSrvc kDisp]
      2021-03-02 18:52:55 +0800 Assertions              PID 139(WindowServer) Summary UserIsActive "com.apple.iohideventsystem.queue.tickle serviceID:100000699 name:NULL product:Magic Mouse 2 eventType:17" 00:00:00  id:0x0x9000080d8 [System: PrevIdle DeclUser BGTask IPushSrvc kDisp]
      2021-03-02 18:52:55 +0800 Assertions              PID 97(mds) Summary BackgroundTask "com.apple.metadata.mds.power" 00:00:54  id:0x0xb0000800b [System: PrevIdle DeclUser BGTask IPushSrvc kDisp]
      2021-03-02 18:52:55 +0800 Assertions              PID 109(apsd) Summary InteractivePushServiceTask "com.apple.apsd-outgoingmessage" 00:00:32  id:0x0x12000081dd [System: PrevIdle DeclUser BGTask IPushSrvc kDisp]
      2021-03-02 18:52:55 +0800 Assertions              PID 109(apsd) Summary InteractivePushServiceTask "com.apple.apsd-connectionestablish-push.apple.com" 00:00:00  id:0x0x1200008278 [System: PrevIdle DeclUser BGTask IPushSrvc kDisp]
      2021-03-02 18:52:55 +0800 Assertions              PID 109(apsd) Summary InteractivePushServiceTask "com.apple.apsd-connectinguser-push.apple.com" 00:00:00  id:0x0x1200008279 [System: PrevIdle DeclUser BGTask IPushSrvc kDisp]
      2021-03-02 18:52:55 +0800 Assertions              Kernel Idle sleep preventers: -None-
      2021-03-02 18:52:55 +0800 Assertions              [System: PrevIdle DeclUser BGTask IPushSrvc kDisp]
      2021-03-02 18:52:55 +0800 Assertions              PID 81(powerd) Created InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:00  id:0x0xd0000827a [System: PrevIdle DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:55 +0800 AppWakeReason           AppWoke:com.apple.bluetoothd-blueavengers Reason:BlueAvengers: Toggle beacon state
      2021-03-02 18:52:55 +0800 Assertions              PID 139(WindowServer) TurnedOn UserIsActive "com.apple.iohideventsystem.queue.tickle serviceID:100000699 name:NULL product:Magic Mouse 2 eventType:17" 00:00:00  id:0x0x9000080d8 [System: PrevIdle DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:56 +0800 Assertions              PID 109(apsd) Released InteractivePushServiceTask "com.apple.apsd-outgoingmessage" 00:00:33  id:0x0x12000081dd [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleSystemSleep "com.apple.audio.context126.preventuseridlesleep" 00:00:46  id:0x0x1000080b6 [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleSystemSleep "com.apple.audio.context182.preventuseridlesleep" 00:00:39  id:0x0x10000817f [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleSystemSleep "com.apple.audio.context158.preventuseridlesleep" 00:00:41  id:0x0x1000080df [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleSystemSleep "com.apple.audio.context127.preventuseridlesleep" 00:00:46  id:0x0x1000080ba [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleSystemSleep "com.apple.audio.context166.preventuseridlesleep" 00:00:41  id:0x0x1000080fd [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleDisplaySleep "com.apple.audio.context126.preventuseridledisplaysleep" 00:00:46  id:0x0x5000080b7 [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleSystemSleep "com.apple.audio.context82.preventuseridlesleep" 00:00:46  id:0x0x1000080d6 [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleSystemSleep "com.apple.audio.context174.preventuseridlesleep" 00:00:41  id:0x0x10000814c [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleDisplaySleep "com.apple.audio.context182.preventuseridledisplaysleep" 00:00:39  id:0x0x500008180 [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleDisplaySleep "com.apple.audio.context158.preventuseridledisplaysleep" 00:00:41  id:0x0x5000080e0 [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleDisplaySleep "com.apple.audio.context127.preventuseridledisplaysleep" 00:00:46  id:0x0x5000080bb [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleDisplaySleep "com.apple.audio.context166.preventuseridledisplaysleep" 00:00:41  id:0x0x5000080fe [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleDisplaySleep "com.apple.audio.context82.preventuseridledisplaysleep" 00:00:46  id:0x0x5000080d7 [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:57 +0800 Assertions              PID 195(coreaudiod) Released PreventUserIdleDisplaySleep "com.apple.audio.context174.preventuseridledisplaysleep" 00:00:41  id:0x0x50000814d [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:52:58 +0800 Notification            Next immediate inactivity window start:'2021-03-02 23:45:00 +0800' end:'2021-03-03 13:00:00 +0800'
      2021-03-02 18:52:58 +0800 Notification            Next largest inactivity window start:'2021-03-02 23:45:00 +0800' end:'2021-03-03 13:00:00 +0800'
      2021-03-02 18:53:10 +0800 Assertions              PID 81(powerd) TimedOut InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:15  id:0x0xd0000827a [System: DeclUser BGTask SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:53:10 +0800 Assertions              Summary- [System: DeclUser BGTask IPushSrvc kDisp] Using AC
      2021-03-02 18:53:10 +0800 Sleep                   Entering Sleep state due to 'Software Sleep pid=154': Using AC (Charge:0%) 22 secs
      2021-03-02 18:53:14 +0800 Assertions              PID 109(apsd) Released InteractivePushServiceTask "com.apple.apsd-wakeconnection-push.apple.com" 00:00:19  id:0x0x1200008280 [System: PrevIdle DeclUser BGTask IPushSrvc kDisp]
      2021-03-02 18:53:17 +0800 Assertions              PID 97(mds) Released BackgroundTask "com.apple.metadata.mds.power" 00:01:16  id:0x0xb0000800b [System: DeclUser BGTask IPushSrvc kDisp]
      2021-03-02 18:53:22 +0800 Assertions              PID 109(apsd) Released InteractivePushServiceTask "com.apple.apsd-recreatecourierstate-push.apple.com" 00:00:10  id:0x0x12000082bb [System: DeclUser IPushSrvc kDisp]
      2021-03-02 18:53:25 +0800 Assertions              PID 109(apsd) Released InteractivePushServiceTask "com.apple.apsd-requestkeepaliveproxy-push.apple.com" 00:00:15  id:0x0x12000082b8 [System: DeclUser IPushSrvc kDisp]
      2021-03-02 18:53:26 +0800 PM Client Acks          Delays to Sleep notifications: [com.apple.apsd is slow(16664 ms)]
      2021-03-02 18:53:31 +0800 Assertions              PID 215(mDNSResponder) Created MaintenanceWake "mDNSResponder:maintenance" 00:00:00  id:0x0xd000082cb [System: PrevIdle DeclUser BGTask SRPrevSleep kCPU kDisp]
      2021-03-02 18:53:31 +0800 Assertions              PID 215(mDNSResponder) Released MaintenanceWake "mDNSResponder:maintenance" 00:00:00  id:0x0xd000082cb [System: DeclUser BGTask kDisp]
      2021-03-02 18:53:32 +0800 Assertions              PID 81(powerd) Created InternalPreventSleep "PM configd - Wait for Device enumeration" 00:00:00  id:0x0xd000082cf [System: DeclUser BGTask SRPrevSleep kCPU kDisp]
      2021-03-02 18:53:32 +0800 DarkWake                DarkWake from Normal Sleep [CDN] : due to GPP0/ Using AC (Charge:0%) 6 secs
      2021-03-02 18:53:32 +0800 HibernateStats          hibmode=0 standbydelaylow=0 standbydelayhigh=0                                        289
      2021-03-02 18:53:32 +0800 WakeTime                WakeTime: 1.893 sec
      2021-03-02 18:53:32 +0800 Kernel Client Acks      Delays to Sleep notifications: [AppleHDADriver driver is slow(msg: SetState to 0)(1625 ms)] [powerd is slow(16654 ms)] [AppleDeviceManagementHIDEventService driver is slow(msg: WillChangeState to 2)(368 ms)] [BroadcomBluetoothHostControllerUSBTransport driver is slow(msg: SetState to 1)(527 ms)] [IONVMeController driver is slow(msg: SetState to 0)(657 ms)] [ATY,Python driver is slow(msg: SetState to 0)(1246 ms)]
      2021-03-02 18:53:32 +0800 Kernel Client Acks      Delays to Wake notifications: [POT4 driver is slow(msg: WillChangeState to 2)(300 ms)] [en1 driver is slow(msg: DidChangeState to 1)(762 ms)] [PRT5 driver is slow(msg: SetState to 2)(1179 ms)] [PRT1 driver is slow(msg: SetState to 2)(1180 ms)] [PRT2 driver is slow(msg: SetState to 2)(1181 ms)] [PRT4 driver is slow(msg: SetState to 2)(1186 ms)] [PRT0 driver is slow(msg: SetState to 2)(1186 ms)] [PRT3 driver is slow(msg: SetState to 2)(1188 ms)] [PRT5 driver is slow(msg: DidChangeState to 3)(300 ms)] [PRT7 driver is slow(msg: DidChangeState to 2)(300 ms)] [PRT6 driver is slow(msg: DidChangeState to 2)(301 ms)] [PRT8 driver is slow(msg: DidChangeState to 3)(301 ms)]
      2021-03-02 18:53:32 +0800 Assertions              PID 81(powerd) Created InternalPreventSleep "com.apple.powermanagement.acwakelinger" 00:00:00  id:0x0xd000082d0 [System: DeclUser BGTask SRPrevSleep kCPU kDisp]
      2021-03-02 18:53:36 +0800 Assertions              PID 139(WindowServer) TurnedOn UserIsActive "com.apple.iohideventsystem.queue.tickle serviceID:100000868 name:AppleUserHIDEventSe product:HHKB-Hybrid eventType:3" 00:00:00  id:0x0x9000080d8 [System: PrevIdle DeclUser SRPrevSleep IPushSrvc kCPU kDisp]
      2021-03-02 18:53:36 +0800 Assertions              Kernel Idle sleep preventers: IODisplayWrangler
      2021-03-02 18:53:36 +0800 Notification            Display is turned on
      2021-03-02 18:53:38 +0800 Wake                    DarkWake to FullWake from Normal Sleep [CDNVA] : due to UserActivity Assertion Using AC (Charge:0%)
      2021-03-02 18:53:38 +0800 HibernateStats          hibmode=0 standbydelaylow=0 standbydelayhigh=0                                        289
      2021-03-02 18:53:38 +0800 WakeTime                WakeTime: 2.101 sec
      2021-03-02 18:53:38 +0800 Kernel Client Acks      Delays to Sleep notifications: [AppleHDADriver driver is slow(msg: SetState to 0)(1625 ms)] [powerd is slow(16654 ms)] [AppleDeviceManagementHIDEventService driver is slow(msg: WillChangeState to 2)(368 ms)] [BroadcomBluetoothHostControllerUSBTransport driver is slow(msg: SetState to 1)(527 ms)] [IONVMeController driver is slow(msg: SetState to 0)(657 ms)] [ATY,Python driver is slow(msg: SetState to 0)(1246 ms)]
      2021-03-02 18:53:38 +0800 Kernel Client Acks      Delays to Wake notifications: [POT4 driver is slow(msg: WillChangeState to 2)(300 ms)] [en1 driver is slow(msg: DidChangeState to 1)(762 ms)] [PRT5 driver is slow(msg: SetState to 2)(1179 ms)] [PRT1 driver is slow(msg: SetState to 2)(1180 ms)] [PRT2 driver is slow(msg: SetState to 2)(1181 ms)] [PRT4 driver is slow(msg: SetState to 2)(1186 ms)] [PRT0 driver is slow(msg: SetState to 2)(1186 ms)] [PRT3 driver is slow(msg: SetState to 2)(1188 ms)] [PRT5 driver is slow(msg: DidChangeState to 3)(300 ms)] [PRT7 driver is slow(msg: DidChangeState to 2)(300 ms)] [PRT6 driver is slow(msg: DidChangeState to 2)(301 ms)] [PRT8 driver is slow(msg: DidChangeState to 3)(301 ms)] [AppleHDADriver driver is slow(msg: SetState to 1)(2100 ms)]
      2021-03-02 18:53:46 +0800 Assertions              PID 81(powerd) Released InternalPreventSleep "PM configd - Wait for Device enumeration" 00:00:13  id:0x0xd000082cf [System: DeclUser SRPrevSleep kCPU kDisp]
      2021-03-02 18:54:18 +0800 Assertions              PID 81(powerd) TimedOut InternalPreventSleep "com.apple.powermanagement.acwakelinger" 00:00:45  id:0x0xd000082d0 [System: PrevIdle DeclUser SRPrevSleep kCPU kDisp]
      2021-03-02 18:56:19 +0800 Assertions              PID 428(sharingd) Released PreventUserIdleSystemSleep "Handoff" 00:02:12  id:0x0x10000837e [System: DeclUser BGTask kDisp]
      2021-03-02 18:58:56 +0800 Assertions              PID 368(UserEventAgent) Released BackgroundTask "com.apple.SafariBookmarksSyncAgent.XPC.ZoneSubscriptionRegistration" 00:04:32  id:0x0xb00008391 [System: PrevIdle DeclUser kDisp]
      2021-03-02 18:59:10 +0800 Assertions              PID 428(sharingd) Released PreventUserIdleSystemSleep "Handoff" 00:02:12  id:0x0x1000083f2 [System: DeclUser kDisp]
      2021-03-02 19:03:54 +0800 Assertions              PID 428(sharingd) Released PreventUserIdleSystemSleep "Handoff" 00:02:13  id:0x0x1000084f2 [System: DeclUser kDisp]

      Total Sleep/Wakes since boot at 2021-03-02 18:51:58 +0800 :1

      2021-03-02 19:04:16 +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 139(WindowServer): [0x0000001b000980d8] 00:00:00 UserIsActive named: "com.apple.iohideventsystem.queue.tickle serviceID:1000008b3 name:NULL product:Magic Mouse 2 eventType:17"
          Timeout will fire in 600 secs Action=TimeoutActionRelease
      Kernel Assertions: 0xc=USB,BT-HID
         id=505  level=255 0x4=USB creat=3/2/21, 7:03 PM description=com.apple.usb.externaldevice.00500000 owner=IOUSBHostDevice
         id=506  level=255 0x4=USB creat=3/2/21, 7:00 PM description=com.apple.usb.externaldevice.60400000 owner=HHKB-Hybrid
         id=507  level=255 0x8=BT-HID creat=3/2/21, 7:10 PM description=com.apple.driver.IOBluetoothHIDDriver owner=AppleHSBluetoothDevice
      Idle sleep preventers: IODisplayWrangler
aleixsr commented 3 years ago

I've this settings under Energy Saver section:

image

Also WOL disabled on BIOS, does it help ?

evenlee commented 3 years ago

I do disabled WOL on BOIS, and have same energy setting as yours, but still no luck image

have you upgraded bios and Mac OS to latest version?

evenlee commented 3 years ago

I've rolled back to your Dec 24 EFI, still no luck, seems the bois upgrade introduced the issue, will keep digging the root reason.

evenlee commented 3 years ago

Update: I've downgraded the bios to F12, and the sleep comes back, but my usb mapping cannot show PTXH, instead is AppleUSBXHCIPCI in the left upper corner(which is PTXH in F13c), I think the F13c Bios makes the PTXH recognizable, but I don't know how I can let Mac recognize it as AppleUSBXHCIPCI.

please feel free to close the issue if you think no need to fix it in BIOS F13c, thanks. image

bbedward commented 3 years ago

I think this is just a bios issue with the f13. Suspend/sleep also stopped working on Linux for me unless I downgrade to F12 or prior. Fans just ramp to full speed when it suspends on F13 and I have to hard reset

aleixsr commented 3 years ago

Hello, I confirmed it is a F13 bug. Using F12 BIOS works fine under 11.2.3.

evenlee commented 3 years ago

Thanks @aleixsr, I tried F13c, still have same issue, seems they did not fix it, I am keeping F12.