Jump to content

HP DVx ACPI 3.x/4.x Battery Driver (10.6/10.7)


gsly
 Share

229 posts in this topic

Recommended Posts

Hello Gsly,

 

Thank you for the update. It works great on my HDX 16 (insyde bios F.32). I applied Step 1, Step 2a, Step 2c, Step 2d. I changed ECON to ECOK and LPBC to LPB. I changed UseExtendedBatteryInformationMethod to no. BatteryPollingPeriodOverride is set to 5. Here is the battery information in system profiler. Dim on battery is also working.

 

Battery Information:

 Model Information:
 Serial Number:	 ** Removed **
 Manufacturer:	CPT-U26C
 Device Name:	EV06055
 Pack Lot Code:	306c
 PCB Lot Code:	8600
 Firmware Version:	80ff
 Hardware Revision:	ffff
 Cell Revision:	0
 Charge Information:
 Charge Remaining (mAh):	4290
 Fully Charged:	Yes
 Charging:	No
 Full Charge Capacity (mAh):	4290
 Health Information:
 Cycle Count:	0
 Condition:	Normal
 Battery Installed:	Yes
 Amperage (mA):	0
 Voltage (mV):	12315

System Power Settings:

 AC Power:
 System Sleep Timer (Minutes):	20
 Disk Sleep Timer (Minutes):	10
 Display Sleep Timer (Minutes):	10
 Wake on AC Change:	No
 Wake on LAN:	Yes
 Current Power Source:	Yes
 Display Sleep Uses Dim:	Yes
 PrioritizeNetworkReachabilityOverSleep:	0
 RestartAfterKernelPanic:	15
 Battery Power:
 System Sleep Timer (Minutes):	20
 Disk Sleep Timer (Minutes):	10
 Display Sleep Timer (Minutes):	2
 Wake on AC Change:	No
 Display Sleep Uses Dim:	Yes
 Reduce Brightness:	Yes
 RestartAfterKernelPanic:	15

Hardware Configuration:

 UPS Installed:	No

AC Charger Information:

 Connected:	Yes
 ID:	0x0000
 Wattage (W):	0
 Revision:	0x0000
 Family:	0x0000
 Serial Number:	0x00000000
 Charging:	No

I have only one question. There is already a kext in S/L/E called AppleSmartBatteryManager.kext. I am using kernel cache on Lion, so I had to move all my kexts to S/L/E . Is there a way to install this kext without removing the vanilla one? Not that it is a big deal, but since it is a vanilla driver, it might be overridden by future updates.

 

Thank you again.

Link to comment
Share on other sites

The dsdt edits (especially the latest updated ones) have enabled the battery status display on my Asus n81v in Lion, but I am guessing the kexts in this thread are only for HP systems since they only give me a 0% status on all 4 (both debug and release).

 

However using an AppleACPIBatteryManager.kext I got elsewhere I managed to get the menubar status displaying correct info, BUT my system profiler gave me an "Error reading information" ... (funny thing is ioregistry had every info available on the battery)

 

Then I used a VoodooBattery.kext also found elsewhere and I got both the menubar status and system profiler working (BUT the profiler gave very limited info ..)

 

I probably added too many unneeded edits to the dsdt so I will see if I can tweak it to make profiler work with AppleACPIBatteryManager.kext

 

Thanks for all the info ...

 

1zqeao5.jpg

Link to comment
Share on other sites

You should be able to use the 3.x method. Look at the ACPI 2.x documents on the site referenced in the original post to see if the _BIF and _BST were defined in that revision of the standard. (I'm sure they were but I haven't looked)

 

SMRD is a method in the EC device. If you don't have an SMBus/SBS, you'll have to determine what registers in your EC are wired directly to the battery controller and modify your _BIF and _BST methods to return the data outlined in the ACPI specification.

 

Thanks for the tip, but my Device (EC0) doesn't seem to be making much use of the battery control method registers. It's quite small. A lot seems to be missing.

 

