Contribute
Register

[Guide] How to patch DSDT for working battery status

Hi Rehabman, thank you!
the battery works according to your tutorial. However I find whenever the laptop runs on battery, it causes GFX unstable, as you can see below, it drops from normal level 0.75GHz to minimal 0.15GHz, and CPU drops from nomal range 0.8GHz~3.3GHz to minimal 0.8GHz as well, and laptop becomes sluggish as their frequencies drop.
But if laptop runs on AC adapter, no such things occur.
What's going on with this? Rehabman.
unstable GFX.png
 
hi guys, can someone please look at my problem.

I have looked at the Rehabman's post about how to patch DSDT for working battery status.

My DSDT under EmbeddedControl references 2 fields which is already 8 bits.

Code:
OperationRegion (ERAM, EmbeddedControl, Zero, 0xFF)
            Field (ERAM, ByteAcc, Lock, Preserve)
            {
                Offset (0x5F),
                ERBD,   8,
                SMPR,   8,
                Offset (0x62)
            }

the problem arises when I click on the show battery status in menu bar under energy saver, the battery status appears momentarily for 1 second and the battery status is 0 % although it should be charged and working.

Screenshot 2019-12-29 at 13.41.34.png
 

Attachments

  • debug_3823.zip
    3.2 MB · Views: 80
can someone please look at my problem
According to your ioreg, the _STA method of device BAT1 is not returning 0x1F

Patch your DSDT BAT1._STA method as below
Code:
Method (_STA, 0, NotSerialized)  // _STA: Status
{
    Return (0x1F)
}

Read this guide for patching

You also have ACPI errors: your SSDT-I2C is referring to TPD1 you don't have. (see kernel_log)
Code:
2019-12-29 13:12:28.719644+0200 0x71       Default     0x0                  0      0    kernel: (AppleACPIPlatform) ACPI Error:
2019-12-29 13:12:28.719904+0200 0x71       Default     0x0                  0      0    kernel: (AppleACPIPlatform) [_SB_.PCI0.I2C1.TPD1]
Change I2C1.TPD1 to I2C0.TPD0
Also EC0 should be patched to EC (available in Clover Configurator ACPI section, "List Of Patches" popup)

Hibernate still active. It must be disabled (Hackintool is the fast way to do it...)

You need USB injection as per below guide...
 
According to your ioreg, the _STA method of device BAT1 is not returning 0x1F

Patch your DSDT BAT1._STA method as below
Code:
Method (_STA, 0, NotSerialized)  // _STA: Status
{
    Return (0x1F)
}

Read this guide for patching

You also have ACPI errors: your SSDT-I2C is referring to TPD1 you don't have. (see kernel_log)
Code:
2019-12-29 13:12:28.719644+0200 0x71       Default     0x0                  0      0    kernel: (AppleACPIPlatform) ACPI Error:
2019-12-29 13:12:28.719904+0200 0x71       Default     0x0                  0      0    kernel: (AppleACPIPlatform) [_SB_.PCI0.I2C1.TPD1]
Change I2C1.TPD1 to I2C0.TPD0
Also EC0 should be patched to EC (available in Clover Configurator ACPI section, "List Of Patches" popup)

Hibernate still active. It must be disabled (Hackintool is the fast way to do it...)

You need USB injection as per below guide...
Hi FreeJack, thank you for such quick response. Wow, you given us more than just anticipated. I have implemented all the above except the usb because it is something that I still need to do in my guide here : Guide Aspire A715-74G-78KF.

Your fix related to battery status still has some challenges. I have made a screen recording. See attached.
- Selecting the "Show batter status in menu bar" momentarily displays the status but then it disappears.
- and the "Current battery charge" is 0 although it should be almost at 100% as it is plugged in and the blue light indicator is on.
 

Attachments

  • record screen.mov.zip
    11.2 MB · Views: 102
  • debug_23980.zip
    7.6 MB · Views: 91
Last edited:
Guys,

Please can someone help with battery status: I'm using ACPIBatteryManager.kext.

Problem:
Battery indicator not showing. Only momentarily but then disappears.

I think I narrowed it down to the _BST methods at line 49279 in \_SB.PCI0.LPCB:

