Jump to content

AppleACPIBatteryManager/AppleSmartBatteryManager For Lion


Zprood
 Share

182 posts in this topic

Recommended Posts

I see. I missed that but it was in the early hours of the morning. Just off the top of your head would this be something I need to fix in the DSDT. i.e. change/set the design capacity?

If you believe the design capacity reading is wrong... Have you physically inspected the battery to see what the actual specs are?

Link to comment
Share on other sites

The official specs on the battery are 3260mAh. I'll crack open the laptop just to make sure though before I go any further.

Could be DSDT bug/problem then. BTW, are you using my fork? https://github.com/RehabMan/OS-X-ACPI-Battery-Driver

 

Make sure you remove other versions (this one has a different name and can co-exist with vanilla AppleSmartBatteryManager, such that it doesn't get overwritten with each update).

 

I would install the debug version, such that the output in system.log can be analysed.

Link to comment
Share on other sites

So I checked and the battery is indeed rated 3280mAh and I am using your fork. Using the debug version and got his in my system.log...

 

Oct 26 16:56:48 damnfool-macbook-pro.local com.apple.kextcache[83642]: WARNING - Invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext "/System/Library/Extensions/ACPIBatteryManager.kext"

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBatteryManager::init: Initializing

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBatteryManager::probe: Probing

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBatteryManager::start: called

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBatteryManager: Version 1.40 starting

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBatteryManager: Battery Supported Count(s) 1.

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery: Using ACPI regular battery information method _BIF

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBatteryManager::setPowerState: which = 0x1

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::clearBatteryState: do_update = false

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::rebuildLegacyIOBatteryInfo called

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x2

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x1

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBatteryManager::getBatterySTA called

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBatteryManager::getBatteryBIF called

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: acpibat_bif size = 13

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fPowerUnit       = 0x1

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignCapacity  = 0x19a0

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fMaxCapacity     = 0xd0c

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fBatteryTech     = 0x1

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignVoltage   = 0x2b5c

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fCapacityWarning = 0xe7

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fLowWarning      = 0xb5

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fDeviceName      = 'AP11D4F'

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fSerialNumber    = ' 1374'

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fType            = 'LiP'

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fManufacturer    = 'SONYCorp'

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBatteryManager::getBatteryBST called

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBST: acpibat_bst size = 4

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fPowerUnit       = 0x1

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBST: currentStatus    = 0x0

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate     = 0x0

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 0xd0c

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentVoltage  = 0x30dd

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBST: adjusted fCurrentRate = 0x686

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fAverageRate = 0x686

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery: Battery is charged.

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::constructAppleSerialNumber called

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::rebuildLegacyIOBatteryInfo called

Oct 26 21:03:31 damnfool-macbook-pro.local SystemUIServer[175]: Cannot find executable for CFBundle 0x7fd4c155dc70 </System/Library/CoreServices/Menu Extras/Battery.menu> (not loaded)

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::pollingTimeOut called

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x2

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x1

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBatteryManager::getBatterySTA called

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBatteryManager::getBatteryBIF called

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: acpibat_bif size = 13

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fPowerUnit       = 0x1

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignCapacity  = 0x19a0

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fMaxCapacity     = 0xd0c

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fBatteryTech     = 0x1

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignVoltage   = 0x2b5c

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fCapacityWarning = 0xe7

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fLowWarning      = 0xb5

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fDeviceName      = 'AP11D4F'

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fSerialNumber    = ' 1374'

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fType            = 'LiP'

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBIF: fManufacturer    = 'SONYCorp'

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBatteryManager::getBatteryBST called

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBST: acpibat_bst size = 4

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBST: fPowerUnit       = 0x1

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBST: currentStatus    = 0x0

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate     = 0x0

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 0xd0c

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentVoltage  = 0x30dd

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBST: adjusted fCurrentRate = 0x686

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery::setBatteryBST: fAverageRate = 0x686

Oct 26 21:03:42 damnfool-macbook-pro kernel[0]: AppleSmartBattery: Battery is charged.

 

 

etc...etc..
Link to comment
Share on other sites

...

So I checked and the battery is indeed rated 3280mAh and I am using your fork. Using the debug version and got his in my system.log...

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignCapacity  = 0x19a0

Oct 26 21:03:17 localhost kernel[0]: AppleSmartBattery::setBatteryBIF: fMaxCapacity     = 0xd0c

...

Looks to me that your DSDT is buggy. You can see it is returning 6560 for DesignCapacity, even though you know that is not the correct design capacity. If it were mine, I'd just change the DSDT code such that the value is hardcoded in the DSDT to the value that you have determined with physical inspection of the battery itself.

Link to comment
Share on other sites

Yeah, looks that way. At least I know now where to look to fix it. Thanks for point me in the right direction :) Sorry to ask for yet more help but is that a straight forward thing to do? Would you know by looking at my DSDT what I'd need to change? Just had a quick google and there seems to be some info out there talking about DSDTs and Design Capacity so hopefully I can find a fix given enough time but I am really struggling with getting my head around this.