I also realize this thread is more geared towards HP laptop users. I'm on an Asus M60J notebook. However, just for the fun of it, without doing any battery dsdt edits, I tried your kext with UseExtendedBatteryInformationMethod set to false for ACPI 3.x. Interestingly, all the battery information displays including battery voltage and amps. Expectedly, some of the values are off and it can't compute remaining percentages and time, but amazing that I have this much showing without doing any battery dsdt adaptations for Asus.

 

batterymanagerscreensho.png

 

dsdt.aml.zip

Link to comment
Share on other sites

...

I have only one question. There is already a kext in S/L/E called AppleSmartBatteryManager.kext. I am using kernel cache on Lion, so I had to move all my kexts to S/L/E . Is there a way to install this kext without removing the vanilla one? Not that it is a big deal, but since it is a vanilla driver, it might be overridden by future updates.

 

Thank you again.

Maybe :(

 

If you can do without iStat and similar tools that are hard coded to the class name in the IORegistery, just use the legacy named kext that will not collide, otherwise its a similar problem to the good old DLL HELL issue on Windows ;)

 

 

 

I also realize this thread is more geared towards HP laptop users. I'm on an Asus M60J notebook. However, just for the fun of it, without doing any battery dsdt edits, I tried your kext with UseExtendedBatteryInformationMethod set to false for ACPI 3.x. Interestingly, all the battery information displays including battery voltage and amps. Expectedly, some of the values are off and it can't compute remaining percentages and time, but amazing that I have this much showing without doing any battery dsdt adaptations for Asus.

That's the great thing about standards... when everyone codes to the standard from the hardware up though to the OS level, stuff just magically works together :D

 

My guess is that with a little DSDT work, you can get it all working.

 

The dsdt edits (especially the latest updated ones) have enabled the battery status display on my Asus n81v in Lion, but I am guessing the kexts in this thread are only for HP systems since they only give me a 0% status on all 4 (both debug and release).

This driver will work with any ACPI 3/4 compliant system that returns the data structures as defined in the specification for _BIF (of _BIX) and _BST. The only HP specific stuff in this thread is the DSDT code that implements the ACPI _BIF, _BIX and _BST methods.

 

*You* have to figure out what your Asus provides from the battery and get your methods to return this data in your DSDT methods. Once you do, the driver will correctly pass it to the OS.

Link to comment
Share on other sites

Great job gsly :)

 

Both AppleACPIBatteryManager.kext and AppleSmartBatteryManager.kext are working as expected :)

 

Thanks for all the work you put into this, it's very much appreciated ;)

 

 

@NIXin

Tried your auto-patch and got a lot of compile errors. Doing it the long way with gsly's instructions work great. :D

Link to comment
Share on other sites

Hey gsly!

 

I will test it now :) , attaching the updated patcher file (to use, get DSDT Auto Patcher first).

 

Thanks!

 

Hi,Nixin,

tried your new patch and same as dgrx ,it gives me more than 200 compile errors.

 

Please look into it.

Thanks for all your work.

 

@gsly

 

 

GREAT JOB MAN.

Link to comment
Share on other sites

Works great gsly, good job! :)

To people that say they have compile errors - it must be that your DSDT is not compatibile with mine. Also, are you patching under Windows or Linux? Because if you patch on Mac, you are actually patching an already patched DSDT (so, no good!).

If you like send me your raw, untouched DSDT file (extracted in Windows or Linux), and I can look into where the patcher is failing for your machines.

 

Cheers,

NIXin

Link to comment
Share on other sites

Works great gsly, good job! :D

To people that say they have compile errors - it must be that your DSDT is not compatibile with mine. Also, are you patching under Windows or Linux? Because if you patch on Mac, you are actually patching an already patched DSDT (so, no good!).

If you like send me your raw, untouched DSDT file (extracted in Windows or Linux), and I can look into where the patcher is failing for your machines.

 

Cheers,

NIXin

 

Hi NIXin,

