• On The Insider: Sorry Fellas, Megan Fox is Married!
advertisement
January 30, 2007 3:00 AM PST

Tutorial: Preventing Portable Mac sleep problems

by CNET staff

Sleep can be temperamental for portable Macs (iBooks, PowerBooks, MacBooks, MacBook Pros) with systems sometimes exhibiting one or more of these symptoms:

Does not properly go to sleep when the lid is closed, remaining on and often resulting in an extremely hot-to-the-touch state with excessive fan activity and eventual shutdown.

  • Wakes from sleep inexplicably while the lid is closed, resulting in similar problems as the aforementioned
  • Fails to properly wake from sleep, often with a completely black screen and no responsiveness
  • This problem affects both Intel-based and PowerPC-based Mac portables. In many cases, it can be caused by interaction from peripheral devices: USB, FireWire, Bluetooth, Displays, even power connection. In other cases, power management, NVRAM or software issues are at fault.

What follows is a listing of the most commonly successful workarounds for these issues, along with indications for which problems they are most likely to resolve:

Unplug/plug first [Useful for: does not properly go to sleep; wakes from sleep while lid is closed; fails to wake from sleep]

Perhaps the most common causes for all sleep problems are problematic external USB or FireWire devices. Simply disconnecting all such devices before putting a system to sleep can often prevent the problems from occurring. Try disconnecting the devices in batches to identify a culprit(s).

A few examples of external devices that have caused sleep issues in the past:

Also, avoid connecting or disconnecting devices, or connecting/disconnecting power after your portable Mac has gone to sleep. USB devices in particular can trigger a wake from sleep.

Turn off, toggle settings of Bluetooth devices [Useful for: does not properly go to sleep; wakes from sleep while lid is closed]

It may be beneficial to un-pair and power-off any Bluetooth devices associated with Mac portable before putting it to sleep. It appears that turning Bluetooth devices on or off while the system is going to sleep can trigger a disconnection error message, barring proper sleep.

Further, you may need to turn off the "Allow Bluetooth devices to wake this computer." option in both of its System Preferences locations. First, go to the Bluetooth pane of System Preferences and turn this option off. Next go to the Keyboard and Mouse pane of System Preferences and turn the option off again.

Check for errant internal devices (expansion cards, hard drives, RAM) [Useful for: does not properly go to sleep; wakes from sleep while lid is closed; fails to wake from sleep]

Some PCI cards, hard drives, or other internal devices can prevent proper sleep. Make sure that all internal peripherals are using the latest firmware available from the manufacturer, or remove the devices in a trial-and-error process to identify the culprit. FireWire 800 PCI cards have been notorious in this regard, often preventing deep sleep. PCI-based ATA cards, PCMCIA and CardBus cards have also been frequently implicated.

If you suspect a faulty hard drive, experiment with a separate startup disk. If the sleep issues do not occur with the new drive, consider replacing your current startup disk.

Faulty RAM may also be the culprit of your sleep issues, especially if other strange issues are occurring. You can sometimes determine if you have a "bad" RAM module by using the Apple Hardware Diagnostic CD, included with all currently shipping Macintosh models. To use the Apple Hardware Test CD, restart your computer while holding down the C key on PowerPC-based Macs, or D key on intel-based Macs until the "Loading..." icon appears.

You may also want to try removing each RAM module one-by-one and checking for persistence of the problem(s).

Turn off AirPort, disconnect from networks before sleep [Useful for: does not properly go to sleep]

Disabling Network activity before sleep [Useful for: does not properly go to sleep; wakes from sleep while lid is closed; fails to wake from sleep]

Related to the above workaround, germinating all network activity -- in some cases necessitating a power-down of the AirPort card or disconnection of an Ethernet cable -- is, in some cases, particularly effective at eliminating the "blank screen on wake-up" issue.

In particular, try turning off any built-in AirPort hardware (via the AirPort menu item or using Internet Connect, located in Applications/Utilities) before putting a portable Mac to sleep.

Manually putting the system to sleep [Useful for: does not properly go to sleep]

