Skip to content

Instantly share code, notes, and snippets.

@darwin
Last active June 18, 2020 05:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darwin/7103ca695eab1fb48f7ed24ea1954a89 to your computer and use it in GitHub Desktop.
Save darwin/7103ca695eab1fb48f7ed24ea1954a89 to your computer and use it in GitHub Desktop.
[SOLVED] iMac sleep/wake issues caused by my USB mouse (Wake reason: XHC1)

Wake reason: XHC1

Since macOS High Sierra (maybe even Sierra) I started having trouble putting my iMac (mid 2015) to sleep. After installing clean Mojave system the problem didn't go away, even after jumping through various hoops and trying to disable every software which might be causing it.

The problem

After entering sleep mode the computer did DarkWake unexpectedly. Usually within one minute after sleeping. This was especially annoying because my external drives would spin up at that point.

The solution

I was able to isolate the problem to rogue USB device causing this issue. In my case it was "SteelSeries Sensei Mouse".

Note that DarkWake means waking computer without turning display(s) on.

The problem technically:

In the log-01 you can identify:

  1. 2018-09-29 21:49:28 +0200 Sleep my computer finally entering sleep
  2. 2018-09-29 21:50:07 +0200 DarkWake wake due to "XHC1/" (caused by the mouse)
  3. 2018-09-29 21:50:32 +0200 Wake wake by me hitting a keyboard key

In the log-02 you can identify:

  1. 2018-09-29 21:43:47 +0200 Sleep
  2. 2018-09-29 21:46:01 +0200 DarkWake wake by me hitting a keyboard key
  3. 2018-09-29 21:46:02 +0200 Wake

Note the timing. In the first (bad) case the DarkWake was spontaneous caused by the mouse less than 1min after Sleep. And full Wake was done ~30s later by me. In the second (good) case DarkWake and Wake came together in reaction to me pressing a key, 2+ mins after Sleep.

> sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.1
BuildVersion:	18B45d

The rogue USB device "SteelSeries Sensei Mouse" Note that it is a mouse from 2013 and no longer available for purchase. Here is a historical review: https://www.youtube.com/watch?v=n4hdv5KbRks

SteelSeries  :

  Product ID:	0x1361
  Vendor ID:	0x1038
  Version:	0.00
  Speed:	Up to 12Mb/sec
  Manufacturer:	La-VIEW Technology
  Location ID:	0x14221000 / 27
  Current Available (mA):	500
  Current Required (mA):	200
  Extra Operating Current (mA):	0

Logs below were produced via pmset -g log

