BadCash

Q: MacBook Air didn't go to sleep?

Yesterday I replaced the battery on my MacBook Air 13" mid 2012 with one a replacement from a reputable battery reseller, and performed a "calibration". Today I charged it up to 100% and used it during the day, up until 3.30 pm. At that time the battery level was at 38%. I simply left the computer on and turned off the external screen, as I always do, and presumed it would go to sleep, as it always does.

 

I came back 3 hours later, and the battery was at 0% and OSx had actually shut down and booted when I connected the charger.

 

What could have happened?

 

It usually turns off the screen and sleeps when I just leave it, it's set to sleep after 10 minutes in the Energy Saver settings. It was not connected to any WiFi after I left it (I'm sure of it since I'm using my phone as a WiFi hotspot, and I took my phone with me).

 

The replacement battery seems good, it displays a "maximum charge" of 7346mAh in CoconutBattery, which is more than the advertised 7200mAh. I'm getting roughly 5 hours of WiFi usage on it (the old original battery would give me 2-2.5 hours tops, and it was down to 3800mAh).

 

Here's the power log from just before I left the computer at 3.30pm, until now:

 

2016-07-28 15:11:54 +0200 Assertions              Kernel Idle sleep preventers: -None-         

2016-07-28 15:26:45 +0200 Assertions              Kernel Idle sleep preventers: IODisplayWrangler         

2016-07-28 15:26:45 +0200 Notification            Display is turned on                                                                    

2016-07-28 15:26:45 +0200 Assertions              PID 109(hidd) Created UserIsActive "com.apple.iohideventsystem.queue.tickle" 00:00:00  id:0x0x9000004ef [System: PrevIdle DeclUser kDisp]         

2016-07-28 15:27:15 +0200 Notification            Display is turned off                                                                   

2016-07-28 15:27:15 +0200 Assertions              PID 205(coreaudiod) Summary PreventUserIdleSystemSleep "com.apple.audio.AppleHDAEngineOutput:1B,0,1,1:0.context.preventuseridlesleep" 02:58:13  id:0x0x1000003da [System: PrevIdle DeclUser kDisp]         

2016-07-28 15:27:15 +0200 Assertions              PID 109(hidd) Summary UserIsActive "com.apple.iohideventsystem.queue.tickle" 00:00:30  id:0x0x9000004ef [System: PrevIdle DeclUser kDisp]         

2016-07-28 15:27:15 +0200 Assertions              Kernel Idle sleep preventers: -None-         

2016-07-28 15:31:45 +0200 Assertions              PID 109(hidd) TimedOut UserIsActive "com.apple.iohideventsystem.queue.tickle" 00:04:59  id:0x0x9000004ef [System: PrevIdle DeclUser kDisp]         

2016-07-28 18:09:31 +0200 Assertions              PID 205(coreaudiod) TurnedOff PreventUserIdleSystemSleep "com.apple.audio.AppleHDAEngineOutput:1B,0,1,1:0.context.preventuseridlesleep" 05:40:28  id:0x0x1000003da [System: No Assertions]         

Sleep/Wakes since boot:1   Dark Wake Count in this sleep cycle:0

 

Time stamp                Domain                  Message                                                                        Duration      Delay    

==========                ======                  =======                                                                        ========      =====    

UUID: C77537CF-E2AA-45E3-A114-C94E5EC6B8BF

2016-07-28 18:09:32 +0200 Sleep                   Entering Sleep state due to 'Low Power Sleep': Using Batt (Charge:0%)          

2016-07-28 18:09:34 +0200 PM Client Acks          Delays to Sleep notifications: [com.apple.apsd is slow(2278 ms)]          

2016-07-28 18:34:33 +0200 Assertions              PID 109(hidd) Created UserIsActive "com.apple.iohideventsystem.queue.tickle" 00:00:00  id:0x0x90000014b [System: DeclUser kDisp]         

 

2016-07-28 18:36:04 +0200 :Showing all currently held IOKit power assertions

Assertion status system-wide:

   BackgroundTask                 0

   ApplePushServiceTask           0

   UserIsActive                   1

   PreventUserIdleDisplaySleep    0

   PreventSystemSleep             0

   ExternalMedia                  0

   PreventUserIdleSystemSleep     1

   NetworkClientActive            0

