Skip to content

Instantly share code, notes, and snippets.

@bradland
Created September 11, 2012 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradland/3699744 to your computer and use it in GitHub Desktop.
Save bradland/3699744 to your computer and use it in GitHub Desktop.
MacBook Air sleep study

Testing results

Equipment details

Computer (from About This Mac)

MacBook Air
11-inch, Mid 2011

Core i5
4 GB of RAM
Graphics Intel HD Graphics 3000
Mac OS X Lion 10.7.4 (11E53)

Perhipherals

Apple (external) Trackpad model A1339

Samsung LED LCD TV (connected VGA [yeah, yeah, I know])

Testing methodology

I rolled a strip of paper in to a thin cylinder, then taped that in to the end of a loop of paper. This thin cylinder is placed in the grooves between the keys with the laptop closed. The paper can be pulled to actuate the keys with the laptop closed, simulating the key presses proposed by the author.

I tested the following matrix of conditions:

Plugged in, no display, no mouse

Plugged in, no display, with mouse

Plugged in, with display, with mouse

Battery only, no display, no mouse

Battery only, no display, with mouse

Battery only, with display, with mouse

In cases where there was no display, I tested by closing the laptop to cause it to sleep, then pulling the paper until it stopped at the edge of the keyboard recess. With a display connected, the laptop sleeps, then immediately turns back on, so I had to put the computer to sleep from the Apple menu. In all cases, I let the laptop sleep for a full minute before actuating the keys, then gave the computer 30 seconds to wake up before opening the laptop to verify whether it slept. Normal return from sleep after 1 minute takes less than 5 seconds (based on console log entries).

I verified whether the computer was actually sleeping by observing the Apple logo (it illuminates when the display turns on), and by checking Console.app ("All Messages" log) for events indicating return from sleep state. The absence of all events is inferred to indicate that the computer remained in sleep state.

After seeing no results activating the center keys, I tried three additional methods of activating the laptop:

  • Activating the power key specifically

  • "Clicking" the external trackpad

  • Creating "activity" on the external trackpad (moving my finger around)

Conclusion

It is not possible to wake my MacBook Air (as configured) by actuating the keyboard or even the power key specifically.

It is possible that there is another reason for the activation, but it would have to be either Mountain Lion specific, or unrelated to the keyboard. For example, clicking an external mouse will activate the laptop, but only while plugged in to an external power source.

Detailed results

Results actuating center keys

Plugged in, no display, no mouse - NO WAKE on keyboard activation

Plugged in, no display, with mouse - NO WAKE on keyboard activation

Plugged in, with display, with mouse - NO WAKE on keyboard activation

Battery only, no display, no mouse - NO WAKE on keyboard activation

Battery only, no display, with mouse - NO WAKE on keyboard activation

Battery only, with display, with mouse - NO WAKE on keyboard activation

Results activating the power key specifically

Plugged in, no display, no mouse - NO WAKE on keyboard activation

Plugged in, no display, with mouse - NO WAKE on keyboard activation

Plugged in, with display, with mouse - NO WAKE on keyboard activation

Battery only, no display, no mouse - NO WAKE on keyboard activation

Battery only, no display, with mouse - NO WAKE on keyboard activation

Battery only, with display, with mouse - NO WAKE on keyboard activation

Results generating "activty" on the trackpad

Plugged in, no display, no mouse - Test not possible

Plugged in, no display, with mouse - NO WAKE on trackpad activity

Plugged in, with display, with mouse - NO WAKE on trackpad activity

Battery only, no display, no mouse - Test not possible

Battery only, no display, with mouse - NO WAKE on trackpad activity

Battery only, with display, with mouse - NO WAKE on trackpad activity

Results "clicking" the trackpad

Plugged in, no display, no mouse - Test not possible

Plugged in, no display, with mouse - WAKE (temporary; see notes 1) on trackpad click

Plugged in, with display, with mouse - WAKE (stays on) on trackpad click

Battery only, no display, no mouse - Test not possible

Battery only, no display, with mouse - NO WAKE on trackpad click

Battery only, with display, with mouse - NO WAKE on trackpad click

Notes 1: temporary wake with no display

When plugged in with no display but with mouse, I observed activity in Console.app. The entries appear to show that the laptop wakes, then sleeps. An example.

Laptop closed at 11:39; console events observed

9/11/12 11:39:02.416 AM powerd: PMScheduleWakeEventChooseBest: m=0.00 s=0.00 a=0.00
9/11/12 11:39:02.000 AM kernel: /drv/ MacModule.cpp:304   powerStateWillChangeTo: flags=4 stateNumber=2
9/11/12 11:39:02.000 AM kernel: /drv/ MacModule.cpp:309   powerStateWillChangeTo: found flag=kIOPMSleepCapability (4)
9/11/12 11:39:04.000 AM kernel: AppleThunderboltNHI::enablePower - turn power on, status = 0x0, result_value = 0x0
9/11/12 11:39:05.000 AM kernel: LE is supported - Disable LE meta event
9/11/12 11:39:05.000 AM kernel: /drv/ MacModule.cpp:304   powerStateDidChangeTo: flags=4 stateNumber=2
9/11/12 11:39:05.000 AM kernel: /drv/ MacModule.cpp:309   powerStateDidChangeTo: found flag=kIOPMSleepCapability (4)

Note that I'll use "powerStateDidChangeTo: flags=4 stateNumber=2" as an indicator that the computer is going to sleep.

Trackpad "clicked" at 11:40; console events observed (the following list filtered to show relevent events)