Code:
Method (_BST, 0, NotSerialized)  // _BST: Battery Status
            {
                Name (PBST, Package (0x04)
                {
                    Zero,
                    0xFFFFFFFF,
                    0xFFFFFFFF,
                    0x1770
                })
                If (ECOK ())
                {
                    Store (^^EC0.BST0, Index (PBST, Zero))
                    If (ShiftRight (^^EC0.BAC0, 0x0F))
                    {
                        Add (And (Not (^^EC0.BAC0), 0xFFFF), One, Local4)
                    }
                    Else
                    {
                        Store (^^EC0.BAC0, Local4)
                    }

                    If (LEqual (^^EC0.BAM0, Zero))
                    {
                        Divide (Multiply (Local4, ^^EC0.BPV0), 0x03E8, , Local4)
                    }

                    Store (Local4, Index (PBST, One))
                    Store (Multiply (^^EC0.BRC0, BASC), Index (PBST, 0x02))
                    Store (^^EC0.BPV0, Index (PBST, 0x03))
                    If (LNotEqual (^^EC0.BDC0, BMDL))
                    {
                        Notify (BAT1, 0x81)
                    }
                }


Where the If(ECOK ()) method should be invoke but never does.

My DSDT method for ECOK () can be found at line 48197 here:

Code:
Scope (_SB.PCI0.LPCB)
    {
     Method (ECOK, 0, NotSerialized)
        {
            If (LEqual (^EC0.OKEC, One))
            {
                Return (One)
            }
            Else
            {
                Return (Zero)
            }
        }
.....
.....

NOTE:
1. ^EC0.OKEC is never set in my DSDT.
2. I have tried to temporarily set method ECOK () to always return (One) but that does not work either.
 

Attachments

  • debug_19141.zip
    3.5 MB · Views: 111
Last edited:
@FreeJHack or anyone with some knowledge,

Note sure if this post belong under this topic ?

I have tried FakeSMC with ACPIBatteryManager without any success. See posts #5,112 and #5,114.

I have switch over to VirtualSMC and SMCBatteryManager.kext. and thus drop ACPIBatteryManager and FakeSMC.

The kernel log shows "AppleSmartBatteryManager) Failed to read key rc:0x87".

NOTE:
1. With FakeSMC and ACPIBatterManager AppleSmartBattery does NOT even feature in the kernel log files, suggesting it is not loading ?
2. While VirtualSMC and SMCBatteryManager seems to try and load AppleSmartBatterManager.

Therefore my battery status is not showing under menubar and when activated it disappears quickly.
SysInfo also show battery not loaded.

Battery.png


Can someone please provide insight or guidance ? I'm I missing a patch of some sorts ?
Much appreciated.
 

Attachments

  • debug_8112.zip
    3.7 MB · Views: 91
Last edited:
@fireCat
You must disable _STA to XSTA patch in clover config.plist.
The _STA method is mandatory for battery status and 0x1F must be returned.
In addition, SMCBatteryManager.kext is missing in clover kext/other folder.

You're still having ACPI errors (look at kernel.log): even SSDT-9-ACRPRDCT should be patched changing GFX0 to IGPU
 
Last edited:
@fireCat
You must disable _STA to XSTA patch in clover config.plist.
The _STA method is mandatory for battery status and 0x1F must be returned.

You're still having ACPI errors (look at kernel.log): even SSDT-9-ACRPRDCT should be patched changing GFX0 to IGPU
it is also best to just perform renames in config.plist rather than renames in dsdt and ssdt's :)
 
@freejack , Tx for your reply. Happy new year !

It is a bit confusing to me, kindly clarify

1. are you saying the patch _STA to XSTA must be disabled like this ?

Screenshot 2020-01-03 at 08.27.06.png


2. AND THAT the method must return 0x1F like this: hence removing all the code from If (ECOK ())

Code:
Device (BAT1)
        {
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
               Return (0x1F)
              /*If (ECOK ())
                {
                    If (^^EC0.BOL0)
                    {
                        Return (0x1F)
                    }
                    Else
                    {
                        Return (0x0F)
                    }
                }
                Else
                {
                    Return (0x1F)
                }*/             
            }
        }


3. Likewise the patch for changing GFX0 to IGPU should be: ?
Screenshot 2020-01-03 at 08.43.23.png


I can't help but to note that in clover boot loader under DSDT patch ACPI the reciprocal seems to be the case. See picture below. If you use clover configurator and set disabled flag to true it would not be selected at runtime when you load the boot loader.

So I'm not sure which to use ?

IMG_6338.jpeg
 
Last edited:
Back
Top