Contribute
Register

[Guide] How to patch DSDT for working battery status

Looks normal.

Get rid of all Clover DSDT "Fixes".

Hello RehabMan, thanks for your help in Brightness post.

I've started from scratch and applied the recommended fixes of your guide for Laptop.

The AC/Battery status works good and I've used the patch of your repository for Lenovo Y570 with my Laptop Lenovo Y550. I'm telling you this in case you want to add my model to this patch.

The problem of the delay the icon takes to change between AC to Battery stills.

From AC to Battery takes 25 seconds to change icon and to show remaining discharging time 1 minute more.
From Battery to AC takes 11 seconds to change icon and to show remaining charging time 1 minute more.

As you said in an answer yesterday, it is not normal. The change should be faster, Am I right?


I'm attaching RehabMan folder and IOReg.


Thanks!!
 

Attachments

  • RehabMan.zip
    13.2 KB · Views: 65
  • IOReg.ioreg.zip
    365.4 KB · Views: 62
Hello RehabMan, thanks for your help in Brightness post.

I've started from scratch and applied the recommended fixes of your guide for Laptop.

The AC/Battery status works good and I've used the patch of your repository for Lenovo Y570 with my Laptop Lenovo Y550. I'm telling you this in case you want to add my model to this patch.

The problem of the delay the icon takes to change between AC to Battery stills.

From AC to Battery takes 25 seconds to change icon and to show remaining discharging time 1 minute more.
From Battery to AC takes 11 seconds to change icon and to show remaining charging time 1 minute more.

As you said in an answer yesterday, it is not normal. The change should be faster, Am I right?


I'm attaching RehabMan folder and IOReg.


Thanks!!

Are there any EC query methods called when plugging/unplugging the AC adapter?

Use ACPIDebug and "Instrument EC queries" to find out.

Was your original AC adapter object called ADP1 or did you rename it that way. The rename should probably be avoided (no "AC Adapter Fix" patch).
 
Are there any EC query methods called when plugging/unplugging the AC adapter?

Use ACPIDebug and "Instrument EC queries" to find out.

Was your original AC adapter object called ADP1 or did you rename it that way. The rename should probably be avoided (no "AC Adapter Fix" patch).

With ACPIDebug I have the following EC events.

AC - BAT:
_Q38 enter (1 time)
_Q1D enter - exit (6 times)

BAT - AC:
_Q37 enter (1 time)

Regarding the rename of AC adapter. Indeed I renamed from ACAD to ADP1. But anyway just a minutes ago I've renamed again to ACAD and the same delay stills.
 

Attachments

  • AC - BAT.png
    AC - BAT.png
    33.6 KB · Views: 120
With ACPIDebug I have the following EC events.

AC - BAT:
_Q38 enter (1 time)
_Q1D enter - exit (6 times)

BAT - AC:
_Q37 enter (1 time)

Regarding the rename of AC adapter. Indeed I renamed from ACAD to ADP1. But anyway just a minutes ago I've renamed again to ACAD and the same delay stills.

You need to further instrument the methods _Q38 and _Q37 to determine why they are entered, but not exiting. This indicates a problem causing abort, which means they aren't doing everything they are supposed to do.

My guess is you've dropped too many SSDTs, such as the one that defines 'CFGD'...
 
You need to further instrument the methods _Q38 and _Q37 to determine why they are entered, but not exiting. This indicates a problem causing abort, which means they aren't doing everything they are supposed to do.

My guess is you've dropped too many SSDTs, such as the one that defines 'CFGD'...



Hello RehabMan,

I've managed to solved the delay problem between change icon from BAT-AC and AC-BAT.
In my original _Q37 Method I have some IF with J380 device (as I understood it's Firewire related and my laptop doesn't have any). Then I removed all IF statement.
And the other problem I've found was If (LAnd (CFGD, 0x01000000)). I don't know if it is right but I've removed and left Notify (\_PR.CPU1, 0x81).


Original _Q37 Method

Method (_Q37, 0, NotSerialized)
{
Store ("=====QUERY_37=====", Debug)
P8XH (Zero, 0x3B)
If (LAnd (LEqual (OMID, 0x22), ECOK ()))
{
If (LNotEqual (^^^RP01.J380.DVID, 0xFFFFFFFF))
{
Store (And (0xBF, ^^^RP01.J380.D3EF), ^^^RP01.J380.D3EF)
}
}

Store (ADPT, PWRS)
Notify (\_PR.CPU0, 0x81)
If (LAnd (CFGD, 0x01000000))
{
Notify (\_PR.CPU1, 0x81)
}

Notify (ADP1, 0x80)
Sleep (0x03E8)
Notify (^^BAT1, 0x80)
P8XH (Zero, 0x3C)
}


Modified _Q37 Method

Method (_Q37, 0, NotSerialized)
{
Store ("=====QUERY_37=====", Debug)
P8XH (Zero, 0x3B)
Store (ADPT, PWRS)
Notify (\_PR.CPU0, 0x81)
Notify (\_PR.CPU1, 0x81)
Notify (ADP1, 0x80)
Sleep (0x03E8)
Notify (^^BAT1, 0x80)
P8XH (Zero, 0x3C)
}


Now the delay changing AC-BAT or BAT-AC is zero. The only delay that exist is the calculation of charging and discharging but I think it's related to calculation and a speed limitation of my laptop.


I have one more question to finished my implementation.

With your ACPIBatteryManager.kext, I've only solved to show AC-BAT icon and calculation of time for charge and discharge?
Because besides my control panel shows battery options under Energy preference, for example the option for Sleep by time (set in battery tab) doesn't work and Sleep by battery low also doesn't work.
 
Hello RehabMan,

I've managed to solved the delay problem between change icon from BAT-AC and AC-BAT.
In my original _Q37 Method I have some IF with J380 device (as I understood it's Firewire related and my laptop doesn't have any). Then I removed all IF statement.
And the other problem I've found was If (LAnd (CFGD, 0x01000000)). I don't know if it is right but I've removed and left Notify (\_PR.CPU1, 0x81).

The reference to CFGD is a problem due to dropping SSDTs you need.

Don't drop SSDTs unless you really need to.


Now the delay changing AC-BAT or BAT-AC is zero. The only delay that exist is the calculation of charging and discharging but I think it's related to calculation and a speed limitation of my laptop.

There is always a 120 sec delay (sampling time) before calculations are made.

I have one more question to finished my implementation.

With your ACPIBatteryManager.kext, I've only solved to show AC-BAT icon and calculation of time for charge and discharge?
Because besides my control panel shows battery options under Energy preference, for example the option for Sleep by time (set in battery tab) doesn't work and Sleep by battery low also doesn't work.

Not sure what you're referring to here. Please clarify.
 
The reference to CFGD is a problem due to dropping SSDTs you need.

Don't drop SSDTs unless you really need to.




There is always a 120 sec delay (sampling time) before calculations are made.



Not sure what you're referring to here. Please clarify.

1) I've read your guide to have native power management and says "For CPUs older than Sandy Bridge, use GeneratePStates=Y GenerateCStates=Y DropSSDT=Y. No need for custom SSDT"
In my case I have a Pentium Core 2 Duo T6600.

I understood that is an older cpu. Am I Right?


2) In my last question, I want to mean the following.

- If I left my laptop working with battery and in control panel I've set up "Sleep: 1 hour", after 1 hour the laptop should go into sleep mode. In my case doesn't happen. The laptop still working and shutdown in a bad way when no battery left.
 
1) I've read your guide to have native power management and says "For CPUs older than Sandy Bridge, use GeneratePStates=Y GenerateCStates=Y DropSSDT=Y. No need for custom SSDT"
In my case I have a Pentium Core 2 Duo T6600.

Try without DropSSDT. Review your SSDTs to discover their purpose.

2) In my last question, I want to mean the following.

- If I left my laptop working with battery and in control panel I've set up "Sleep: 1 hour", after 1 hour the laptop should go into sleep mode. In my case doesn't happen. The laptop still working and shutdown in a bad way when no battery left.

Check for assertions. ("pmset -g assertions" in Terminal)

Make sure sleep actually works (invoke with Apple->Sleep).
 
Try without DropSSDT. Review your SSDTs to discover their purpose.



Check for assertions. ("pmset -g assertions" in Terminal)

Make sure sleep actually works (invoke with Apple->Sleep).


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!!
 
Back
Top