Desktop power button not responding and random sleep issues
November 16, 2021
November 16, 2021
A few days ago I started having issues with my computer. When I was putting it to sleep (or hibernating), it would either crash and turn off immediately, or would fail to power the GPU and USB ports after waking up, leaving me with a black screen and unresponsive keyboard and mouse, and forcing me to hard reset it.
More notably, when it crashed instantly as it entered sleep state, the power button didnāt work anymore and I needed to unplug the machine for a minute or so before being able to start it again. This didnāt always work the first shot though but usually after doing it a few times, it would eventually boot up again.
Itās something that had already happened to me in rare occurrences during the past year, enough to get me frustrated and somewhat anxious when my machine effectively appeared to be bricked (thatās how I found the unplug replug trick by despair), but not to a point where I spent the time to understand and fix the root cause, as it always kinda fixed itself without my intervention.
I remember one time where the unplug replug trick didnāt work to a point where I decided to open the machine and see what I can do inside, but interestingly just the sheer fact of opening it and moving it around so that I can work on it fixed the problem, so I was just happy to have a working computer again and didnāt question it much.
Thatās until this week, coincidentally right before I upgrade to macOS Monterey.
I was still running Big Sur back then and itās been running smooth the whole year, but the day before I decide to upgrade to Monterey, I get those sleep issues again, mainly lack of GPU and USB power on wake (manifested by a black screen and unresponsive keyboard and mouse).
I figured it wasnāt worth fixing it now, and I might as well upgrade and see if it still happens. And while the upgrade goes smooth AF, I notice even more of those sleep issues after the fact. Theyāre not occasional anymore, they happen pretty much 90% of the time the computer sleeps, seemingly at random. It either fails to power the connected devices on wake or just crashes right away when being put to sleep and causes the unresponsive power button issue.
At that point I assume that it comes from the upgrade to Monterey, especially because Iām running a Hackintosh and I suspect that it must be for sure the culprit. After all, thereās āhackā in the name, even though itās been impressively stable since I use OpenCore.
I spend more time than Iām willing to admit trying everything to fix
power management
and sleep,
including using CPUFriend
and CPUFriendFriend to
fix the āsleep wake failure in EFIā system panics. But none of that
changes anything. I try to understand the different macOS sleep modes
and various
pmset
settings
to tune them and make things work but without any luck.
I also try to see if itās related to any of my external devices, and while the issues seem to happen less frequently when I unplug my 3 external drives and my external sound card, they still happen somewhat randomly in a way that I canāt reliably isolate any of those as being the problem.
At that point I lost more than 12 hours on this issue and Iām going on my second day of relentless debugging. I feel like Iāve tried everything possible and documented online about fixing sleep at the software, drivers and configuration level, and the precise issues and symptoms I run into donāt seem to exactly match any of the topics I find online.
I have a TP-Link PCI Wi-Fi card in there and Iām thinking maybe itās unsupported in a way that somehow causes the crashes with the new OS? I open the case and remove it, but this doesnāt seem to change anything.
I start questioning my actual hardware, looking more precisely at the ssue where the power button is unresponsive. I find a number of pages stating that a weak or dead CMOS battery could cause it (or also a faulty power supply š ).
The CMOS battery is easier to test and cheaper to replace than the power supply, so I start with that. My machine is now 5 years old so itās not exactly brand new, even though Iāve kept desktop computers much longer than that in the past without needing to replace a CMOS battery once in my life. Regardless, I take it out and test it with a multimeter only to find that it delivers a solid 3 volts as itās supposed to. I even test a brand new battery to compare and get the same results! Not the issue here, even though I wish it would have been as easy as replacing a CR2032 battery.
But when I put the battery back in place, my computer still doesnāt start! And turning off and on the PSU again doesnāt seem to work anymore. Did I accidentally fry the motherboard while manipulating the battery? I try one more time to be relieved by the sound of my machine booting, and welcoming me with a fresh BIOS reset screen. I configure everything again and boot macOS. At that point, all the USB devices are unplugged and Iām on a freshly configured BIOS. I try the sleep again but sadly it keeps crashing.
As a last resort, I try searching the very specific symptom Iām having and the hack I found to work around it: āneed to unplug and replug computer for it to startā. This sound so ridiculous and far fetched that Iāve never thought about searching just that before, but Iām pretty desperate at that point.
To my whole surprise, Iām not the only one to have this issue, and in those two pages from respectively 5 and 10 years ago, the pinned solution is the same:
Open up the computer and look at all the extra cables inside make sure theyāre all neatly bundled away from any part of the case they may be shorting it out.
After trying just about everything software wise (except a complete Windows reinstall) I was able to track the problem down to my PSU as many forums had suggested. It tuned out that some of the many extra connectors I had on my PSU I had stuffed into an extra empty drive bay in order to reduce the clutter inside the case. Somehow one of them had been causing a short. After moving the cables around and tiding them up neat and proper the problem has completely gone away (went from daily occurrence to two weeks so far with no problem).
ā Computer shuts off and wonāt turn back on until I unplug it
I did also stuff all my dangling PSU cables in an empty bay, and I thought I was doing myself a service by doing so, preventing a mess of cables in the middle of the case! I took the cables out of there, tidied them up differently and put them back in there in a way where they shouldnāt move around too much or touch anything.
After that? The computer boots just fine and I havenāt noticed a single crash or any of the issues I was having around sleep and wake. I progressively started to plug my sound card, then my external drives, testing the sleep every time (to more easily identify a culprit if it wasnāt fixed), and it kept working. Iāve restored all of my original ācleanā drivers, bootloader and system configuration (that I had modified during my attempts to fix the issue earlier), none of them caused any problem again.
Iāve performed more than 20 successful sleep and wake cycles since then, whether I explicitly put the computer to sleep or let it hibernates by itself after a period of inactivity.
At that point Iām somewhat confident that like in the two posts above, the dangling PSU cables in the unit were shorting and causes those issues. The fact they caused instability specifically at the sleep and wake level were probably very specific to me and the precise way the cables where shorting each other.
And the reason why the problem appeared to fix itself when unplugging and replugging the machine, or sometimes by just opening it and looking at it, doing no particular change inside? Those mere manipulations probably bumped the dangling wires inside just enough so that they werenāt shorting anymore, until they do again.
Itās still hard for me to precisely explain why this was happening especially around sleep, and how the machine would otherwise be perfectly stable and never crash as long as it didnāt hit a sleep and wake cycle. Maybe something to do with the fans slightly moving the dangling cables while blowing at them? Iām not technical enough in hardware and electronics to make sense of that, so if any of you reading that have a better idea, please let me know!
And at the very least I hope that if youāre reading this because of a similar issue, that helped you sort this problem out as well!