Jump to content

AppleACPIBatteryManager/AppleSmartBatteryManager For Lion


Zprood
 Share

182 posts in this topic

Recommended Posts

Now I can go into sleep if I choose sleep from menu n' wake it up by pressing space bar. Closing my laptop lid is not putting my laptop into sleep. Is it normal? Because I used to be able to put my laptop into sleep by closing lid.

 

Thanx

Here is my LID device:

Device (LID0)
	{
		Name (_HID, EisaId ("PNP0C0D"))
		Name (_PRW, Package (0x02)
		{
			0x12, 
			0x03
		})
		Method (_LID, 0, NotSerialized)
		{
			XOr (LPOL, One, Local0)
			If (Local0)
			{
				Notify (SLPB, 0x80)
			}
			Else
			{
				Store (One, LPOL)
			}
			Return (LPOL)
		}
	}

By using this code i can get sleep work when close lid under lion, but can't automatic wakeup while opening lid, need use power button or usb device. In fact, i edit some place of it, the original is:

 Name (_PRW, Package (0x02)
		{
			0x1B, 
			0x03
		})

I change 0x1B to 0x12 to get sleep, lid sleep doesn't work by default on 10.7.x, but works with 10.6.x.

 

@alexkidd

This driver may take a little time to calculate the battery status, it takes 30 seconds though.

 

 

@weizh126

Actually yes, I dropped too much reading stuff, it is annoying you know that. :rolleyes:

Link to comment
Share on other sites

Here is my LID device:

Device (LID0)
	 {
		 Name (_HID, EisaId ("PNP0C0D"))
		 Name (_PRW, Package (0x02)
		 {
			 0x12, 
			 0x03
		 })
		 Method (_LID, 0, NotSerialized)
		 {
			 XOr (LPOL, One, Local0)
			 If (Local0)
			 {
				 Notify (SLPB, 0x80)
			 }
			 Else
			 {
				 Store (One, LPOL)
			 }
			 Return (LPOL)
		 }
	 }

By using this code i can get sleep work when close lid under lion, but can't automatic wakeup while opening lid, need use power button or usb device. In fact, i edit some place of it, the original is:

 Name (_PRW, Package (0x02)
		 {
			 0x1B, 
			 0x03
		 })

I change 0x1B to 0x12 to get sleep, lid sleep doesn't work by default on 10.7.x, but works with 10.6.x.

 

Cool..now LID is okay. I need to press space bar to wake it up. It's a bit weird though, I just converted some codes into 8-bit codes but sleeping behavior is affected also. But thanx a lot..you're the man!!

Link to comment
Share on other sites

How do you know exactly which parts need to be patched? Some you left as 16, some you changed to 8.

 

EDIT: Zprood, I am now attempting to migrate the changes you made from my dsdt to another. I have put them all in correctly, but it won't compile. It errors on the sections like this:

 

(this is just a snippet of course)

 

Store ("battery 0", Debug)
							If (And (BATP, One))
							{
								Store (DerefOf (Index (Local0, 0x11)), Local2)
								If (LEqual (Local2, Zero))
								{
									Store (Zero, INCH)
									Store (Zero, IDIS)
									Store (Zero, INAC)
									Store (Zero, B1B2)
									AXC0
									AXC1
									Store (One, PSSB)
									Store (Package (0x02)
										{
											Zero, 
											Zero
										}, Local4)
								}

 

It says that B1B2 is not receiving enough values, and it requires two. And then it says that where AXC1 is, it expects a (.

 

How can I make this compile? I'd love to help take what you did for me and share it with others as well.

 

EDIT2: Also, I've discovered the DSDT you edited for me produces the same errors.

Link to comment
Share on other sites

Hello Zprood!

 

Thanks for Your hard work, we really appreciate it. I followed Your guide, i thought i have enough knowledge because i adopted all of the DSDT modifications alone, and my Lion install works very well, but this is hard :)

I found some section, edited, but there is some, what i can't found. I tried to look it in the fixed dsdts, what you made, but didn't helped a lot. Can You look it into? (I'm really don't want ask this, but my OSX never worked very well with WoodooBattery kext, sometimes it loads correctly and displays the correct walues, sometimes it shows only an X in the battery icon (Maybe an DSDT parse error? - But with the original DSDT its also happend.) Thats why i want to use this kext.

 

Thanks a lot and i wish all the best!

m.

 

My DSDT: DSDT_20111123.zip

Link to comment
Share on other sites

Hello Zprood!

 

Thanks for Your hard work, we really appreciate it. I followed Your guide, i thought i have enough knowledge because i adopted all of the DSDT modifications alone, and my Lion install works very well, but this is hard :(

I found some section, edited, but there is some, what i can't found. I tried to look it in the fixed dsdts, what you made, but didn't helped a lot. Can You look it into? (I'm really don't want ask this, but my OSX never worked very well with WoodooBattery kext, sometimes it loads correctly and displays the correct walues, sometimes it shows only an X in the battery icon (Maybe an DSDT parse error? - But with the original DSDT its also happend.) Thats why i want to use this kext.

 

Thanks a lot and i wish all the best!

m.

 

My DSDT: DSDT_20111123.zip

Read post 1#, 6#, also take a look of alexkidd's dsdt, your file is similar with his.

TIPS:

search BAT0 device, you will find BIF & BST method, it relates two method upon, method GBIF, GBST. The thing you can do is edit the 16bit registers of GBIF and GBST, also it is needed if it exists under BIF and BST.

Link to comment
Share on other sites

Terrific Project!!. Works great on my Asus M60J notebook.

 

lionbatteryscreenshot2.png

 

 

Very clever coming up with Method B1B2. It simplified all my conversions to 8-bit.

 

The only issue I had was that your SmartBatteryManager kext was not auto-loading. After every reboot, I had to manually type in terminal: kextload /Extra/Extensions/AppleSmartBatteryManger.kext.

 

I solved that issue by going in the info plist and changing Bundle Version 1 to Bundle Version 2011.11.20 (the date, just like gsly did). I think it's because there's already an AppleSmartBatteryManager kext in S/L/E, and for your kext to auto-load, the Bundle Version number needs to be higher than the Apple one. At least, that's how it is on my Asus notebook.

 

I really like your AppleSmartBatteryManager. It gives bonus battery cycle info without having to add Method _BIX. It also seems to be more sensitive to very small capacity drops that gsly's AppleSmartBattery didn't pick up on my laptop. I have a very old battery that does not stay at 100% for more than a day or two. I charged it to full 100% capacity at 1219 mAh. The next day, it dropped to 1212 mAh. Both your kext and BatteryEater Pro on Windows picked up the 7 mAh drop and were indicating 99%. But gsly's kext was still saying full 100% at 1219 mAh. For some reason, yours seems to be more sensitive to small drops.

 

I created a complete dsl instruction file of all the edits I did to get SmartBatteryManager working on Lion for my Asus M60J, but should be applicable to all the Asus Core i3/i5/i7 notebooks. From what I've seen so far, all the Asus Core i notebooks have identical battery dsdt.

 

The Lion dsdt edits instruction file is at the bottom of my post# 95 in glsy's thread under the name Asus_Coreix_Lion_Edits. I have also included a full dsdt of my Asus M60J on Lion in case they don't understand a particular instruction.

 

http://www.insanelym...dpost&p=1771830

Link to comment
Share on other sites

Hi Zprood!!

I have a lenovo g460 running 10.7.2 and i tried to make the edits that u have showed in ur guide but getting too many errors. Plz help me with this. Thanks a lot mate.

 

Edit: I tried again and got it to work but battery shows 100% all the time. I don't think i'll b able to do it. Plz if u edit it for me it would be really appreciated. Thanks. DSDT is attached.

DSDT.aml.zip

Link to comment
Share on other sites

I fixed my dsdt using Zprood suggestions, but now I'm using latest voodooBattery instead of using AppleACPIBatteryManager. Now battery percentage is displaying correctly. Patched dsdt allows me to use vanilla Lion AppleACPIPlatform instead of SnowLeo's AppleACPIPlatform.

 

edit: I ran my laptop on battery for several mins, it's still showing 100%, I think I need to recheck my dsdt.

I have fixed my DSDT, now it's running fine, I don't need to convert BFC1 into 8-bit for my Lenovo G470. I just need to convert some parameters under EmbeddedControl into 8-bit. I'm going to try AppleACPIBatteryManager later.

Link to comment
Share on other sites

I fixed my dsdt using Zprood suggestions, but now I'm using latest voodooBattery instead of using AppleACPIBatteryManager. Now battery percentage is displaying correctly. Patched dsdt allows me to use vanilla Lion AppleACPIPlatform instead of SnowLeo's AppleACPIPlatform.

 

edit: I ran my laptop on battery for several mins, it's still showing 100%, I think I need to recheck my dsdt.

I have fixed my DSDT, now it's running fine, I don't need to convert BFC1 into 8-bit for my Lenovo G470. I just need to convert some parameters under EmbeddedControl into 8-bit. I'm going to try AppleACPIBatteryManager later.

 

Can you please let us know what you had to do to get to 100%?

 

We have the same thing happening.

Link to comment
Share on other sites

Can you please let us know what you had to do to get to 100%?

 

We have the same thing happening.

 

I got two BFC on my original DSDT, BFC0 under EmbeddedControl, and BFC1 under

OperationRegion (OGNS, SystemMemory, 0xBCFBEF18, 0x14)
Field (OGNS, AnyAcc, Lock, Preserve)

 

I converted BFC0 into 8-bit, n' left BFC1 untouched

Field (ERAM, ByteAcc, Lock, Preserve)
{
//BFC0,   16,
SFC0,   8,
SFC1,   8,

 

and changed this

//Store (^^EC0.BFC0, BFC1)
Store (B1B2 (^^EC0.SFC0, ^^EC0.SFC1), BFC1)

 

I also converted some parameters under EmbeddedControl into 8-bit as Zprood suggested on post #1

I don't know whether it will work with your laptop, but it's working on my Lenovo G470. Anyway I'm still using voodooBattery, I haven't gotten time to check it using AppleACPIBatteryManager.

Link to comment
Share on other sites

I got two BFC on my original DSDT, BFC0 under EmbeddedControl, and BFC1 under

OperationRegion (OGNS, SystemMemory, 0xBCFBEF18, 0x14)
Field (OGNS, AnyAcc, Lock, Preserve)

 

I converted BFC0 into 8-bit, n' left BFC1 untouched

Field (ERAM, ByteAcc, Lock, Preserve)
{
//BFC0,   16,
SFC0,   8,
SFC1,   8,

 

and changed this

//Store (^^EC0.BFC0, BFC1)
Store (B1B2 (^^EC0.SFC0, ^^EC0.SFC1), BFC1)

 

I also converted some parameters under EmbeddedControl into 8-bit as Zprood suggested on post #1

I don't know whether it will work with your laptop, but it's working on my Lenovo G470. Anyway I'm still using voodooBattery, I haven't gotten time to check it using AppleACPIBatteryManager.

 

 

@archintosh can u please attach ur modified dsdt as i also have a lenovo g460 and i think that ur dsdt might help me edit the battery section of mine. Thanks. And also can u tell me where embedded control is located? I cant find it in my dsdt

Link to comment
Share on other sites

wooohoooooo.............battery finally working properly!!! No problems at all!!! Thanks a lot Zprood for such a super awesome guide. Ur the man!! :)

If any Lenovo users having trouble editing their battery info can give me their DSDT.

Thanks a lot!! :(

Link to comment
Share on other sites

 Share

×
×
  • Create New...