Tried to compile from Windows (untouched extracted DSDT). Your DV6-i7-bleeding-NIXon patch compiles fine for me. A text compare with the new patch... shows only Gsly's Lion patch to be the diff. As stated by macq " over 200 errors ". Thanks for the offer, but I'll try to work it out myself (That way I learn something :() It may just be a slight difference in BIOS, and I don't want Gsly's thread to get hijacked. Just giving some feedback. :P

 

Once again Gsly, Great work ;) Thanks :D

Link to comment
Share on other sites

Works great gsly, good job! :)

To people that say they have compile errors - it must be that your DSDT is not compatibile with mine. Also, are you patching under Windows or Linux? Because if you patch on Mac, you are actually patching an already patched DSDT (so, no good!).

If you like send me your raw, untouched DSDT file (extracted in Windows or Linux), and I can look into where the patcher is failing for your machines.

 

Cheers,

NIXin

 

@Nixin ,

here's my raw linux generated dsdt if you need for evaluation

Link to comment
Share on other sites

Hi Glsy! Thanks for your work!! I just tried your method in lion and it works quite nice! I am noticing that the battery is seen as "service battery"... is it normal? I am using AppleSmartBattery kext.

 

But It REALLY works on Lion!! Thanks!!

 

Any update about the problem that when battery is almost zero, it doesn't hibernate but it powers off and on continuously until the battery is dead? It may be nice to put computer in hibernate automatically without powering it on and off continuously but i guess it's hard-coded in hardware?

 

Mal

Link to comment
Share on other sites

Hi Glsy! Thanks for your work!! I just tried your method in lion and it works quite nice! I am noticing that the battery is seen as "service battery"... is it normal? I am using AppleSmartBattery kext.

 

But It REALLY works on Lion!! Thanks!!

 

Any update about the problem that when battery is almost zero, it doesn't hibernate but it powers off and on continuously until the battery is dead? It may be nice to put computer in hibernate automatically without powering it on and off continuously but i guess it's hard-coded in hardware?

 

Mal

Where are you seeing "service battery"? If its in the system profiler, I think Lion is telling you to replace the battery ;) The battery driver just talks to the battery, gathers the information and passes it to the power management layer in OSX. Unless your battery is returning "service battery" for the model name, etc., the OS is looking at the rest of the data (number of cycles, current capacity and capacity-at-new) and determining the health of the battery based on those.

 

As mentioned, the battery drivers role in life is to talk to the battery and relay that information to the power management layer. The power management layer is the bit that tells the system to sleep when idle (idle sleep) and system sleep (forced sleep). The problem with idle sleep is that applications and drivers can override the request to sleep. Also, I think that if an old driver is used that doesn't respond to idle sleep requests, the PM layer interprets that as "abort the sleep". Just my theory and I hope to do some testing in this regard soon.

Link to comment
Share on other sites

@glsy

Thanks glsy for trying to figure out such awake from sleep when battery is low. Service battery has shown in taskbar near (battery icon near wifi,speakerout,time,eject,search icon top-right of the screen). I noticed in your original post, under the "model number", "setial number" and so on there is no name (" ") ... is it perhaps due to such missing name? I applied all the fixes , was i wrong to apply everything?

 

@JBraddock

Thanks James for your suggestion, but here it doesn't go away... it stays there... both in lion and in snow : service battery. Under istatPro i can see Health: 71% , Cycles : 159 , and correct time of charging and percentage . It says service battery also on battery power (without ac power supply). ***OFF TOPIC BEGIN*** Did you update your lion guide for hdx16? I almost use dv8 now, due to such annyoing applehda problem that sound doesn't resume after sleep (i use sleep function a lot)... ***OFF TOPIC END***

 

Thanks!

Mal

Link to comment
Share on other sites

@JBraddock

Thanks James for your suggestion, but here it doesn't go away... it stays there... both in lion and in snow : service battery. Under istatPro i can see Health: 71% , Cycles : 159 , and correct time of charging and percentage . It says service battery also on battery power (without ac power supply). ***OFF TOPIC BEGIN*** Did you update your lion guide for hdx16? I almost use dv8 now, due to such annyoing applehda problem that sound doesn't resume after sleep (i use sleep function a lot)... ***OFF TOPIC END***