Listed by owning process:

   pid 602(softwareupdate_notify_agent): [0x00000069000b01c8] 00:00:18 BackgroundTask named: "com.apple.softwareupdate.NotifyAgentAssertion"

   pid 415(UserEventAgent): [0x000000430001019f] 00:00:56 PreventUserIdleSystemSleep named: "CDSystemMonitor: delay notifications on switch to AC power"

    Timeout will fire in 9 secs Action=TimeoutActionRelease

   pid 47(UserEventAgent): [0x000000430001019e] 00:00:56 PreventUserIdleSystemSleep named: "CDSystemMonitor: delay notifications on switch to AC power"

    Timeout will fire in 9 secs Action=TimeoutActionRelease

   pid 47(UserEventAgent): [0x0000002b000b0156] 00:01:20 BackgroundTask named: "com.apple.periodic-weekly"

    Created for PID: 394.

   pid 47(UserEventAgent): [0x0000002b000b0154] 00:01:20 BackgroundTask named: "com.apple.SoftwareUpdate.Activity"

    Created for PID: 241.

   pid 47(UserEventAgent): [0x00000021000b0148] 00:01:30 BackgroundTask named: "com.apple.mds.2"

    Created for PID: 68.

   pid 47(UserEventAgent): [0x0000001d000b0140] 13792:35:19 BackgroundTask named: "com.apple.metadata.mds.power"

    Created for PID: 68.

   pid 47(UserEventAgent): [0x00000017000b0139] 13792:35:25 BackgroundTask named: "com.apple.metadata.mds_stores.power"

    Created for PID: 225.

   pid 109(hidd): [0x000000210009014b] 00:01:30 UserIsActive named: "com.apple.iohideventsystem.queue.tickle"

    Timeout will fire in 575 secs Action=TimeoutActionRelease

No kernel assertions.

Idle sleep preventers: IODisplayWrangler

MacBook Air (13-inch Mid 2012), OS X El Capitan (10.11.5)

Posted on Jul 28, 2016 9:56 AM

Close

Q: MacBook Air didn't go to sleep?

  • All replies
  • Helpful answers

  • by John Galt,Apple recommended

    John Galt John Galt Jul 28, 2016 8:33 PM in response to BadCash
    Level 8 (49,039 points)
    Mac OS X
    Jul 28, 2016 8:33 PM in response to BadCash
  • by BadCash,

    BadCash BadCash Jul 29, 2016 1:43 AM in response to John Galt
    Level 1 (4 points)
    Notebooks
    Jul 29, 2016 1:43 AM in response to John Galt

    I'm suspecting it might be an app called GoodSync that was keeping the computer awake, I've noticed it's been taking quite a while for it to analyze and sync files lately. But shouldn't I be able to tell from some log files what is preventing idle sleep? From the log I posted above I can't really tell anything, except perhaps that it's got something to do with audio (?)... but I'm sure there were no applications playing audio at the time.

  • by John Galt,

    John Galt John Galt Jul 29, 2016 6:09 AM in response to BadCash
    Level 8 (49,039 points)
    Mac OS X
    Jul 29, 2016 6:09 AM in response to BadCash

    You might be able to identify the process or processes preventing sleep with the following Bash script. To do that open Terminal - it's in your Mac's Utilities folder.


    Copy the following line, which is a single line of text with no line breaks (triple-click to select the entire line). Wait until you believe the Mac should be sleeping, and then paste it in the Terminal window:


    clear; printf '\e[3J'; P='pmset' Q=(Thermal Load Events Assertions Preemptions) R=(therm sysload 2 assertions 4) S='\n####'  T=$(pmset -g | grep -o "sleep prevented.*[^)]") ; printf $S\ ${Q[2]}'\n' ; egrep -i 'eep\ cau|ake\ rea' /private/var/log/system.log | tail -n 12 ; printf $S\ ${Q[3]}'\n' ; $P -g ${R[3]} | tail -n +14 | grep id | awk '{print $1, $2, $NF}' ; printf $S\ ${Q[4]}'\n' ; if [ -z "$T" ]; then echo None; else echo $T; fi 2>&1 


    Then, copy (select all) and paste that Terminal window's contents in a reply. If any information appears that you consider personal, edit or obscure that information before clicking the Reply button.


    Quit Terminal when you're finished with it.