Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
I'm not 100% sure on how to integrate this to your current setup, since I have *never* worked with ECEnabler. Had a gander at it's source, seems like it just reroutes AppleACPIEC's ecSpaceHandler to some custom implementations that are able to handle fields > 8b. So I *guess* that we no longer need to care about B1B2, B1B4, RECB, WECB, and so on, and just directly implement changes.
That's exactly what it does. If you have ECEnabler, you don't need to worry about B1B2, B1B4, RECB, WECB, etc

Btw, I'd check the ACPI spec. _BIF does not return cycle count, _BIX does. You probably need to write a custom _BIX method.
Section 10.2.2.1 for _BIF
Section 10.2.2.2 for _BIX

I think AcpiBatteryManager could read extra (nonstandard) fields from _BIF but SMCBatteryManager won't:

If you want battery temperature, SMCBatteryManager does have a custom method for that:
 
@1Revenger1

I honestly never tried to work on anything related to cycle count or thermals, which is why this is more guesswork on my part than anything I'm sure about. RehabMan talked about _BIF, which is why I took a look at it (https://www.tonymacx86.com/threads/lenovo-x230-battery-cycle-count-last-problem-to-be-solved.257163/).

Just read the links you provided, and I now see what issue you're talking about. _BIF and NBTI work, but are not up to standard, and thus not read by the newer SMCBatteryManager, only legacy ACPIBatteryManager does. I could implement _BIX with NBIX, just not sure if it's worth the trouble, or if downgrading to the other kext would be fine as well.
 
@DaveJ1

Please try this SSDT, just copy, add in config and reboot, no renames or anything else needed. This should change battery information, please capture a screenshot before *and* after. I commented out TEMP for now, since I'm not 100% sure on how it works yet.
 

Attachments

  • SSDT-BATT.aml
    1.2 KB · Views: 61
@DaveJ1

Please try this SSDT, just copy, add in config and reboot, no renames or anything else needed. This should change battery information, please capture a screenshot before *and* after. I commented out TEMP for now, since I'm not 100% sure on how it works yet.
Showing up Battery power, and Serial number is gone.
Is this enough information?
 
@DaveJ1

Thanks for the quick response, I need some more time to read up on this stuff, I think I messed up a little. Hold tight, be right back!
 
@DaveJ1

Since I'm not really sure what's the issue and I can't live-debug this, it would be awesome if you could again boot with the attached SSDT and show me another screenshot, there should be some debugs there now.
 

Attachments

  • SSDT-BATT.aml
    1.2 KB · Views: 44
@DaveJ1

Since I'm not really sure what's the issue and I can't live-debug this, it would be awesome if you could again boot with the attached SSDT and show me another screenshot, there should be some debugs there now.
When,
Plugged in:
- first reboot the Hardware/Power page the same
- CoconutBattery showing usual, except the temperature, cycle count.
- Discharging/Charging indicator is working, at least showing more or less the correct Wattage.
- macOS Battery Percentage and Coconut Charge Capacity is showing different value. ~5% different.

Unplugged:
- second reboot Hardware/Power showing Serial number, but Battery Power(3rd reboot yes) section not and Coconutbattery showing nothing.

Boot with plugged and then unplugged.
- Battery icon is changing to battery source and back to power source. Charge capacity is changing(decrease/increase).
- Coconutbattery showing, except thermal and cycle count.
When reconnecting, icon/percentage changing.

It was a moment at the second boot, when i closed CoconutBattery and opened, then showed nothing.

Boot with unplugged and then plugged.
- Battery icon is charging. - source and percentage
- CoconutBattery is fully empty, after plugged too.

I wanted a relatively detailed quick test.
How can i get more proper information to you?
 
Last edited:
@DaveJ1

I just need a screenshot from System Report with the latest SSDT loaded, and maybe also zip up your current EFI folder and attach it. This all seems weird, since I've hardcoded 123 Battery-Cycles now, and a Serial-Number of "Hello World". No idea why nothing would show up... This would suggest that it's not even called.

ACPIDebug would help greatly here, but it's a bit tough to do this remote, would require multiple back- and forths.
 
ACPIDebug you mean Click. - i never tried.
Tell me what to do and i try it, if you want to.

* Look at this. I think this was make with Rehabman guide. It uses the ACPIBatteryManager with SSDT-8x70. Maybe it's helpful.
 
Last edited:
@DaveJ1

Please boot with the attached file and send me another screenshot of System Report, nothing else needed so far.
 

Attachments

  • SSDT-BATT.aml
    1.3 KB · Views: 61
Status
Not open for further replies.
Back
Top