Time stamp Domain Message Duration Delay
========== ====== ======= ======== =====
UUID: 10F43584-1BC6-4C0B-A542-C66CB1358993
2018-09-29 21:48:58 +0200 Notification Display is turned off
2018-09-29 21:48:58 +0200 Assertions PID 54(powerd) Summary ExternalMedia "com.apple.powermanagement.externalmediamounted" 00:05:55 id:0x0x80000a1c4 [System: DeclUser kDisp]
2018-09-29 21:48:58 +0200 Assertions PID 97(hidd) Summary UserIsActive "com.apple.iohideventsystem.queue.tickle.4295001423.3" 00:00:00 id:0x0x900009c1e [System: DeclUser kDisp]
2018-09-29 21:48:58 +0200 Assertions Kernel Idle sleep preventers: -None-
2018-09-29 21:48:58 +0200 Assertions PID 54(powerd) Created InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:00 id:0x0xd0000a1ff [System: PrevIdle DeclUser SRPrevSleep kCPU kDisp]
2018-09-29 21:49:13 +0200 Assertions PID 54(powerd) TimedOut InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:15 id:0x0xd0000a1ff [System: DeclUser SRPrevSleep kCPU kDisp]
2018-09-29 21:49:28 +0200 Sleep Entering Sleep state due to 'Software Sleep pid=91': Using AC (Charge:0%) 39 secs
2018-09-29 21:49:31 +0200 PM Client Acks Delays to Sleep notifications: [com.apple.apsd is slow(2960 ms)]
2018-09-29 21:49:46 +0200 Kernel Client Acks Delays to Sleep notifications: [AMDFramebufferVI driver is slow(msg: SetState to 1)(374 ms)] [Spotify timed out(30000 ms)] [AppleThunderboltNHIType2 driver is slow(msg: WillChangeState to 2)(324 ms)] [IOSCSIPeripheralDeviceType00 driver is slow(msg: SetState to 0)(1074 ms)] [IOUSBMassStorageInterfaceNub driver is slow(msg: SetState to 0)(1072 ms)] [IOSCSIPeripheralDeviceType00 driver is slow(msg: SetState to 0)(1732 ms)] [IOUSBMassStorageInterfaceNub driver is slow(msg: SetState to 0)(1730 ms)]
2018-09-29 21:49:46 +0200 Assertions PID 153(mDNSResponder) Created MaintenanceWake "mDNSResponder:maintenance" 00:00:00 id:0x0xd0000a212 [System: PrevIdle DeclUser BGTask SRPrevSleep kCPU kDisp]
2018-09-29 21:49:46 +0200 Assertions PID 153(mDNSResponder) Released MaintenanceWake "mDNSResponder:maintenance" 00:00:00 id:0x0xd0000a212 [System: PrevIdle DeclUser BGTask kDisp]
2018-09-29 21:50:07 +0200 Assertions PID 54(powerd) Created InternalPreventSleep "PM configd - Wait for Device enumeration" 00:00:00 id:0x0xd0000a214 [System: DeclUser SRPrevSleep kCPU kDisp]
2018-09-29 21:50:07 +0200 DarkWake DarkWake from Normal Sleep [CDN] due to XHC1/: Using AC (Charge:0%) 25 secs
2018-09-29 21:50:07 +0200 WakeDetails DriverReason:XHC1 - DriverDetails:
2018-09-29 21:50:07 +0200 HibernateStats hibmode=0 standbydelay=86400 571
2018-09-29 21:50:07 +0200 WakeTime WakeTime: 22.380 sec
2018-09-29 21:50:07 +0200 Kernel Client Acks Delays to Wake notifications: [AppleUSB30GLHub driver is slow(msg: DidChangeState to 2)(385 ms)] [AMDFramebufferVI driver is slow(msg: SetState to 1)(378 ms)] [en0 driver is slow(msg: DidChangeState to 2)(560 ms)] [IOUSBMassStorageInterfaceNub driver is slow(msg: SetState to 1)(1099 ms)] [IOUSBMassStorageInterfaceNub driver is slow(msg: SetState to 1)(1101 ms)] [IOUSBMassStorageDriverNub driver is slow(msg: SetState to 1)(1153 ms)] [IOUSBMassStorageDriverNub driver is slow(msg: SetState to 1)(1153 ms)] [PRT0 driver is slow(msg: SetState to 2)(1205 ms)] [AMDFramebufferVI driver is slow(msg: SetState to 1)(10057 ms)] [IOSCSIPeripheralDeviceType00 driver is slow(msg: SetState to 4)(16386 ms)] [IOSCSIPeripheralDeviceType00 driver is slow(msg: SetState to 4)(16686 ms)] [AMDFramebufferVI driver is slow(msg: SetState to 1)(10064 ms)] [AppleUSB30GLHub driver is slow(msg: DidChangeState to 2)(20919 ms)]
2018-09-29 21:50:07 +0200 Assertions PID 54(powerd) Created InternalPreventSleep "com.apple.powermanagement.acwakelinger" 00:00:00 id:0x0xd0000a215 [System: DeclUser SRPrevSleep kCPU kDisp]
2018-09-29 21:50:12 +0200 Assertions PID 54(powerd) Released InternalPreventSleep "PM configd - Wait for Device enumeration" 00:00:05 id:0x0xd0000a214 [System: DeclUser SRPrevSleep kCPU kDisp]
2018-09-29 21:50:32 +0200 Assertions PID 97(hidd) TurnedOn UserIsActive "com.apple.iohideventsystem.queue.tickle.4295001420.3" 00:00:00 id:0x0x900009c1e [System: DeclUser SRPrevSleep kCPU kDisp]
2018-09-29 21:50:32 +0200 Assertions Kernel Idle sleep preventers: IODisplayWrangler
2018-09-29 21:50:32 +0200 Notification Display is turned on
2018-09-29 21:50:32 +0200 Wake DarkWake to FullWake from Normal Sleep [CDNVA] due to UserActivity Assertion: Using AC (Charge:0%)
2018-09-29 21:50:32 +0200 WakeDetails DriverReason:XHC1 - DriverDetails:
2018-09-29 21:50:32 +0200 HibernateStats hibmode=0 standbydelay=86400 571
2018-09-29 21:50:32 +0200 WakeTime WakeTime: 0.710 sec
2018-09-29 21:50:32 +0200 Kernel Client Acks Delays to Wake notifications: [AppleHDADriver driver is slow(msg: SetState to 1)(479 ms)] [AMDFramebufferVI driver is slow(msg: DidChangeState to 2)(303 ms)] [AMDFramebufferVI driver is slow(msg: SetState to 2)(484 ms)]
Total Sleep/Wakes since boot at 2018-09-29 10:20:00 +0200 :349
2018-09-29 21:50:39 +0200 : Showing all currently held IOKit power assertions
Assertion status system-wide:
BackgroundTask 0
ApplePushServiceTask 0
UserIsActive 1
PreventUserIdleDisplaySleep 0
PreventSystemSleep 0
ExternalMedia 1
PreventUserIdleSystemSleep 1
NetworkClientActive 0
InternalPreventSleep 1
Listed by owning process:
pid 246(coreaudiod): [0x0000923700019b50] 00:00:07 PreventUserIdleSystemSleep named: "com.apple.audio.AppleHDAEngineOutput:1B,0,1,2:0.context.preventuseridlesleep"
Created for PID: 3631.
pid 54(powerd): [0x000090e90008a1c4] 00:07:36 ExternalMedia named: "com.apple.powermanagement.externalmediamounted"
pid 54(powerd): [0x0000921e000da215] 00:00:32 InternalPreventSleep named: "com.apple.powermanagement.acwakelinger"
Timeout will fire in 13 secs Action=TimeoutActionRelease
pid 97(hidd): [0x0000758f00099c1e] 00:00:01 UserIsActive named: "com.apple.iohideventsystem.queue.tickle.4295001420.3"
Timeout will fire in 299 secs Action=TimeoutActionRelease
Kernel Assertions: 0x4=USB
id=1230 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14400000 owner=IOUSBHostDevice
id=1232 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14430000 owner=USB2.0 Hub
id=1234 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14434000 owner=USB2.0 Hub
id=1236 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14a00000 owner=USB3.0 Hub
id=1238 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14200000 owner=USB2.0 Hub
id=1241 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14a40000 owner=USB3.0 Hub
id=1244 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14240000 owner=USB2.0 Hub
id=1247 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14241000 owner=Yubico Yubikey II
id=1248 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14244000 owner=Das Keyboard
id=1250 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14900000 owner=My Book 25DA
id=1251 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14800000 owner=My Book 25EE
id=1255 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14221000 owner=SteelSeries
Idle sleep preventers: IODisplayWrangler
Time stamp Domain Message Duration Delay
========== ====== ======= ======== =====
UUID: 83D60EEF-B71F-4C76-B71F-E2FE731E640C
2018-09-29 21:43:17 +0200 Notification Display is turned off
2018-09-29 21:43:17 +0200 Assertions PID 54(powerd) Summary ExternalMedia "com.apple.powermanagement.externalmediamounted" 00:00:14 id:0x0x80000a1c4 [System: DeclUser kDisp]
2018-09-29 21:43:17 +0200 Assertions PID 97(hidd) Summary UserIsActive "com.apple.iohideventsystem.queue.tickle.4295001423.3" 00:00:00 id:0x0x900009c1e [System: DeclUser kDisp]
2018-09-29 21:43:17 +0200 Assertions Kernel Idle sleep preventers: -None-
2018-09-29 21:43:17 +0200 Assertions PID 54(powerd) Created InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:00 id:0x0xd0000a1c6 [System: PrevIdle DeclUser SRPrevSleep kCPU kDisp]
2018-09-29 21:43:32 +0200 Assertions PID 54(powerd) TimedOut InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:15 id:0x0xd0000a1c6 [System: DeclUser SRPrevSleep kCPU kDisp]
2018-09-29 21:43:32 +0200 Assertions Summary- [System: DeclUser kDisp] Using AC
2018-09-29 21:43:47 +0200 Sleep Entering Sleep state due to 'Software Sleep pid=91': Using AC (Charge:0%) 134 secs
2018-09-29 21:43:50 +0200 PM Client Acks Delays to Sleep notifications: [com.apple.apsd is slow(2994 ms)]
2018-09-29 21:45:39 +0200 Kernel Client Acks Delays to Sleep notifications: [AMDFramebufferVI driver is slow(msg: SetState to 1)(316 ms)] [AMDFramebufferVI driver is slow(msg: SetState to 1)(337 ms)] [AMDFramebufferVI driver is slow(msg: SetState to 1)(490 ms)] [Spotify timed out(30000 ms)] [AppleThunderboltNHIType2 driver is slow(msg: WillChangeState to 2)(327 ms)] [IOSCSIPeripheralDeviceType00 driver is slow(msg: SetState to 0)(1667 ms)] [IOUSBMassStorageInterfaceNub driver is slow(msg: SetState to 0)(1664 ms)] [IOSCSIPeripheralDeviceType00 driver is slow(msg: SetState to 0)(3659 ms)] [IOUSBMassStorageInterfaceNub driver is slow(msg: SetState to 0)(3657 ms)]
2018-09-29 21:45:39 +0200 Assertions PID 153(mDNSResponder) Created MaintenanceWake "mDNSResponder:maintenance" 00:00:00 id:0x0xd0000a1dc [System: PrevIdle DeclUser BGTask SRPrevSleep kCPU kDisp]
2018-09-29 21:45:39 +0200 Assertions PID 153(mDNSResponder) Released MaintenanceWake "mDNSResponder:maintenance" 00:00:00 id:0x0xd0000a1dc [System: PrevIdle DeclUser BGTask kDisp]
2018-09-29 21:46:01 +0200 Assertions PID 54(powerd) Created InternalPreventSleep "PM configd - Wait for Device enumeration" 00:00:00 id:0x0xd0000a1e0 [System: DeclUser SRPrevSleep kCPU kDisp]
2018-09-29 21:46:01 +0200 DarkWake DarkWake from Normal Sleep [CDN] due to XHC1/HID Activity: Using AC (Charge:0%) 1 secs
2018-09-29 21:46:01 +0200 WakeDetails DriverReason:XHC1 - DriverDetails:
2018-09-29 21:46:01 +0200 HibernateStats hibmode=0 standbydelay=86400 570
2018-09-29 21:46:01 +0200 WakeTime WakeTime: 23.380 sec
2018-09-29 21:46:01 +0200 Kernel Client Acks Delays to Wake notifications: [AppleUSB30GLHub driver is slow(msg: DidChangeState to 2)(396 ms)] [AMDFramebufferVI driver is slow(msg: SetState to 1)(379 ms)] [en0 driver is slow(msg: DidChangeState to 2)(563 ms)] [IOUSBMassStorageInterfaceNub driver is slow(msg: SetState to 1)(1097 ms)] [IOUSBMassStorageDriverNub driver is slow(msg: SetState to 1)(1141 ms)] [IOUSBMassStorageInterfaceNub driver is slow(msg: SetState to 1)(1098 ms)] [IOUSBMassStorageDriverNub driver is slow(msg: SetState to 1)(1153 ms)] [PRT0 driver is slow(msg: SetState to 2)(1214 ms)] [AMDFramebufferVI driver is slow(msg: SetState to 1)(10067 ms)] [IOSCSIPeripheralDeviceType00 driver is slow(msg: SetState to 4)(17413 ms)] [IOSCSIPeripheralDeviceType00 driver is slow(msg: SetState to 4)(17922 ms)] [AMDFramebufferVI driver is slow(msg: SetState to 1)(10064 ms)] [AppleUSB30GLHub driver is slow(msg: DidChangeState to 2)(20916 ms)]
2018-09-29 21:46:01 +0200 Assertions PID 54(powerd) Created InternalPreventSleep "com.apple.powermanagement.acwakelinger" 00:00:00 id:0x0xd0000a1e1 [System: DeclUser SRPrevSleep kCPU kDisp]
2018-09-29 21:46:01 +0200 Assertions Kernel Idle sleep preventers: IODisplayWrangler
2018-09-29 21:46:01 +0200 Notification Display is turned on
2018-09-29 21:46:02 +0200 Wake DarkWake to FullWake from Normal Sleep [CDNVA] due to HID Activity: Using AC (Charge:0%)
2018-09-29 21:46:02 +0200 WakeDetails DriverReason:XHC1 - DriverDetails:
2018-09-29 21:46:02 +0200 HibernateStats hibmode=0 standbydelay=86400 570
2018-09-29 21:46:02 +0200 WakeTime WakeTime: 0.502 sec
2018-09-29 21:46:02 +0200 Kernel Client Acks Delays to Wake notifications: [AppleUSB30HubPort driver is slow(msg: SetState to 3)(406 ms)] [AppleUSB30HubPort driver is slow(msg: SetState to 3)(406 ms)] [AppleUSB30HubPort driver is slow(msg: SetState to 3)(407 ms)] [AppleUSB30HubPort driver is slow(msg: SetState to 3)(407 ms)] [AppleHDADriver driver is slow(msg: SetState to 1)(475 ms)] [AMDFramebufferVI driver is slow(msg: DidChangeState to 2)(371 ms)] [AMDFramebufferVI driver is slow(msg: DidChangeState to 2)(305 ms)]
Total Sleep/Wakes since boot at 2018-09-29 10:20:00 +0200 :348
2018-09-29 21:46:10 +0200 : Showing all currently held IOKit power assertions
Assertion status system-wide:
BackgroundTask 0
ApplePushServiceTask 0
UserIsActive 1
PreventUserIdleDisplaySleep 0
PreventSystemSleep 0
ExternalMedia 1
PreventUserIdleSystemSleep 1
NetworkClientActive 0
InternalPreventSleep 1
Listed by owning process:
pid 246(coreaudiod): [0x0000913400019b50] 00:00:07 PreventUserIdleSystemSleep named: "com.apple.audio.AppleHDAEngineOutput:1B,0,1,2:0.context.preventuseridlesleep"
Created for PID: 3631.
pid 54(powerd): [0x000090e90008a1c4] 00:03:07 ExternalMedia named: "com.apple.powermanagement.externalmediamounted"
pid 54(powerd): [0x00009134000da1e0] 00:00:08 InternalPreventSleep named: "PM configd - Wait for Device enumeration"
Assertion applied on Battery power also
pid 54(powerd): [0x00009134000da1e1] 00:00:08 InternalPreventSleep named: "com.apple.powermanagement.acwakelinger"
Timeout will fire in 37 secs Action=TimeoutActionRelease
pid 97(hidd): [0x0000758f00099c1e] 00:00:01 UserIsActive named: "com.apple.iohideventsystem.queue.tickle.4295001420.3"
Timeout will fire in 299 secs Action=TimeoutActionRelease
Kernel Assertions: 0x4=USB
id=1230 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14400000 owner=IOUSBHostDevice
id=1232 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14430000 owner=USB2.0 Hub
id=1234 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14434000 owner=USB2.0 Hub
id=1236 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14a00000 owner=USB3.0 Hub
id=1238 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14200000 owner=USB2.0 Hub
id=1241 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14a40000 owner=USB3.0 Hub
id=1244 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14240000 owner=USB2.0 Hub
id=1247 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14241000 owner=Yubico Yubikey II
id=1248 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14244000 owner=Das Keyboard
id=1250 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14900000 owner=My Book 25DA
id=1251 level=255 0x4=USB mod=01/01/1970, 01:00 description=com.apple.usb.externaldevice.14800000 owner=My Book 25EE
Idle sleep preventers: IODisplayWrangler
@tehfink
Copy link

tehfink commented Apr 30, 2020

Thanks for this! Had the same problem. How did you solve it? Just unplugged the mouse??

@darwin
Copy link
Author

darwin commented Apr 30, 2020

I unplugged the mouse and threw it into a trash can. Problem solved.

@nessust
Copy link

nessust commented Jun 18, 2020

Thanks, in my case im thinking the problem are Music app.
PID 180(coreaudiod) Released PreventUserIdleDisplaySleep "com.apple.audio.context333.preventuseridledisplaysleep" 00:21:00 id:0
PID 180(coreaudiod) Released PreventUserIdleSystemSleep "com.apple.audio.context333.preventuseridlesleep" 00:21:00 id:0x0x10000
and many more at the same hour.

At 00:21:00 im in deep sleep, and I thought my MBA to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment