Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cannot sleep to ram without magsafe connected

When I close the lid on my MacBook pro with the magsafe adapter connected, it sleeps to RAM as expected, with quick wake-up when opening the lid. The strange thing is that once the magsafe is not connected and I close the lid, sleep to RAM fails, and it resorts to sleep to disk. This is annoying, because the wake-up time is much longer.


I've made a short video of the behaviour: http://youtu.be/AwnPsA3BA8U


Here's a dump of the system log just before and just after sleeping cycles with and without the MagSafe plugged in. It appears as if the sleep initiation is interrupted when the magsafe is not plugged in. As you can see from the log without the magsafe plugged in, the sleep seems to occur at 10:52:42, before all the steps of sleep initialization are done...


## Hibernate with magsafe plugged in (successful to RAM)

Jan  8 10:52:13 user.local WindowServer[75]: Created shield window 0x10 for display 0x04272ec0
Jan  8 10:52:13 user.local WindowServer[75]: device_generate_desktop_screenshot: authw 0x0(0), shield 0x0(0)
Jan  8 10:52:13 user.local WindowServer[75]: device_generate_lock_screen_screenshot: authw 0x0(0), shield 0x0(0)
Jan  8 10:52:14 user kernel[0]: hibernate image path: /var/vm/sleepimage
Jan  8 10:52:14 user kernel[0]: sizeof(IOHibernateImageHeader) == 512
Jan  8 10:52:14 user kernel[0]: AirPort_Brcm43xx::powerChange: System Sleep 
Jan  8 10:52:14 user kernel[0]: kern_open_file_for_direct_io(0) took 0 ms
Jan  8 10:52:14 user kernel[0]: Opened file /var/vm/sleepimage, size 8589934592, partition base 0x0, maxio 400000 ssd 0
Jan  8 10:52:14 user kernel[0]: hibernate image major 1, minor 0, blocksize 512, pollers 5
Jan  8 10:52:14 user kernel[0]: hibernate_alloc_pages flags 00000000, gobbling 0 pages
Jan  8 10:52:14 user kernel[0]: hibernate_setup(0) took 0 ms
Jan  8 10:52:14 user kernel[0]: AirParrot device perform power state change 1 -> 0
Jan  8 10:52:14 user kernel[0]: hibernate_page_list_setall start 0xffffff80e0840000, 0xffffff80e0880000
Jan  8 10:52:20 user kernel[0]: hibernate_page_list_setall time: 423 ms
Jan  8 10:52:20 user kernel[0]: pages 298789, wire 177162, act 63460, inact 386, cleaned 0 spec 16, zf 725, throt 0, could discard act 14512 inact 3008 purgeable 524 spec 38996 cleaned 0
Jan  8 10:52:20 user kernel[0]: hibernate_page_list_setall found pageCount 241749
Jan  8 10:52:20 user kernel[0]: IOHibernatePollerOpen, ml_get_interrupts_enabled 0
Jan  8 10:52:20 user kernel[0]: IOHibernatePollerOpen(0)
Jan  8 10:52:20 user kernel[0]: encryptStart 132a0
Jan  8 10:52:20 user kernel[0]: writing 239762 pages
Jan  8 10:52:20 user kernel[0]: encryptEnd 663e800
Jan  8 10:52:20 user kernel[0]: image1Size 0xa9e1e00, encryptStart1 0x132a0, End1 0x663e800
Jan  8 10:52:20 user kernel[0]: encryptStart a9e1e00
Jan  8 10:52:20 user kernel[0]: encryptEnd 10ac0600
Jan  8 10:52:20 user kernel[0]: PMStats: Hibernate write took 5172 ms
Jan  8 10:52:20 user kernel[0]: all time: 5172 ms, comp bytes: 982372352 time: 665 ms 1407 Mb/s, crypt bytes: 208706912 time: 281 ms 706 Mb/s, 
Jan  8 10:52:20 user kernel[0]: image 279709184, uncompressed 982372352 (239837), compressed 270716576 (27%), sum1 4fd703f2, sum2 dda94bd7
Jan  8 10:52:20 user kernel[0]: wired_pages_encrypted 109417, wired_pages_clear 65833, dirty_pages_encrypted 64587
Jan  8 10:52:20 user kernel[0]: hibernate_write_image done(0)
Jan  8 10:52:20 user kernel[0]: sleep
Jan  8 10:52:31 user.local WindowServer[75]: handle_will_sleep_auth_and_shield_windows: no lock state data
Jan  8 10:52:31 user kernel[0]: Wake reason: EC LID0
Jan  8 10:52:31 user kernel[0]: AirPort_Brcm43xx::powerChange: System Wake - Full Wake/ Dark Wake / Maintenance wake
Jan  8 10:52:31 user kernel[0]: HID tickle 17 ms
Jan  8 10:52:31 user kernel[0]: AirParrot device perform power state change 0 -> 1
Jan  8 10:52:31 user kernel[0]: Previous Sleep Cause: 5


Hibernate without magsafe (unsuccesful, bailed to disk)

Jan  8 10:52:42 user.local WindowServer[75]: Created shield window 0x11 for display 0x04272ec0
Jan  8 10:52:42 user.local WindowServer[75]: device_generate_desktop_screenshot: authw 0x0(0), shield 0x0(0)
Jan  8 10:52:42 user.local WindowServer[75]: device_generate_lock_screen_screenshot: authw 0x0(0), shield 0x0(0)
Jan  8 10:52:42 user kernel[0]: hibernate image path: /var/vm/sleepimage
Jan  8 10:52:42 user kernel[0]: sizeof(IOHibernateImageHeader) == 512
Jan  8 10:52:42 user kernel[0]: AirPort_Brcm43xx::powerChange: System Sleep 
Jan  8 10:52:42 user kernel[0]: kern_open_file_for_direct_io(0) took 0 ms
Jan  8 10:52:42 user kernel[0]: Opened file /var/vm/sleepimage, size 8589934592, partition base 0x0, maxio 400000 ssd 0
Jan  8 10:52:42 user kernel[0]: hibernate image major 1, minor 0, blocksize 512, pollers 5
Jan  8 10:52:42 user kernel[0]: hibernate_alloc_pages flags 00000000, gobbling 0 pages
Jan  8 10:52:42 user kernel[0]: hibernate_setup(0) took 0 ms
Jan  8 10:52:42 user kernel[0]: AirParrot device perform power state change 1 -> 0
Jan  8 10:52:42 user kernel[0]: en1: BSSID changed to 10:9a:dd:82:a4:4c
Jan  8 10:52:42 user kernel[0]: wlEvent: en1 en1 Link DOWN virtIf = 0
Jan  8 10:52:42 user kernel[0]: AirPort: Link Down on en1. Reason 8 (Disassociated because station leaving).
Jan  8 10:52:42 user kernel[0]: en1::IO80211Interface::postMessage bssid changed
Jan  8 10:53:17 user kernel[0]: hibernate_page_list_setall start 0xffffff80e0840000, 0xffffff80e0880000
Jan  8 10:53:17 user kernel[0]: hibernate_page_list_setall time: 423 ms
Jan  8 10:53:17 user kernel[0]: pages 301589, wire 177297, act 64349, inact 386, cleaned 0 spec 16, zf 727, throt 0, could discard act 14798 inact 3326 purgeable 524 spec 40166 cleaned 0
Jan  8 10:53:17 user kernel[0]: hibernate_page_list_setall found pageCount 242775
Jan  8 10:53:17 user kernel[0]: IOHibernatePollerOpen, ml_get_interrupts_enabled 0
Jan  8 10:53:17 user kernel[0]: IOHibernatePollerOpen(0)
Jan  8 10:53:17 user kernel[0]: encryptStart 132a0
Jan  8 10:53:17 user kernel[0]: writing 240788 pages
Jan  8 10:53:17 user kernel[0]: hibernate_machine_init: state 2, image pages 177105, sum was ee94ab79, image1Size aa33e00, conflictCount 84, nextFree 62
Jan  8 10:53:17 user kernel[0]: hibernate_page_list_discard time: 29 ms, discarded act 14798 inact 3326 purgeable 524 spec 40166 cleaned 0
Jan  8 10:53:17 user kernel[0]: IOHibernatePollerOpen(), ml_get_interrupts_enabled 0
Jan  8 10:53:17 user kernel[0]: IOHibernatePollerOpen(0)
Jan  8 10:53:17 user kernel[0]: hibernate_machine_init reading
Jan  8 10:53:17 user kernel[0]: PMStats: Hibernate read took 1934 ms
Jan  8 10:53:17 user kernel[0]: hibernate_machine_init pagesDone 242583 sum2 59a3512e, time: 1934 ms, comp bytes: 260583424 time: 230 ms 1077 Mb/s, crypt bytes: 103904768 time: 53 ms 1845 Mb/s
Jan  8 10:53:17 user kernel[0]: Wake reason: ? (User)
Jan  8 10:53:17 user kernel[0]: AirPort_Brcm43xx::powerChange: System Wake - Full Wake/ Dark Wake / Maintenance wake
Jan  8 10:53:17 user kernel[0]: AirParrot device perform power state change 0 -> 1
Jan  8 10:53:17 user kernel[0]: Previous Sleep Cause: 5
Jan  8 10:53:17 user kernel[0]: Previous Shutdown Cause: 5




Any comments or ideas as to what may cause this behaviour are most welcome!

MacBook Pro, OS X Mountain Lion (10.8.2), Mid 2010 model

Posted on Jan 8, 2013 2:46 AM

Reply
Question marked as Best reply

Posted on Jan 8, 2013 3:08 AM

This should help. You can use the variables in Terminal to set Sleep mode to what you want, but careful...

2 replies

Jan 8, 2013 3:29 AM in response to LousyFool

I had already looked into pmset, but what I had failed to understand was that the output display by pmset depends on whether the magsafe is plugged in or not. So even though the hibernate mode appeared to be correct (mode 3) when running pmset -g having the magsafe plugged in, this was not the case when i ran the command with the magsafe unplugged.


This is the output of pmset -g with magsafe plugged in:


Active Profiles:

Battery Power -1

AC Power -1*

Currently in use:

womp 1

halfdim 1

sms 1

hibernatefile /var/vm/sleepimage

gpuswitch 2

networkoversleep 0

disksleep 10

sleep 0

hibernatemode 3

ttyskeepawake 1

displaysleep 10

acwake 0

lidwake 1


This is the output with magsafe unplugged:


Active Profiles:

Battery Power -1*

AC Power -1

Currently in use:

halfdim 1

sms 1

hibernatefile /var/vm/sleepimage

gpuswitch 2

disksleep 10

sleep 60

hibernatemode 25

ttyskeepawake 1

displaysleep 5

acwake 0

lidwake 1


All I had to to was to change hibernate mode to 3 when the magsafe was unplugged!


Thanks!

Cannot sleep to ram without magsafe connected

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.