Mac Won’t Sleep? Here’s How to Find Out Why And Fix It

Jul 11, 2012 - 15 Comments

Find why a Mac won't go to sleep

On the rare occasion that you go to put a Mac to sleep and, well, it won’t sleep, there’s an easy to way to find out what the holdup is. Though this is a somewhat technical approach, it should give a good starting point to anyone who’s confused as to why something like automatic sleep isn’t taking effect, and hopefully provide a quick resolution to the problem.

Determining the Cause of Sleep Prevention in Mac OS X with the Command Line

This works to determine both why a Mac won’t sleep and why a Mac display is not sleeping:

  • Launch Terminal from /Applications/Utilities/ and type the following command:
  • pmset -g assertions

  • Look through the reported assertion list for items with a “1” next to their name to find what’s keeping the Mac awake

For example, if you see something like the following:

$ pmset -g assertions
7/11/12 10:45:33 PM PDT
Assertion status system-wide:
PreventUserIdleDisplaySleep 0
CPUBoundAssertion 0
DisableInflow 0
ChargeInhibit 0
PreventSystemSleep 0
PreventUserIdleSystemSleep 1
NoIdleSleepAssertion 1
ExternalMedia 0
DisableLowPowerBatteryWarnings 0
EnableIdleSleep 1
NoRealPowerSources_debug 0
UserIsActive 0
ApplePushServiceTask 0

Listed by owning process:
pid 1827: [0x000000bb012c01f1] PreventUserIdleSystemSleep named: "com.apple.audio.'AppleHDAEngineOutput:1B,0,1,1:0'.noidlesleep"

You’ll notice the “sleep when idle” feature is disabled, but what you really want to pay attention to is the lower portion of the list where the “Listed by owning process” report shows com.apple.audio as the reason that PreventUserIdleSystemSleep is enabled. Why is that? Because iTunes is running and playing music, meaning the computer isn’t idle.

If you’re having persistent problems with sleep and the above tip doesn’t give you any clue as to where to begin, sleep issues relating to hardware and power management quirks can often be fixed with an SMC reset. On the other side of the fence, another command line tip shows us how to find out why a Mac woke up from sleep. Sometimes the same thing preventing a Mac from sleeping is responsible from waking it up too, like Time Machine and schedule backups.

This is a handy tip from Lifehacker who also provides a similar tip for Windows computers. Don’t miss Apple’s article on the topic too for some additional help.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: William Pearson in Mac OS X, Tips & Tricks, Troubleshooting

15 Comments

» Comments RSS Feed

  1. Dave says:

    I’ve found a little over a year ago that the voice commands / speech recognition prevents my iMac and macbook from going to sleep if it’s used even once. I opened a ticket with Mac who acknowledged the problem but wouldn’t commit to a fix. I have to recycle speakable items.

    Plus speech recognition has a huge memory leak, about 750m / day.

    This is a pretty interesting find.

  2. Bruno Pascoal says:

    I was having issues with my Macbook Pro not sleeping at all (not with the lid closed nor by selecting “Sleep” in the Apple menu) and resetting the SMC didn’t help. The above tip didn’t show me what was cauing it.

    After some internet searching I learned that pending printing jobs are commonly the cause. Especially when you have added online printers (in my case it was a wireless HP printer AND a Xerox network printer). If you go to your printer list you’ll eventually find one that is “in use” even if it was the shared wireless printer in the hotel lobby on your last vacation. Simply delete any pending jobs or erase the printer altogether.

    Worked for me!

    • John says:

      Thanks Bruno, I was getting the same problem and checked my printer, its low on ink and had some printing pending. Cancelled it now the sleep function works as it should.
      Cheers,
      John.

    • Steve says:

      Thanks, Bruno.

      That’s exactly the info I needed!

      It works now.

    • Maverick says:

      Thanks Bruno, so simple and finally sorted the problem.

    • Milo says:

      Thanks, this great tip also solved my problem.
      I have two printers connected and the oldest one i don’t use anymore. That printer had one job in queue and kept like you said my mac from going into sleep mode.
      problem solved.
      Thanks

    • Alfdrummer says:

      Bruno, you rock my good sir. I simply deleted a pending printing job and my computer went to sleep like a baby.

      Thanks a million

    • Mathias says:

      Thanks Bruno, this worked for me as well!

      Not going to sleep neither automatically nor the forced sleep made me crazy – I even updated to Sierra ;-)
      Kept me busy way too long to find the reason!
      Checked all printers and there it was: an old printing job for a switched off printer (waiting to replace one ink tank -therefore not in use). Deleted that job and used the forced sleep and the Mac mini actually went to sleep right away.

      I had this problem so many times on different Macs in the past and never found out what actually resolved the problem.

      I hope I do remember it for the next time!

      Cheers from Germany,
      Mat

    • Denis de Castro says:

      Just another thank-you to Bruno Pascoal. After much searching, thanks!

  3. Somian says:

    Ok, now I know that ExternalMedia is preventing sleep but how can I fix it? Shouldn’t it be possible to put a mac to sleep a mac with a HDD connected?

  4. Max says:

    Hi!
    This one is the hero of the day, thanx a lot!
    internet sharing was my problem. Disabled it from preferences and voilá no problems to sleep. I think it was related to i share my printer by wifi, but at least now i know what to do.
    Happy new year and thanx a lot for this article!
    /Max

  5. jfsjfs says:

    New iMac 2012 would not stay asleep. Found out it was the HP USB keyboard keeping it awake. Switched keyboard and the problem went away. Hope this helps someone.

    jfsjfs

  6. Raj says:

    i discovered it was my internet connection sharing that was preventing sleep mode.

  7. Francis says:

    Thanks! You solve my problem.

  8. Jan D says:

    After trying everything i could find on the web, i figured out that it was a page in the (HP) printer queue that was keeping my Mac from sleeping for days. Turned on the printer, forced the page to print and my Mac is now FINALLY going back to sleep.

    There was no indication of this in the Activity Monitor nor the “pmset -g assertions” command that pointed to anything printer related. Hope this helps someone !

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Recent Posts