I had that warning for a couple of weeks and then it went away. It is possible that in your case, your battery is actually dying. Try uninstalling and reinstalling the driver. Or may be just use the older version on Snow Leopard to see if it fixes the issue.

 

// Yes, I updated the topic. I'll share one more fix which is the graphic power management. Without it, GPU performance is horrible. Once 10.7.2 has come out, I'll update it again. I bought Samsung YA-SBR510B, which is just joy to use. It has both bluetooth and usb input, which means that it goes on working even after sleep. //

Link to comment
Share on other sites

@glsy

Thanks glsy for trying to figure out such awake from sleep when battery is low. Service battery has shown in taskbar near (battery icon near wifi,speakerout,time,eject,search icon top-right of the screen). I noticed in your original post, under the "model number", "setial number" and so on there is no name (" ") ... is it perhaps due to such missing name? I applied all the fixes , was i wrong to apply everything?

 

Thanks!

Mal

Ya, the "Service Battery" message is coming from another part of the OS (likely the PM layer) and you can see it here:

 

Service Battery indicator in Mac OS X

 

I've never seen that message before :) It comes from /System/Library/CoreServices/Menu Extras/Battery.menu

 

Other messages you can see there:

 

About the Battery menu bar extra for portable Macs

Link to comment
Share on other sites

Hey guys,

 

You were correct, the patcher I gave you before didn't work and thrown parse errors. It is because of some weird error in the AutoPatcher.

Here's a fix. HP_DVx_i7_patch_2011_09_29.zip

 

To use the patcher with DV6 or DV8 rename accordingly patch-xx.txt file to patch.txt

 

Sorry, I didn't test it properly before release.

 

Cheers

Link to comment
Share on other sites

I tested with manmal's DV8 and still need to remove the "nasty hacks" to be able to compile.

 

# nasty hack for DV6 to remove one closing bracket from child
into method label _RMV parent_type device parent_label J384 code_regex Return\s\(One\)\n\s*\} replace_matched
begin
Return (One)\n
end;

# nasty hack for DV8
into method label PR08 parent_type device parent_label J384 code_regex Return\s\(PR08\)\n\s*\} replace_matched
begin
Return (One)\n
end;

 

This patch doesn't make much sense to me, because if the original file had a missing or extra } the parser would fail

Captura_de_Tela_2011_09_29_a__s_11.46.42.png

 

Edit: the other error in previous patch (2011-09-22) was this

[color="#FF0000"]//[/color] LION FIX:
into method label SMRD parent_type device parent_label EC0 remove_entry;

Comments between patches must be #, not //, so the old SMRD was not being removed, causing error "Name already exists in scope (SMRD)".

 

This applies without problems on manmal's DSDT

HP_DVx_i7_patch_2011_09_22.txt

 

You can use this version of Auto-Patcher (app only)

 

Download: http://olarila.com/forum/viewtopic.php?f=19&t=507

 

Kexts.com mirror: http://www.kexts.com/view/1881-dsdt_auto-p...r_app_only.html

Link to comment
Share on other sites

Thank you very much NIXin & oldnapalm for your work!!!

I am using it right now and it seems to work very nice!!!

Now i am beginning to understand how such scripting language works :D nice oldnapalm!!

Mal

 

*EDIT: The only things i noticed with this dsdt are, 1) audio was not working(i am using 10.6.8 now... will try lion later) , but i changed layoutID and it works now, 2) Brightness is not working well : both GenericBrightness and ACPIBrightness (new method) and backlight of LCD is very very low! ...and I am continuing to have service battery message, though.

Link to comment
Share on other sites

@ Nixin.oldnapalm,

 

i am still having the compile errors,more than 200,I have tried the fixed patch by oldnapalm but it also fails to compile.Could you please look into my dsdt and see whats wrong.my dsdt is posted a couple of posts back on this thread only.It is post 61

Thanks in advance

Link to comment
Share on other sites

 Share

×
×
  • Create New...