Link to comment
Share on other sites

Yeah, looks that way. At least I know now where to look to fix it. Thanks for point me in the right direction :) Sorry to ask for yet more help but is that a straight forward thing to do? Would you know by looking at my DSDT what I'd need to change? Just had a quick google and there seems to be some info out there talking about DSDTs and Design Capacity so hopefully I can find a fix given enough time but I am really struggling with getting my head around this.

DesignCapacity is returned at index 1 in the package returned from _BIF (ACPI spec). Your _BIF method does some setup, then calls GBIF for the real work, passing the package to be modified and returned in Arg1. So, you're looking in GBIF for code which stores things to an index of 1 within the package referenced by Arg1. If you look at GBIF, you find code as such in this snippet:

                Store (BSCM, Local0)
                XOr (Local0, One, Index (Arg1, Zero))
                If (Local0)
                {
                    Multiply (SDC1, 0x0100, Local1)
                    Add (SDC0, Local1, Local1)
                    Multiply (Local1, 0x0A, Local1)
                }
                Else
                {
                    Multiply (SDC1, 0x0100, Local1)
                    Add (SDC0, Local1, Local1)
                }

                Store (Local1, Index (Arg1, One))  //HERE!
The last line in the snippet above is where the value for DesignCapacity is stored in the package.

 

So, you can change it to what you know is the actual value:

                Store (3260, Index (Arg1, One))
That should do it...
Link to comment
Share on other sites

Added RehabMan battery 1.40 kext and added B1B2 method to my DSDT.

But I can't find any variable define at 16 bit on _STA , _BIF method.

please help me edit my DSDT.

Thank you!

I have already written a patch for your laptop DSDT. What is the specific model of this laptop.

Link to comment
Share on other sites

Hi, RehabMan, i am using your last battery version 1.40 and it works good in my HP. I don't know if i need to modify my dsdt with B1B2 method in my case. This is my dsdt, can you take a look?

I would use also original acpiplatform from 10.9 but i don't know how set all 8 bit registers in dsdt for this. Can you help me?

 

Thank you

http://d-h.st/PGt

Link to comment
Share on other sites

Hi, RehabMan, i am using your last battery version 1.40 and it works good in my HP. I don't know if i need to modify my dsdt with B1B2 method in my case. This is my dsdt, can you take a look? Thank you

 

http://d-h.st/PGt

If you wanted to use the stock AppleACPIPlatform.kext in Lion/ML/Mavs, then yes, you would need to patch it. If you're using a rollback to SL version of AppleACPIPlatform then not so much.

  • Like 1
Link to comment
Share on other sites

If you wanted to use the stock AppleACPIPlatform.kext in Lion/ML/Mavs, then yes, you would need to patch it. If you're using a rollback to SL version of AppleACPIPlatform then not so much.

Thanks, I would use also original acpiplatform from 10.9 but i don't know how set all 8 bit registers in dsdt for this. Can you help me?

Link to comment
Share on other sites

Hi RehabMan,

 

The patch battery_ASUS-N55SL.txt and battery 1.40 work great on my Zenbook UX31A. You can update it to works list.

 

Thanks,

Thanks. I will add it to the list.

Link to comment
Share on other sites

Hi, RehabMan, i am using your last battery version 1.40 and it works good in my HP. I don't know if i need to modify my dsdt with B1B2 method in my case. This is my dsdt, can you take a look?

I would use also original acpiplatform from 10.9 but i don't know how set all 8 bit registers in dsdt for this. Can you help me?

 

Thank you

 

http://d-h.st/PGt

What computer is this DSDT from?

  • Like 1
Link to comment
Share on other sites

Thank you for the patch. But I got a lot of error when apply this patch. I have fix all error to make it work. Unfortunately, the current status of percent battery not automatic update and wrong calculate time left.

 

ScreenShot2013-10-31at41005PM_zps71d17b3

Thank you for the patch. But I got a lot of error when apply this patch. I have fix all error to make it work. Unfortunately, the current status of percent battery not automatic update and wrong calculate time left.

 

ScreenShot2013-10-31at41005PM_zps71d17b3

There were no errors when I applied against the DSDT you originally posted. Please post the DSDT you're applying it to. Also post ioreg dump (IORegistryExplorer).

 

Also, it appears you're using DSDT Editor. Not recommended. Use MaciASL instead.

Link to comment
Share on other sites

 Share

×
×
  • Create New...