Login Register
MacInTouch Home Page MacInTouch Discussions

MacInTouch Amazon link...
iMac sleep/wake problems, USB3 bugs
 


2016-07-20 at 19:21 #1578   (1)
This is another one of those "my iMac keeps waking up right after it goes to sleep" problems that none of the solutions I've turned up searching have covered, and I'm wondering if there are perhaps similar experiences or suggestions of things to try.

What I've got: iMac 5K 2015 running 10.11.6 (though this problem has happened through at least every version of El Capitan)

What's connected: OWC Thunderbay 4 Mini (4-drive JBOD TB2 case), with drives RAIDed with SoftRAID, USB3 case with a 4TB drive installed used for Time Machine (directly connected to iMac), WireCutter-recommended Anker USB3 hub with nothing connected to it, wired Apple full-sized keyboard, Logitech G602 moue via Logitech Unifying Receiver plugged into one of the keyboard USB ports, Magic Trackpad (bluetooth), wireless Apple keyboard (also bluetooth).

Software configuration of note: Server is running on machine, wake-via-bluetooth disabled, wake-on-LAN disabled, Power Nap disabled. SoftRAID and the Logitech gaming mouse software are the only kexts installed that I'm aware of.

What happens: Sometimes, I select "sleep" from the Apple menu, and the computer goes to sleep. Sometimes, I select "sleep" and the computer goes fully to sleep (I can confirm, because the OWC Thunderbay goes to sleep and the drives spin down) then about 2 seconds later it wakes up. There is no apparent rhyme or reason to when it sleeps as expected and when it refuses to, other than once it starts not sleeping rebooting seems to be the only way to get it to sleep again. Turning off the mouse prior to selecting sleep with the trackpad doesn't make any difference.

Looking at the logs, the wake reason listed on a failed sleep is "XHC1". Searching tells me that this is usually caused by either Bluetooth device or a USB device. Which would make sense, if it was consistent, or even if I had it set so Bluetooth can wake the computer. But it's not, and I don't.

