Tackling sleep and wake problems

They may be getting less frequent, but users of some models of Mac still seem to be plagued by problems when their Mac tries to wake up from sleep, or more rarely tries to go to sleep in the first place. This article suggests some strategies to help you diagnose and fix these.

Before you go any further, make it quick and simple to put your Mac to sleep. You’ve currently probably set a timer in the Energy Saver pane. Open the Desktop & Screen Saver pane, select the Screen Saver tab, and click on the Hot Corners button. Set one of the corners to Put the Display to Sleep, and in Energy Saver ensure that the top checkbox, to prevent sleep, is unchecked. This still takes a little while for sleep to occur, and some problems aren’t always reproduced properly in this way, but it should make testing fixes quicker.

If you want to be really slick, make yourself an Automator workflow with the Put to Sleep action in it, and run that for testing.

The first fact you need to discover is whether the problem is a minor glitch, such as the Finder restarting, or a full kernel panic, which is more serious. Kernel panics may, if you’re lucky, display the distinctive multi-lingual screen we’ve all come to hate, but more often than not simply freeze the computer, or force it to shutdown or restart.

panic
A kernel panic. It is an interesting exercise to get your own screen shot of one.

Kernel panics need to be taken seriously: they occur when whatever has happened is so severe that the macOS kernel is too damaged to continue, and the only way out is to restart. Their commonest causes are equally serious: hardware failure, such as defective memory or a failing disk. If your Mac is suffering kernel panics, early on you should run its hardware diagnostics so that you can have reasonable confidence that it doesn’t need repair. For those hardware diagnostics, you should disconnect all non-essential peripherals, which can sometimes itself fix the problem, for example when a peripheral relies on a dodgy extension, or it crashes your Mac when trying to wake up.

No Mac should ever suffer repeated kernel panics.

The other hardware issue which is worth getting out of the way at this stage is the custom chip which controls sleep and wake behaviour, the SMC. Simply resetting that can make these problems vanish, when you’re lucky. This can be a tricky procedure in MacBook Pros with a T2 chip, and some users can’t seem to get it to work even when following the instructions. If you can’t, it’s best to contact Apple Support so they can talk you through the process.

Apple’s article on the SMC specifically recommends resetting it when:

  • Your Mac notebook doesn’t respond properly when you close or open the lid.
  • Your Mac sleeps or shuts down unexpectedly and you can’t turn it back on.

and for unrelated issues.

The other potential hardware problem which is probably best to eliminate early are storage problems. Restart in Recovery mode, or from a recovery drive if you have one, open Disk Utility, and there run First Aid on your boot volume. The only pain with doing that now is that it checks through any snapshots there, which is good, but can take quite a while to verify them, which is not so good.

You now know that your Mac is pretty healthy in hardware terms. But when did these problems start? Was it soon after installing a macOS or security update? If so, did that contain an EFI firmware update?

EFI firmware is another good route to kernel panics. Modern Macs are supposed to be ‘self healing’, but if these problems go back to any significant change in your Mac’s system software, you should revisit that next. The standard approach is to download and install the standalone update. For macOS updates, that is normally available in two forms: a smaller ‘delta’ which takes macOS just one step up, and a larger Combo, which covers all changes since the last major release.

Generally, it’s better if you can to go for the Combo version. Once that’s been installed, you’ll need to bring it up to date with all security updates since, easily accomplished using my free LockRattler. That’s also a good way to check that it has been updated to the current EFI firmware. If that hasn’t worked, book your Mac into a Genius Bar or contact Apple Support.

Taking stock, you’ve now eliminated hardware faults, firmware, and macOS as likely causes of these problems. If your Mac still doesn’t sleep or wake properly, it’s time to move on to the most difficult diagnostic problem: other software issues. It’s now most likely to be something you have installed or migrated, such as an incompatible kernel extension (KEXT) or daemon.

The first and simplest test, which is often forgotten, is simply quitting all open apps and then putting your Mac to sleep. The other extreme is to start up in Safe mode with Shift key held, which should disable all third-party extensions and quite a few of Apple’s too.

Most sleep and wake problems activate somewhere between those two extremes, which unfortunately covers a great deal of territory. One valuable aid here is to browse the unified log using a tool such as Consolation 3. You can then put your Mac to sleep, wake it up, and look at the log entries made just before and after those events, and cause codes. I have detailed descriptions of what you should see in this article.

Even when you have tackled this methodically, there are still some cases in which the problems persist, come hell or high water. If you’ve run out of ideas and this is still getting in your way, consider performing a clean install of macOS but not migrating all your old apps and other items for the moment.

The end of the line is that, no matter how hard you try, get your Mac to sleep or wake reliably. This seems to happen with certain models paired with some versions of macOS, and it’s important to report these to Apple Support so that they can be aware of the issue. You’ll then need to find a workaround which makes your Mac usable. I’ve had to do this with my last couple of iMacs and this iMac Pro, so you’ll be in good company.

The controls available in the Energy Saver pane vary according to model, and not all controls work as they should. Try disabling Power Nap, preventing your computer from sleeping but letting the display sleep (desktop) – good settings for a desktop model which you leave on all the time, for example.

Finer controls are available through the pmset command in Terminal, but their results can be even more inconsistent, as the hardware including the SMC seems to ignore some settings no matter what you do. You should also make a careful note of them, perhaps from the Power item in System Information, as the next time that you reset the SMC or even install a macOS update, you may need to put them back to this state.