I bought a new mid-2012 non-Retina MacBook Pro late last year, immediately prior to the line being discontinued (I still think the second-generation MacBook Pros were the best series). After about a week, I found an annoying thing with it: When I turned on the computer after coming back from work, it seemed like it almost always required a cold startup after sleeping, where the optical drive initialized and did its buzz, and took a lengthy 10-15 seconds to wake up from sleep. Also, the computer would wake up (and the optical drive buzzed) even if the MagSafe charger was disconnected.
I contemplated bringing it into the Apple store, as this behaviour was not exhibited in my mid-2009 model and the optical drive buzzing was plain annoying; I thought there was something wrong with my Mac specifically.
However, from a bit of searching it turned out that this was a “feature” of the Mac since OS X Mountain Lion for 2012 Macs and newer:
OS X Mountain Lion v10.8.2 supplemental update 2.0 introduced a feature that lets your Mac enter safe sleep after four hours of being connected to AC power. This complies with European Energy Standards (ErP Lot6) and happens when there’s no network activity and no activity from connected devices like external hard drives.
This meant that after being in “light sleep” mode for four hours while connected to AC power, the computer would essentially turn off, and it would need to reload the hibernated state into memory prior to resuming. I do leave my computer connected to the AC power often (some say it’s not good for the battery, but that can be a separate discussion), so it was pretty clear that this was causing the symptoms above.
Fortunately there was an easy way to rectify this: The
pmset command provides various controls to manipulate power management settings on the Mac. Following this StackExchange post, I ran the following commands in the Terminal app:
First, check (and save) the existing settings.
pmset -g System-wide power settings: Currently in use: standbydelay 14400 ... autopoweroffdelay 14400 ...
By default the
autopoweroffdelay is likely set to four hours (14400 seconds). I changed this to a one-day delay (86400 seconds) by running:
pmset -a autopoweroffdelay 86400 pmset -a standbydelay 86400
Since I usually use the computer on a daily basis, it would be reasonable to keep the computer ready to go within that time frame.
And the problem was solved! No more annoying optical drive starting up from Safe Sleep/hibernation every day, or when disconnecting the AC power.