In the past, I had a situation where a buggy USB hub with something connected to it repeatably cause this behavior, but with this hub it works some fraction of the time (and additionally there's nothing connected to the hub).

What should I be looking at to try and narrow down the cause? The Unifying receiver seems the most likely source, but if so, why wouldn't it be consistent?

Incidentally, I'm aware that having Server.app running on the Mac prevents it from going to sleep automatically, period, and if there is another computer connected it will refuse to sleep entirely, but it will sleep some of the time otherwise.


2016-07-23 at 05:38 #1757   (2)
After extensive trial-and error, I have not managed to solve my problem, but I have identified at least one particularly weird thing that reliably causes it. Posting in hopes it might help others:

I have an Anker 6-port USB 3 hub with a couple of things plugged into it. It turns out that if I have my Anker USB3 SATA toaster drive dock plugged into one of the first 3 ports (counting from the back) of the hub, the computer will immediately wake after sleep--even if the drive dock is powered off. Plug it into any of the second three ports, and the computer sleeps as you’d expect.

This makes absolutely no sense to me, and notably a USB2 optical drive does not cause the same behavior on those rear three ports, whether it’s on or off. So it’s not the ports, it’s a specific device plugged into one of those ports.

I was having these issues well before I bought this hub, and without that dock connected at all, so that’s not the only cause, but it is at least one. Also, occasionally I’ve noticed that the computer won’t go all the way to sleep--just turn the screen off and sit there. The logs show some system components starting to go into standby, then coming right back out, but a full sleep never happens. Try again immediately after, and the system sleeps as expected.

I assume this all has something to do with external device voodoo, but it’s weird how random it is.


2016-07-23 at 08:09 #1758   (3)
(2016-07-23 at 05:38)M. Marshall wrote:  I have an Anker 6-port USB 3 hub with a couple of things plugged into it. It turns out that if I have my Anker USB3 SATA toaster drive dock plugged into one of the first 3 ports (counting from the back) of the hub, the computer will immediately wake after sleep--even if the drive dock is powered off. Plug it into any of the second three ports, and the computer sleeps as you’d expect.
This sounds like the description of an El Capitan problem with USB3. Is that the OS X you're using?

Ric


2016-07-25 at 01:50 #1868   (4)
(2016-07-23 at 08:09)Ric Ford wrote:  This sounds like the description of an El Capitan problem with USB3. Is that the OS X you're using?
Yes, as I said, El Capitan 10.11.6. I was having sleep issues under 10.10 as well, although I don’t know about this specific USB oddity, sine the hub is new.

I haven’t seen any documentation of this specific USB behavior. I have seen comments that some particular USB3 hubs don’t like El Capitan (and Win10), at least in earlier versions, but this hub was specifically singled out in reviews as one that doesn’t have issues.

And, indeed, apart from half the ports on it resulting in the Mac waking immediately from sleep, the thing does seem to work fine inasmuch as I’ve used it.


2016-07-25 at 09:20 #1875   (5)
(2016-07-25 at 01:50)M. Marshall wrote:  I haven’t seen any documentation of this specific USB behavior. I have seen comments that some particular USB3 hubs don’t like El Capitan (and Win10), at least in earlier versions, but this hub was specifically singled out in reviews as one that doesn’t have issues.
And, indeed, apart from half the ports on it resulting in the Mac waking immediately from sleep, the thing does seem to work fine inasmuch as I’ve used it.
Here is the discussion from earlier MacInTouch reader reports that may be related to the problem you're experiencing:

... In 10.11, an Apple engineer completely rewrote the USB drivers. The new drivers appear to employ the use of ACPI to a much greater extent than the previous drivers. The drivers use ACPI to obtain information about which ports are active. Often, this information is wrong and needs to be updated. But rather than update the information about what ports are active to correct the situation, Apple failed to do so. This is the bug.

In fact, this bug even prevented Apple's own Macs from working. So another Apple engineer rather than correct the bug, decided to hack OS X by creating a port injector to override the DSDT so that Macs could work. But this solution does not work for external USB 3.0 hubs.

The limitation that the new USB driver leaves us is that each external USB 3.0 hub needs one controller chip for every 4 USB 3.0 ports. Only a few external USB 3.0 hubs do this - such as the Plugable 7-Port USB 3.0 SuperSpeed Hub with 25W Power Adapter and Two Ports with BC 1.2 Charging Support.

So as a result of this driver bug, the vast majority of external USB 3.0 hubs with more than 4 ports fail.


2016-09-25 at 11:11 #6049   (6)
Here's an Apple support article about USB3 problems (which are plaguing me at the moment with three different USB3 hubs, but on OS X 10.9, not 10.11, seemingly worse after a macOS Sierra install on a different drive performed a firmware update without warning on my 2012 MacBook Pro 13").

Third-party USB hubs may incorrectly disconnect after wake from sleep, causing system instability


2016-09-25 at 12:51 #6053   (7)
(2016-09-25 at 11:11)Ric Ford wrote:  Here's an Apple support article about USB3 problems (which are plaguing me at the moment with three different USB3 hubs, but on OS X 10.9, not 10.11, seemingly worse after a macOS Sierra install on a different drive performed a firmware update without warning on my 2012 MacBook Pro 13").
   Third-party USB hubs may incorrectly disconnect after wake from sleep, causing system instability
From the referenced Apple article:

"Note: Third-party developers may change the specifications of their products at will without notifying Apple, so we cannot provide a list of hubs that correctly or incorrectly support the USB wakeup sequence."
My note:
Apple may change the specifications of their products at will without notifying users.


2016-09-26 at 10:26 #6094   (8)
(2016-07-25 at 09:20)Ric Ford wrote:  Here is the discussion from earlier MacInTouch reader reports that may be related to the problem you're experiencing:
I set up a 2014 Mac Mini running Yosemite a while back, and, after a couple days of testing, settled on using an Iogear USB 2.0 MicroHub that seemed to work reliably with an external USB 3.0 hard drive and a few other devices connected, even if the Mini was configured to sleep. I guess my testing wasn't thorough enough, because I suffered through months of odd reliability problems with the machine, even after disabling sleep. The fact that the machine was located a couple states away made diagnosis more difficult, but I was eventually able to pin the issues on the hub. I did some research and decided to replace the Iogear hub with a Plugable USB3-HUB7-81X. The Mini has been rock solid over the couple months since I swapped in the Plugable hub.


2016-09-26 at 10:59 #6098   (9)
(2016-09-26 at 10:26)rardin wrote:  I did some research and decided to replace the Iogear hub with a Plugable USB3-HUB7-81X. The Mini has been rock solid over the couple months since I swapped in the Plugable hub.
Interestingly, that is one of the three USB3 hubs I have, and it has not been trouble-free. As I think I mentioned, things were working fine until the macOS Sierra installer unexpectedly updated my firmware (when I was installing Sierra on an external disk), and I was powerless to stop it. This seemed to coincide with a big jump in USB/sleep problems, but I haven't been able to positively identify the culprit. Possibilities include a possibly-failing mouse, USB3 electrical/cable/RF issues, OS X software bugs, the new firmware, the MacBook Pro hardware, etc. I've done SMC and PRAM resets and a bunch of hard power-off reboots, amidst hub-swapping, cable-swapping, etc. The problems do seem to be associated with waking from sleep, though.


2016-09-26 at 12:29 #6107   (10)
I have the Monoprice 7-Port USB 3.0 Combo (4-USB3, 3-USB2 ports):
  http://www.monoprice.com/product?p_id=9956

It has been bulletproof, without any problems, for the 2+ years I have owned it. This is across several OS upgrades. Connected to a Late-2012 Quad Mac Mini.

-Sofa


wncmacs Show this Post
2016-09-26 at 14:24 #6124   (11)
wncmacs
I'm having USB hub troubles also, but with a USB 2.0 product.

I recently purchased a Sabrent HB-U14P 13 port USB hub that works fine with El Capitan and earlier Mac OS versions. However, Sierra is totally ignoring the hub after the update. Individual USB devices will mount when directly connected to the Mac, so it is definitely the hub having trouble. I've tried contacting Sabrent but have heard nothing from them. Looking for ideas from anyone as the hub was meeting my needs before the upgrade.


2016-09-27 at 16:07 #6219   (12)
(2016-09-26 at 10:59)Ric Ford wrote:  Interestingly, that is one of the three USB3 hubs I have, and it has not been trouble-free. As I think I mentioned, things were working fine until the macOS Sierra installer unexpectedly updated my firmware...
Curiously, that is the same Plugable USB 3 HUB7-81X that I have. Rock solid on iMac Snow Leopard 10.6.8. Sadly, forced to consider update to new OS X, I have been experimenting with El Cap 10.11.6 and twice in past 3 weeks have had wake from sleep freezes requiring force Quit & reboot to get out of it.

Like you, I did suspect other things might be the cause. Still have not figured it out, but may suspect the USB bug & this particular hub as well.


2016-09-27 at 18:10 #6230   (13)
(2016-09-27 at 16:07)KaverKarstGuy wrote:  Curiously, that is the same Plugable USB 3 HUB7-81X that I have. Rock solid on iMac Snow Leopard 10.6.8. Sadly, forced to consider update to new OS X, I have been experimenting with El Cap 10.11.6 and twice in past 3 weeks have had wake from sleep freezes requiring force Quit & reboot to get out of it.
That actually mirrors my experience. Everything was rock-solid in Snow Leopard, and I've been forced to update to newer OS X systems, which have sapped productivity with unwanted workflow changes (user interface changes) and less stability (most notably with USB wake/sleep). But part of the change is moving from USB2 to USB3, and I know USB3 is more troublesome all on its own. Or maybe it's a really old (and irreplaceably wonderful) mouse getting a little quirky. Or something else - I just don't know, but I do miss the stability and user interface and better apps on my old system (though the new one seems a bit faster).


2017-01-08 at 01:33 #12561   (14)
Gavin
... my iMac keeps waking up right after it goes to sleep
... wired Apple full-sized keyboard ...
I had the same problem and traced it to a 1 meter USB3 extension cable between my Apple keyboard and a USB port on my Mac. Once I'd removed the extension and plugged the keyboard directly into the computer, the wake-from-sleep problem disappeared, although I had to rearrange the physical layout between my Mac and the keyboard due to the shorter keyboard wire. I tested the extension a couple of times to make sure that it was the culprit.

(OS X 10.10.5 on MacBook Pro)


2017-10-08 at 04:43 #26565   (15)
I suffered from a bout of iMac insomnia some time shortly after upgrading to High Sierra, and tracked down a not-that-atypical cause but a rather unexpected solution.

Thorough testing revealed that the directly-connected USB3 drive I used for Time Machine was causing my Mac to wake immediately after it fell asleep. I rebooted repeatedly, toggled and turned off virtually every other software thing that could have been related, disconnected literally everything else (up to and including disabling bluetooth and wifi), reset the SMC and PRAM, and tested from the login screen before any user had even logged in.

The problem was definitely the USB3 external, which was particularly odd since it had been working fine for months, and I’m pretty sure was even okay immediately after installing High Sierra. My wife tells me the computer had refused to wake from sleep and she forced a reboot prior to this happening, so that could be what precipitated it.

Regardless, having exhausted all other options, I tried doing a scan with Disk Utility. It took an exceedingly long time (probably 2 or three hours, presumably due to Time Machine’s convoluted directory structure), and while I didn’t notice it identify that there were any directory problems, the iMac is now sleeping soundly like it’s supposed to.

With only a single data point I can’t say definitively that it wasn’t something else in the process of repeatedly mounting and unmounting the Time Machine volume that fixed the issue, but it was repeatably causing sleep problems before doing the scan and is definitely okay after.

So... if you’re stuck, and/or have identified an external volume as causing sleep issues, maybe try pointing Disk Utility at it and see if it helps.


2018-03-22 at 14:13 #35190   (16)
Short: My Mac will not sleep.

Long: My Mac Pro 5,1 (macOS 10.12.6) has developed issues with Sleep. Although the display will sleep the computer does not. I can manually put the machine to sleep using the menu—so it will sleep. It just won't go to sleep on its own. This started about a week ago. The only software change in that period was an update from Safari v10 to v11.

I've tried the following:
  • SMC reset
  • PRAM/NVRAM reset
  • Safe boot
  • Setting sleep parameters via pmset rather than the GUI interface
  • Disconnect FireWire and USB connections
  • Turn off File Sharing and Printer Sharing
  • Turn off Bluetooth
  • Running from different accounts
  • Booting from an internal drive to Mountain Lion
I briefly fixed the issue by deleting all com.apple.PowerManagement*.plist files from several locations. However, after less than a day it's back to not sleeping.

Suggestions? Thanks.


2018-03-23 at 08:31 #35233   (17)
TedM
(2018-03-22 at 14:13)David Blanchard wrote:  Short: My Mac will not sleep....
Use the Activity Monitor app and under any of the tabs (CPU, Memory, etc.) look for or enable the Preventing Sleep column. I have the same problem, and for me the usual culprit is hidd (Human Interface Device Daemon) process. I have not found a solution unfortunately.


2018-03-23 at 14:34 #35267   (18)
(2018-03-22 at 14:13)David Blanchard wrote:  Short: My Mac will not sleep.... Suggestions?
Here's a MacWorld article that might help: 
   "Find out what's keeping your Mac awake."

The article is old but should still be valid.


2018-03-23 at 15:07 #35263   (19)
(2018-03-23 at 08:31)TedM wrote:  Use the Activity Monitor app and under any of the tabs (CPU, Memory, etc.) look for or enable the Preventing Sleep column. I have the same problem, and for me the usual culprit is hidd (Human Interface Device Daemon) process. I have not found a solution unfortunately.
Thank you. I was not aware there was a Preventing Sleep column. After enabling it, there are two processes: hidd and SafariBookmarksSyncAgent preventing sleep. The latter is launched by one of the three new launch agents in /System/Library/LaunchAgents that showed up at the same time as my upgrade from Safari v10 to v11— and the same time the sleep problem started.

I don't use iCloud or any other form of Safari bookmark syncing, so I wonder if I can disable this?

Finally, I noticed that after a reboot and before I launch Safari, the SafariBookmarksSyncAgent does not prevent sleep. Once Safari is launched, it does prevent sleep. Interesting.


2018-03-23 at 15:12 #35272   (20)
(2018-03-23 at 14:34)jajvj wrote:  Here's a MacWorld article that might help: 
   "Find out what's keeping your Mac awake."
The article is old but should still be valid.
Thanks. I had already tested the assertions feature—it shows that there are no assertions preventing sleep: i.e.,
Assertion status system-wide:
   BackgroundTask                 1
   ApplePushServiceTask           0
   UserIsActive                   1
   PreventUserIdleDisplaySleep    0
   PreventSystemSleep             0
   ExternalMedia                  1
   PreventUserIdleSystemSleep     0
   NetworkClientActive            0


2018-03-26 at 13:06 #35369   (21)
(2018-03-23 at 15:07)David Blanchard wrote:  I was not aware there was a Preventing Sleep column. After enabling it, there are two processes: hidd and SafariBookmarksSyncAgent preventing sleep. The latter is launched by one of the three new launch agents in /System/Library/LaunchAgents that showed up at the same time as my upgrade from Safari v10 to v11— and the same time the sleep problem started.
I don't use iCloud or any other form of Safari bookmark syncing, so I wonder if I can disable this? Finally, I noticed that after a reboot and before I launch Safari, the SafariBookmarksSyncAgent does not prevent sleep. Once Safari is launched, it does prevent sleep. Interesting.
On my system (Sierra on MacBook Pro 11,3), SafariBookmarksSyncAgent is marked as not preventing sleep (even though Safari Technology Preview is always running).

hidd is marked as "yes" in preventing sleep, but I have no problems with sleep.


2018-03-26 at 13:47 #35375   (22)
(2018-03-23 at 15:07)David Blanchard wrote:  I was not aware there was a Preventing Sleep column. After enabling it, there are two processes: hidd and SafariBookmarksSyncAgent preventing sleep. The latter is launched by one of the three new launch agents in /System/Library/LaunchAgents that showed up at the same time as my upgrade from Safari v10 to v11— and the same time the sleep problem started.
From the man pages, I found this describing SafariBookmarksSyncAgent
SafariBookmarksSyncAgent is the system launch agent responsible for syncing Safari Bookmarks, Reading List, and tabs with iCloud via CloudKit.
I don't use iCloud and have never set it up, so I don't need any bookmark syncing.

I rebooted the Mac Pro into Snow Leopard and then removed the launch agents from /Volume/<Sierra>/System/Library/LaunchAgents. No need to mess around with SIP.

Problem solved. Thanks for the great suggestions.


2018-04-13 at 15:15 #36674   (23)
(2018-03-26 at 13:47)I wrote:  
I was not aware there was a Preventing Sleep column. After enabling it, there are two processes: hidd and SafariBookmarksSyncAgent preventing sleep. The latter is launched by one of the three new launch agents in /System/Library/LaunchAgents that showed up at the same time as my upgrade from Safari v10 to v11— and the same time the sleep problem started.
I rebooted the Mac Pro into Snow Leopard and then removed the launch agents from /Volume/<Sierra>/System/Library/LaunchAgents. No need to mess around with SIP. Problem solved.
I updated from Safari 11.0.3 to 11.1 a few days ago. The update replaced the removed Launch Agent mentioned above. Running diff shows the original and new plist files are the same. With the new version of Safari, the sleep problem does not occur. Perhaps Apple found a bug in Safari and fixed it...