Putting the system to sleep via the Apple menu or by pressing the power button and selecting the sleep option (rather than closing a portable Mac's lid) can work to avoid some sleep issues. Make sure that the system has properly gone to sleep -- indicated by the gently pulsating status light -- before closing the lid.

Turn off all Wake/Other options in Energy Saver [Useful for: does not properly go to sleep; wakes from sleep while lid is closed; fails to wake from sleep]

Turning off all special automatic sleep options has resolved sleep problems for some users. This can be accomplished by entering the Energy Saver pane of System Preferences, clicking on the "Show Details" button, then the "Options" tab, then un-checking all options, including:

  • Wake when the modem detects a ring
  • Wake for Ethernet Network administrator access
  • Restart automatically after a power failure

In some cases you may need to also turn off the "Put the hard disk(s) to sleep when possible" option, which is located under the "Sleep" tab in the Energy Saver pane of System Preferences.

Quit specific applications [Useful for: does not properly go to sleep]

Some applications, when active at sleep time, can cause machines to either not fall asleep or wake up soon after going to sleep. Though it's inconvenient, try quitting all third-party (and potentially some Apple) applications before putting your portable Mac to sleep and check for persistence of the issue.

As noted in Apple Knowledge Base article #303698, self-refreshing Web pages in Safari, songs playing in iTunes, or a movie disc playing in DVD Player can all prevent sleep. "Applications can be designed to keep the system awake and prevent idle sleep indefinitely. In developer lingo, an application may explicitly prevent system sleep by calling IORegisterForSystemPower(), and calling IOCancelPowerChange() when it receives a power management kIOMessageCanSystemSleep notification."

Set lidwake variable to 0 [Useful for: does not properly go to sleep; wakes from sleep while lid is closed]

Setting thelidwake variable to 0 will cause the machine to resist waking from sleep when the lid is opened. Instead, you will need to press a button on the keyboard or perform another "system event" (such as connecting and activating a USB device) in order to wake the system.

This can prevent instances of the problem where the system erroneously thinks the lid has been opened when it is still closed.

This can be accomplished with the following Terminal command:

  • sudo pmset lidwake 0

Deleting power management-related .plist files [Useful for: does not properly go to sleep; wakes from sleep while lid is closed; fails to wake from sleep]

In some instances, various sleep issues can be resolved by deleting the following files:

  • /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist
  • /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
  • ~/Library/Preferences/com.apple.systemuiserver.plist

then restarting.

(the tilde [~] indicates your home user directory, i.e. /Users/username)

Unfortunately, this fix might not stick, and may require repetition if the problem(s) recurs.

Gently close lid -- ensure sleep is taking place [Useful for: does not properly go to sleep]

In some cases, carefully closing the lid and ensuring the system has actually gone to sleep (indicated by a slowly pulsating light) can prevent this issue from occurring.

Turn off safe sleep [Useful for: does not properly go to sleep; fails to wake from sleep]

"Safe Sleep" is a function writes the contents of RAM to a hard disk buffer. The buffer is then accessed and restored to RAM, creating an effect similar to merely putting the system to sleep though it has actually been turned off (no power being used).

Mac OS X uses virtual memory data (RAM contents naturally stored on disk as part of the virtual memory scheme) to formulate the sleepimage file. When the system is put to sleep, Mac OS X culls from physical RAM whatever data it cannot replicate from virtual memory and adds it to the sleepimage file. As such, if the system is put to sleep abruptly or something goes wrong during the write process, sleep can fail to properly occur.

If you think safe sleep might be to blame for your regular sleep issues, you can disable it by opening the Terminal (located in Applications/Utilities) and entering the following command:

  • sudo pmset -a hibernatemode 0

then pressing return. 

You can then select "Go to Folder" under the "Go" menu in the Finder, and enter: /private/var/vm then press return, and drag the file sleepimage to the Trash.. 

In order to re-enable Safe Sleep, use the command:

  • sudo pmset -a hibernatemode 3

in the Terminal.

Reset NVRAM [Useful for: does not properly go to sleep; wakes from sleep while lid is closed; fails to wake from sleep]

A number of users report that resetting NVRAM resolves wake-from-sleep issues. In order to perform this process, shut down your Mac, then start it back up while immediately holding the following keys: Command, Option, P and R. Hold the keys down until the computer restarts and you hear the startup sound for the third time.

Clear caches [Useful for: does not properly go to sleep; wakes from sleep while lid is closed; fails to wake from sleep]

Though it's a cliché workaround, you may also want to doing a deep clean of system caches with a tool like Cocktail or Tiger Cache Cleaner.

The problems that can be caused by corrupt caches are almost innumerable, and sleep issues are no exception.

Re-install Mac OS X [Useful for: does not properly go to sleep; fails to wake from sleep]

As a last resort, try re-installing Mac OS X via an Archive and Install process, then updating to their previously installed Mac OS X incremental release (or the release before they started having wake-from-sleep problems) has resolved this issue.

Like what you've found in this tutorial? Get more troubleshooting guidance (updated daily) by subscribing to MacFixIt Pro.

Resources

  • DYMO label printers can pr...
  • Sleep failure linked to Wa...
  • Oxford 911 FireWire sleep ...
  • #303698
  • Cocktail
  • Tiger Cache Cleaner
  • re-installing Mac OS X
  • subscribing to MacFixIt Pr...
  • More from Tutorials
  • Recent posts from MacFixIt
    The OS X 10.7 buzz starts--something big in the next release?
    MacFixIt Answers
    Safari still crashing after update?
    Safari 5.0.1 update fixes black Mail backgrounds, autofill, and more
    Making the switch to Apple? Get the perfect setup
    Apple releases OS X 10.6.4 update for iMacs; trackpad driver
    CNET Apple Byte: iPhone to T-Mobile?
    iTunes not connecting to the iTunes store after updating
    Add a Comment (Log in or register) (11 Comments)
    • prev
    • next
    by anthonyrc January 30, 2007 6:00 PM PST
    So Today again my PB 1.67ghz G4 had sleep issues.

    I could see how this is a real problem for some folk. Myself, I have it set to accept a P-word to wake from sleep, so mine eventually makes it back that direction.

    What triggered it for me was that when I shut the lid, I had a printer plugged in. I unplugged it, then moved it back to my regular station and plugged in the AC adaptor. This set it to wake up.

    Something about disconnecting USB stuff while its closed. needs to be looked into by apple.
    Reply to this comment
    by Rick Auricchio January 30, 2007 6:00 PM PST
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by anthonyrc</i></div></class><br />
    I believe the USB issue is that the bus is reset by plugging/unplugging. I don't know whether Apple can prevent waking in that situation. Doing so may make it impossible to ever wake the computer with keyboard and/or mouse!
    Reply to this comment
    by Rick Auricchio January 31, 2007 9:23 AM PST
    Has anyone suggested disabling "Allow Bluetooth Devices to Wake This Computer" in the Bluetooth preference pane?

    I'll bet there are plenty of bluetooth phones out there that could wake a computer in a bag.
    Reply to this comment
    by baddawg65 January 31, 2007 11:57 AM PST
    I have a MacBookPro CoreDuo 2.15GHz here at work that was having some sleep problems and I found that a Symantec application called "DiskMountNotify" was using CPU at &gt;90% even though there was no new disk mounted and was preventing sleep. I used Symantec Uninstall and then reinstalled Symantec AntiVirus 10 again and the sleep problem went away. This was done in mid-December 2006 and according to the user has no problems sleeping now.
    It could be that certain applications prevent sleep so you need to look at the Activity Monitor or from terminal command line "ps aux" to find the possible application preventing sleep.
    Reply to this comment
    by HyppeliHiiriKostaa January 31, 2007 11:57 AM PST
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by baddawg65</i></div></class><br />
    Thanks for the tip, I have similar problem with my MacBook Pro and Symantec.

    I try this!
    Reply to this comment
    by MacHound January 31, 2007 12:38 PM PST
    My 17" Powerbook G4 had a sleep problem during OS 10.3.3 to 10.3.5 (or thereabouts), which Apple fixed around 10.3.6 after lots of PowerBook owners complained. Unfortunately the same issue cropped up again at 10.4.8.

    The problem is a trivial one but it's annoying: my Powerbook wakes from sleep with the slightest mouse jiggle. Previously it took an intentional mouse movement to wake my PB. Now it awakens every time one of our children runs down the hallway or if an adult walks quietly across the room. My PB wakes up needlessly several times each day.

    I don't know how to set the wake-on-mouse-movement sensitivity lower but I am sure it's a simple PList file or NVRAM setting. I searched MacOSXHints.com and other help pages without success. Any ideas???
    Reply to this comment
    by MacHound January 31, 2007 12:38 PM PST
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by MacHound</i></div></class><br />
    P.S., I have a generic Rosewill USB mouse connected to an IO Gear USB microhub. Plugging the mouse directly into my PowerBook with nothing else attached yields the same results.
    Reply to this comment
    by scotty321 April 26, 2008 9:46 AM PDT
    Tried all the steps in this article, to no avail. I finally fixed my sleep problems by taking two steps:

    1) Getting a beta release of the next bug fix update of Now Up-To-Date, directly from the Now Software engineers. Now Up-To-Date 5.3.2 causes sleep problems on Leopard. This has been confirmed to me by the Now Software engineers.

    But even after this, my computer still wouldn't sleep.

    2) So then, I reset my MacBook Pro's SMC by following these directions:
    <a href="http://docs.info.apple.com/article.html?artnum=303319">http://docs.info.apple.com/article.html?artnum=303319</a>
    That fixed it for me.

    So don't forget to reset your SMC (or PMU on older Macs) if you're having sleep problems!
    Reply to this comment
    by coloma April 26, 2008 9:46 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by scotty321</i></div></class><br />
    Scotty, you are an absolute angel!!! My MacBook Pro has been refusing to wake up from sleep for 4 days now. I tried everything I could find: reset NVRAM, ran disk utilities, ran Applejack, disabled Safe Sleep, removed battery &amp; ran on AC, removed power and ran on battery, unplugged disk drives, monitor and mouse, reinstalled OS 10.5. I was just getting ready to pack up the MacBook and take it to the repair shop when I saw your note. I reset the SMC and VOILA!! IT WORKS!! Thank you!
    Reply to this comment
    by Stiandotcom April 26, 2008 9:46 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by scotty321</i></div></class><br />
    Check if you have a empty card reader in your PC/express slot. I forgot that I had one in and as soon as it was out everything returned to normal. Hope this helps someone. Cheers, stian in NYC -MBP 2.2 15" running Tiger 10.4.11
    Reply to this comment
    by mfi916 January 6, 2009 10:13 AM PST
    I was able to work around sleep issues on my MacBook running 10.5 by changing the way I put the computer to sleep. I have fast user switching enabled and always switch to the login window and sleep from there. I haven't had any sleep problems since then.

    Previously, I would sometimes (maybe once a week) get a black screen with a pinwheel when attempting to wake the computer rather than the appropriate password prompt. The people at the Genius Bar gave me a bunch of voodoo rain dance incantations to try, none of which worked. They also suggested that File Vault could be the problem, but I sincerely doubt this given that when I experienced the problem I could still SSH into my machine and see that my home directory was fully operational. It has since occurred to me that Expose might be the true problem since I have some hot corners enabled for Expose and noticed at other times that when waking my computer the windows would sometimes be pushed off screen to reveal the desktop.

    Hopefully my workaround will help somebody else. Maybe Apple will even read this and look into Expose as the culprit.
    Reply to this comment
    (11 Comments)
    • prev
    • next
    advertisement

    About MacFixIt

    MacFixIt is CNET's troubleshooting resource for all things Mac. The information here helps you navigate the ins-and-outs of Mac ownership with how-tos, troubleshooting information, news, reviews, and more.

    Add this feed to your online news reader