Contribute
Register

[Guide] How to patch DSDT for working battery status

1- I've disabled the option to DropSSDT under Clover config and icon change from AC-BAT or BAT-AC fine (using the DSDT with CFGD). You're right about the problem of dropping and CFGD.

2- If I invoike Apple->Sleep or closed my LID ... Sleeps works fine)

Diegos-MacBook-Pro:~ diego$ pmset -g assertions
2015-07-13 18:07:51 -0300
Assertion status system-wide:
BackgroundTask 0
ApplePushServiceTask 0
UserIsActive 0
PreventUserIdleDisplaySleep 0
PreventSystemSleep 0
ExternalMedia 0
PreventUserIdleSystemSleep 0
NetworkClientActive 0
Kernel Assertions: 0x4=USB
id=502 level=255 0x4=USB mod=13/07/15 18:11 description=USB5 owner=AppleUSBUHCI

This USB device is the receiver of my wireless mouse.


Thanks!!

Set sleep time to something short, like 2-3 mins. Then test/watch. If Apple->Sleep works, so should sleep triggered automatically.
 
Set sleep time to something short, like 2-3 mins. Then test/watch. If Apple->Sleep works, so should sleep triggered automatically.

It's working now!

I think after I've disabled the option to DropSSDT under Clover solved this problem too!!


Thanks!!
 
It's working now!

I think after I've disabled the option to DropSSDT under Clover solved this problem too!!


Thanks!!


One more question:

If I left my laptop working with battery and the charge is less than 15% icon goes red. Then shows up a warning (attached image).

But if I continue using the laptop, the OS X doesn't goes sleep automaticaly. It shut down in a wrong way.

Do you think what is the problem? Sleep works good from menu, from power button and from time configured in control panel.


Note: In my System Information, Battery shows cycle = 0 (understand that it isn't recognized). I'm attaching a screen shot.
 

Attachments

  • Low_Bat.png
    Low_Bat.png
    143.2 KB · Views: 98
  • Sys_Info.png
    Sys_Info.png
    180.1 KB · Views: 99
One more question:

If I left my laptop working with battery and the charge is less than 15% icon goes red. Then shows up a warning (attached image).

But if I continue using the laptop, the OS X doesn't goes sleep automaticaly. It shut down in a wrong way.

Yes. When you get the warning, plug the laptop in or shut it down.

I've never investigated what a real Mac does (probably attempts hibernation, which we typically disable).

Note: In my System Information, Battery shows cycle = 0 (understand that it isn't recognized). I'm attaching a screen shot.

ACPIBatteryManager.kext estimates cycle count by formula ((DesignCapacity-MaxCapacity)/7).
 
Yes. When you get the warning, plug the laptop in or shut it down.

I've never investigated what a real Mac does (probably attempts hibernation, which we typically disable).



ACPIBatteryManager.kext estimates cycle count by formula ((DesignCapacity-MaxCapacity)/7).


I understand that in my case Cycles = 0 because your kext couldn't read DesignCapacity and MaxCapacity on my battery.

Is there any way to debug this?
 
I understand that in my case Cycles = 0 because your kext couldn't read DesignCapacity and MaxCapacity on my battery.

Is there any way to debug this?

You need a correctly patched DSDT. Read post #1.

You can use the system.log output from ACPIBatteryManager.kext to narrow the cause.
 
You need a correctly patched DSDT. Read post #1.

You can use the system.log output from ACPIBatteryManager.kext to narrow the cause.

I have my DSDT patched using your guide.

Here is the system.log

Jul 14 19:40:25 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::pollingTimeOut called
Jul 14 19:40:25 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::pollBatteryState: path = 2
Jul 14 19:40:25 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::pollBatteryState: path = 1
Jul 14 19:40:25 Diegos-MacBook-Pro kernel[0]: AppleSmartBatteryManager::getBatterySTA called
Jul 14 19:40:25 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f
Jul 14 19:40:25 Diegos-MacBook-Pro kernel[0]: AppleSmartBatteryManager::getBatteryBIF called
Jul 14 19:40:25 Diegos-MacBook-Pro kernel[0]: AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: acpibat_bif size = 13
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fPowerUnit = 0x0
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignCapacity = 47520
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fMaxCapacity = 47520
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fBatteryTech = 0x1
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignVoltage = 11100
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fCapacityWarning = 420
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fLowWarning = 156
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fDeviceName = 'PABAS024'
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fSerialNumber = '3658Q'
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fType = 'LION'
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fManufacturer = 'COMPAL '
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBatteryManager::getBatteryBST called
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBST: acpibat_bst size = 4
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBST: fPowerUnit = 0x0
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBST: currentStatus = 0x80
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate = 0
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 47520
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentVoltage = 0
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBST: Calculating for WATTS
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate = 0
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 4281
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBST: fAverageRate = 0
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery: Battery is charged.
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::constructAppleSerialNumber called
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::rebuildLegacyIOBatteryInfo called


I understand why Cycles = 0 (fDesignCapacity and fMaxCapacity have same value).

Do you know in what part of my DSDT could check to try to solve it?
 
I have my DSDT patched using your guide.

Here is the system.log

..

I understand why Cycles = 0 (fDesignCapacity and fMaxCapacity have same value).

Do you know in what part of my DSDT could check to try to solve it?

The log shows your DSDT working. There's nothing to 'solve'.
 
The log shows your DSDT working. There's nothing to 'solve'.

Yes, but these values are equal.

Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignCapacity = 47520
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fMaxCapacity = 47520


I understand that should be different to use in Cycle calculation.
 
Yes, but these values are equal.

Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignCapacity = 47520
Jul 14 19:40:26 Diegos-MacBook-Pro kernel[0]: AppleSmartBattery::setBatteryBIF: fMaxCapacity = 47520


I understand that should be different to use in Cycle calculation.

When they are equal, it means your battery is in near perfect health, maximum capacity as designed.

As you run cycles on it, MaxCapacity will fall, since the battery becomes degraded. If it falls enough, the cycle count estimation will be larger than zero.

At this point, your estimated cycle count is zero.

An estimate is called such as it is not an accurate reflection of the true value. If it weren't an "estimate," we'd call it a "measurement."

It is possible, sometimes, to reverse engineer DSDT to find where the cycle count is stored. We do this with the ProBook, for example.
 
Back
Top