Contribute
Register

Battery Manager with Fix for Boot without Batteries

Status
Not open for further replies.
Hello! My battery in E330 works in last ML with one patch or kext (forgot). I will look at this!

(OFF!) Can you pls tell, how you could activate HD 4000 in our Intel Core i5-3210M?

Off topic. Please open a different thread. These messages will be deleted.
 
New version of the battery manager kext is released. Version 1.40.

See post #1 for details.
 
Hi RehabMan,
I just installed ML10.8.4 on an oldish Acer 4830T (i5-2410m).
I installed your battery manager 1.40 (debug) and the stock AppleSmartBM.
Battery is not charging and I was hoping this new battery manager would help to find out what's wrong.
AC adapter plugged in and the menu bar shows:

Screen Shot 2013-09-20 at 10.57.59.png

System Info Power shows:

Screen Shot 2013-09-20 at 11.13.10.png
Console debug output for Battery shows:

Code:
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBattery::pollingTimeOut called
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x1
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatterySTA called
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF called
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF: evaluateObject error 0xe00002bc
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatteryBST called
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatteryBST: evaluateObject error 0xe00002bc
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBattery::pollingTimeOut called
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x1
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatterySTA called
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF called
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF: evaluateObject error 0xe00002bc
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatteryBST called
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatteryBST: evaluateObject error 0xe00002bc

My DSDT does not match your HP dsdt and was wondering if you can take a look to see it can be modded ?
 

Attachments

  • 4830tg-dsdt.aml.zip
    19.4 KB · Views: 77
Hi RehabMan,
I just installed ML10.8.4 on an oldish Acer 4830T (i5-2410m).
I installed your battery manager 1.40 (debug) and the stock AppleSmartBM.
Battery is not charging and I was hoping this new battery manager would help to find out what's wrong.
AC adapter plugged in and the menu bar shows:

View attachment 67770

System Info Power shows:

View attachment 67772
Console debug output for Battery shows:

Code:
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBattery::pollingTimeOut called
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x1
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatterySTA called
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF called
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF: evaluateObject error 0xe00002bc
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatteryBST called
20/09/2013 10:49:45.000 kernel[0]: AppleSmartBatteryManager::getBatteryBST: evaluateObject error 0xe00002bc
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBattery::pollingTimeOut called
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x1
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatterySTA called
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF called
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF: evaluateObject error 0xe00002bc
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatteryBST called
20/09/2013 10:50:15.000 kernel[0]: AppleSmartBatteryManager::getBatteryBST: evaluateObject error 0xe00002bc

My DSDT does not match your HP dsdt and was wondering if you can take a look to see it can be modded ?

Your DSDT needs to be patched for battery. Looks like it is the same as an Acer 5750g that I did. See: http://www.tonymacx86.com/mountain-...50g-mountain-lion-unibeast-39.html#post662207
 
Your DSDT needs to be patched for battery. Looks like it is the same as an Acer 5750g that I did. See: http://www.tonymacx86.com/mountain-...50g-mountain-lion-unibeast-39.html#post662207

Thx for the quick reply.
After several hours of running your version 1.40, I did notice that the menu bar status had changed.
It now showed that the battery charge was 0% and that the Power Source was Power Adapter.
Interesting.

Any way, I used MaciASL to apply the patch you pointed out for Acer 5750g to my DSDT - no compile errors and quite clean.
Rebooted using the new DSDT.
Now there's a lot more battery debug output in the Console - constant and non-stop.
Here's a snap shot:

Code:
20/09/2013 16:21:04.000 kernel[0]: AppleSmartBattery::constructAppleSerialNumber called
20/09/2013 16:21:04.000 kernel[0]: AppleSmartBattery::rebuildLegacyIOBatteryInfo called
20/09/2013 16:21:05.000 kernel[0]: AppleSmartBattery::pollingTimeOut called
20/09/2013 16:21:05.000 kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x1
20/09/2013 16:21:05.000 kernel[0]: AppleSmartBatteryManager::getBatterySTA called
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF called
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: acpibat_bif size = 13
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fPowerUnit       = 0x1
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignCapacity  = 0x1770
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fMaxCapacity     = 0x1770
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fBatteryTech     = 0x1
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignVoltage   = 0x2b5c
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fCapacityWarning = 0x12c
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fLowWarning      = 0xb4
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fDeviceName      = 'Li_Ion_4000mA '
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fSerialNumber    = '0000'
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fType            = 'Lion'
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBIF: fManufacturer    = 'SANYO '
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBatteryManager::getBatteryBST called
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: acpibat_bst size = 4
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: fPowerUnit       = 0x1
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: currentStatus    = 0x0
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate     = 0x0
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 0x0
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentVoltage  = 0x137b
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: adjusted fCurrentRate = 0xbb8
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: fAverageRate = 0xbb8
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery: Battery is charged.

Menu Bar:

Screen Shot 2013-09-20 at 16.21.20.png

System Info shows:

Screen Shot 2013-09-20 at 16.38.39.png

So, now the menu bar says that the battery is not charging (and charge at 0%), but the Console output (and the system Info) says that the battery is fully charged.

That is, some contradictory info.
Any idea what could be wrong ?

My patched DSDT attached.
 

Attachments

  • bat-4830tg-dsdt.dsl.zip
    35.8 KB · Views: 77
Thx for the quick reply.
After several hours of running your version 1.40, I did notice that the menu bar status had changed.
It now showed that the battery charge was 0% and that the Power Source was Power Adapter.
Interesting.

Any way, I used MaciASL to apply the patch you pointed out for Acer 5750g to my DSDT - no compile errors and quite clean.
Rebooted using the new DSDT.
Now there's a lot more battery debug output in the Console - constant and non-stop.
Here's a snap shot:

It is not normally non-stop. Usually every 30 sec. Let's see what kexts are loaded:
Code:
kextstat | grep -y battery

And it might be good to look at bdmesg output:
Code:
bdmesg >~/Desktop/bdmesg.txt

Look at your desktop, compress bdmesg.txt and post bdmesg.txt.zip that results.

Also current battery status might be good:
Code:
ioreg -n AppleSmartBattery -r AppleSmartBattery

I would guess that this is why it is showing 0% (fCurrentCapacity = 0):

Code:
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBatteryManager::getBatteryBST called
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: acpibat_bst size = 4
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: fPowerUnit       = 0x1
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: currentStatus    = 0x0
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate     = 0x0
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 0x0
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentVoltage  = 0x137b
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: adjusted fCurrentRate = 0xbb8
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery::setBatteryBST: fAverageRate = 0xbb8
20/09/2013 16:21:06.000 kernel[0]: AppleSmartBattery: Battery is charged.

I'll take a look at your DSDT shortly...
 
It is not normally non-stop. Usually every 30 sec. Let's see what kexts are loaded:
Code:
kextstat | grep -y battery

That shows:
Code:
bash-3.2$ kextstat | grep -y battery
   31    0 0xffffff7f81d40000 0x6000     0x6000     org.rehabman.driver.AppleSmartBatteryManager (1.40) <9 4 3>
bash-3.2$

And it might be good to look at bdmesg output:
Code:
bdmesg >~/Desktop/bdmesg.txt
Look at your desktop, compress bdmesg.txt and post bdmesg.txt.zip that results.
The bdmesg output attached at the end of this post.

Also current battery status might be good:
Code:
ioreg -n AppleSmartBattery -r AppleSmartBattery

Here's that output:
Code:
bash-3.2$ ioreg -n AppleSmartBattery -r AppleSmartBattery
+-o AppleSmartBattery  <class org_rehabman_AppleSmartBattery, id 0x1000001d4, registered, matched, active, busy 0 (0 ms),$
    {
      "PostChargeWaitSeconds" = 120
      "TimeRemaining" = 65535
      "InstantTimeToEmpty" = 65535
      "ExternalChargeCapable" = Yes
      "CellVoltage" = (1246,1246,1246,1249)
      "PermanentFailureStatus" = 0
      "BatteryInvalidWakeSeconds" = 30
      "Voltage" = 4987
      "MaxCapacity" = 6000
      "Quick Poll" = Yes
      "AtWarnLevel" = Yes
      "Manufacturer" = "SANYO "
      "CurrentCapacity" = 0
      "LegacyBatteryInfo" = {"Amperage"=0,"Flags"=5,"Capacity"=6000,"Current"=0,"Voltage"=4987,"Cycle Count"=0}
      "FirmwareSerialNumber" = 0
      "BatteryInstalled" = Yes
      "CycleCount" = 0
      "DesignCapacity" = 6000
      "AvgTimeToFull" = 65535
      "ManufactureDate" = 0
      "AtCriticalLevel" = Yes
      "BatteryType" = "Lion"
      "InstantTimeToFull" = 65535
      "BatterySerialNumber" = "Li_Ion_4000mA -0000"
      "PostDischargeWaitSeconds" = 120
      "Serial" = "0000"
      "Temperature" = 0
      "InstantAmperage" = 0
      "MaxErr" = 0
      "FullyCharged" = Yes
      "DeviceName" = "Li_Ion_4000mA "
      "IOGeneralInterest" = "IOCommand is not serializable"
      "Amperage" = 0
      "IsCharging" = No
      "ExternalConnected" = Yes
      "AvgTimeToEmpty" = 65535
    }

bash-3.2$

I'll take a look at your DSDT shortly...
Many thanks. Appreaciate your help.
 

Attachments

  • bdmesg.txt.zip
    3 KB · Views: 70
I wonder if the ECON system memory is not being initialized. Try disabling the ECON test in _BIF/_BST.

Where you see:

Code:
                        If (ECON)
                        {

In _BIF and _BST methods, change to:
Code:
                        If (LOr(1, ECON))
                        {

Try that... that way the code in _BIF / _BST will execute no matter if ECON is non-zero or not.
 
Made those changes to _BIF/_BST but it had no impact.

What's strange is that the Voltage reported is 4987 mV and the Current is 0 mA.
These are not changing.
Seems battery is dead ?
 
Made those changes to _BIF/_BST but it had no impact.

What's strange is that the Voltage reported is 4987 mV and the Current is 0 mA.
These are not changing.
Seems battery is dead ?

Here is a new patch to try, maybe your EC needs time in between each read (or 8-bit piecemeal reads may just not work):

Code:
# Acer Aspire 5750g -GoobyPls
# also works for Acer 4830T

# created by RehabMan 9/13/2013

into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n
end;

into definitionblock code_regex External\s+\(\\TNOT\) remove_matched;

# fan EC (not really necessary but might be handy for fan access)
into device label EC0 code_regex ENIB,\s+16 replace_matched begin ENI0,8,ENI1,8 end;

# battery EC
into device label EC0 code_regex BRC0,\s+16 replace_matched begin RC00,8,RC01,8 end;
into device label EC0 code_regex BSN0,\s+16 replace_matched begin SN00,8,SN01,8 end;
into device label EC0 code_regex BPV0,\s+16 replace_matched begin PV00,8,PV01,8 end;
into device label EC0 code_regex BDV0,\s+16 replace_matched begin DV00,8,DV01,8 end;
into device label EC0 code_regex BDC0,\s+16 replace_matched begin DC00,8,DC01,8 end;
into device label EC0 code_regex BFC0,\s+16 replace_matched begin FC00,8,FC01,8 end;
into device label EC0 code_regex BAC0,\s+16 replace_matched begin AC00,8,AC01,8 end;
into device label EC0 code_regex BPC0,\s+16 replace_matched begin PC00,8,PC01,8 end;
into device label EC0 code_regex BCG0,\s+16 replace_matched begin CG00,8,CG01,8 end;
into device label EC0 code_regex BSSB,\s+16 replace_matched begin SSB0,8,SSB1,8 end;
into device label EC0 code_regex BCV1,\s+16 replace_matched begin CV10,8,CV11,8 end;
into device label EC0 code_regex BCV2,\s+16 replace_matched begin CV20,8,CV21,8 end;
into device label EC0 code_regex BCV3,\s+16 replace_matched begin CV30,8,CV31,8 end;
into device label EC0 code_regex BCV4,\s+16 replace_matched begin CV40,8,CV41,8 end;
into device label EC0 code_regex BMD0,\s+16 replace_matched begin MD00,8,MD01,8 end;
into device label EC0 code_regex BACV,\s+16 replace_matched begin ACV0,8,ACV1,8 end;

# fan 16-bit
into method label FANG code_regex Store\s+\(Arg0,\s+ENIB\) replace_matched 
begin
Store(ShiftLeft(Arg0, 8), ENI1) Store(Arg0, ENI0)
end;

into method label FANW code_regex Store\s+\(Arg0,\s+ENIB\) replace_matched
begin
Store(ShiftLeft(Arg0, 8), ENI1) Store(Arg0, ENI0)
end;

# _BIF 16-bit
into method label _BIF code_regex \(\^\^EC0\.BSN0, replaceall_matched begin (B1B2(^^EC0.SN00,^^EC0.SN01), end;
into method label _BIF code_regex Store\s+\(\^\^EC0\.BDC0, replaceall_matched 
begin 
Store(^^EC0.DC00, Local7)\n
Sleep(0x32)\n
Store(B1B2(Local7,^^EC0.DC01), 
end;

into method label _BIF code_regex Store\s+\(\^\^EC0\.BFC0, replaceall_matched 
begin 
Store(^^EC0.FC00, Local7)\n
Sleep(0x32)\n
Store(B1B2(Local7,^^EC0.FC01), 
end;

into method label _BIF code_regex Store\s+\(\^\^EC0\.BDV0, replaceall_matched 
begin 
Store(^^EC0.DV00, Local7)\n
Sleep(0x32)\n
Store(B1B2(Local7,^^EC0.DV01), 
end;

# _BST 16-bit

into method label _BST code_regex Store\s+\(\^\^EC0\.BPV0, replaceall_matched 
begin 
Store(^^EC0.PV00, Local7)\n
Sleep(0x32)\n
Store(B1B2(Local7,^^EC0.PV01), 
end;

into method label _BST code_regex Store\s+\(\^\^EC0\.BFC0, replaceall_matched 
begin 
Store(^^EC0.FC00, Local7)\n
Sleep(0x32)\n
Store(B1B2(Local7,^^EC0.FC01), 
end;

into method label _BST code_regex Store\s+\(\^\^EC0\.BAC0, replaceall_matched 
begin 
Store(^^EC0.AC00, Local7)\n
Sleep(0x32)\n
Store(B1B2(Local7,^^EC0.AC01), 
end;
 
Status
Not open for further replies.
Back
Top