9/11/12 11:40:08.302 AM hidd: MultitouchHID: device bootloaded
9/11/12 11:40:08.302 AM hidd: setting surface orientation to 0 returned 0xE00002CA
9/11/12 11:40:08.303 AM hidd: setting surface orientation mode to 0 returned 0xE00002CA
9/11/12 11:40:08.427 AM hidd: MultitouchHID: device bootloaded
9/11/12 11:40:08.000 AM kernel: Wake reason: EHC2
9/11/12 11:40:08.000 AM kernel: /drv/ MacModule.cpp:304   powerStateWillChangeTo: flags=82 stateNumber=3
9/11/12 11:40:08.000 AM kernel: /drv/ MacModule.cpp:305   powerStateWillChangeTo: found flag=kIOPMPowerOn (2)
9/11/12 11:40:08.000 AM kernel: /drv/ MacModule.cpp:310   powerStateWillChangeTo: found flag=kIOPMRestartCapability (80)
9/11/12 11:40:08.000 AM kernel: /drv/ MacModule.cpp:304   powerStateDidChangeTo: flags=82 stateNumber=3
9/11/12 11:40:08.000 AM kernel: /drv/ MacModule.cpp:305   powerStateDidChangeTo: found flag=kIOPMPowerOn (2)
9/11/12 11:40:08.000 AM kernel: /drv/ MacModule.cpp:310   powerStateDidChangeTo: found flag=kIOPMRestartCapability (80)
9/11/12 11:40:08.000 AM kernel: Previous Sleep Cause: 5
9/11/12 11:40:08.000 AM kernel: The USB device HubDevice (Port 1 of Hub at 0xfa000000) may have caused a wake by issuing a remote wakeup (2)
9/11/12 11:40:08.000 AM kernel: wlEvent: en0 en0 Link DOWN virtIf = 0
9/11/12 11:40:08.000 AM kernel: AirPort: Link Down on en0. Reason 8 (Disassociated because station leaving).
(AirPort events omitted)
9/11/12 11:40:08.000 AM kernel: The USB device BRCM20702 Hub (Port 1 of Hub at 0xfa100000) may have caused a wake by issuing a remote wakeup (3)
9/11/12 11:40:08.000 AM kernel: The USB device Bluetooth USB Host Controller (Port 3 of Hub at 0xfa110000) may have caused a wake by issuing a remote wakeup (3)
9/11/12 11:40:08.000 AM kernel: [BNBTrackpadDevice][setReportWL][c8-bc-c8-fb-6d-cf] Could not send DATA command via interrupt channel
9/11/12 11:40:08.000 AM kernel: [ffffff800d8ac800][BNBTrackpadDevice::_simpleSetReport][70.12] ERROR: setReport returned error 0xe00002ca for reportID 0xF1
(lots of ERROR reports omitted)
9/11/12 11:40:08.000 AM kernel: HID tickle 319 ms
9/11/12 11:40:08.000 AM kernel: AppleUSBMultitouchDriver::checkStatus - received Status Packet, Payload 2: device was reinitialized
(AirPort events omitted)
9/11/12 11:40:17.090 AM powerd: PMScheduleWakeEventChooseBest: m=0.00 s=0.00 a=0.00
9/11/12 11:40:17.000 AM kernel: /drv/ MacModule.cpp:304   powerStateWillChangeTo: flags=4 stateNumber=2
9/11/12 11:40:17.000 AM kernel: /drv/ MacModule.cpp:309   powerStateWillChangeTo: found flag=kIOPMSleepCapability (4)
9/11/12 11:40:17.000 AM kernel: LE is supported - Disable LE meta event
9/11/12 11:40:18.000 AM kernel: /drv/ MacModule.cpp:304   powerStateDidChangeTo: flags=4 stateNumber=2
9/11/12 11:40:18.000 AM kernel: /drv/ MacModule.cpp:309   powerStateDidChangeTo: found flag=kIOPMSleepCapability (4)

This series of logs shows us that the laptop returned to a powered state at 11:40:08 when I clicked the external trackpad, then went back to sleep at 11:40:18.

Laptop opened at 11:42:53; console events observed

9/11/12 11:42:53.000 AM kernel: SMC::smcHandleInterruptEvent WARNING status=0x0 (0x40 not set) notif=0x0
9/11/12 11:42:53.000 AM kernel: Wake reason: EC.LidOpen (User)
9/11/12 11:42:53.000 AM kernel: /drv/ MacModule.cpp:304   powerStateWillChangeTo: flags=82 stateNumber=3
9/11/12 11:42:53.000 AM kernel: /drv/ MacModule.cpp:305   powerStateWillChangeTo: found flag=kIOPMPowerOn (2)
9/11/12 11:42:53.000 AM kernel: /drv/ MacModule.cpp:310   powerStateWillChangeTo: found flag=kIOPMRestartCapability (80)
9/11/12 11:42:53.000 AM kernel: /drv/ MacModule.cpp:304   powerStateDidChangeTo: flags=82 stateNumber=3
9/11/12 11:42:53.000 AM kernel: /drv/ MacModule.cpp:305   powerStateDidChangeTo: found flag=kIOPMPowerOn (2)
9/11/12 11:42:53.000 AM kernel: /drv/ MacModule.cpp:310   powerStateDidChangeTo: found flag=kIOPMRestartCapability (80)
9/11/12 11:42:53.000 AM kernel: SMC::smcHandleInterruptEvent WARNING status=0x0 (0x40 not set) notif=0x0
9/11/12 11:42:53.000 AM kernel: Previous Sleep Cause: 5
9/11/12 11:42:53.429 AM hidd: MultitouchHID: device bootloaded

We can see the state return to 3, indicating that the laptop is "awake" again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment