Jump to content

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


  • Please log in to reply
227 replies to this topic

#21
gsly

gsly

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 142 posts
  • Gender:Male
  • Location:The Great White North

hi gsly bcc9 post dsdt solution for lion.
i try to use it but i can not figure out. plz can you check it
http://www.insanelym...p;#entry1737541

I have seen his post and I've been doing some testing related to this as well as looking into the changes in AppleACPIPlatform that cause this. Nothing significant to report yet.

#22
sw170

sw170

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 212 posts
  • Gender:Male
  • Location:UK
Hi gsly,
finally found time to test your kext with all DSDT code you posted on my dv9000 machine, everything works very nicely, thank you very much for all your work and sharing.
For some reason coconut battery ver. 2.7 doesn't work for me, ver 2.6.6 works fine, but I'm not really bothered as I'm not using this program anyway.
More important for me would be if your kext could have ability to put computer to sleep on low battery: for example on 5% battery level while is on battery power would tell to system (terminal command):
osascript -e 'tell application "System Events" to sleep'
possible ?
Thanks again
swavek

EDIT: AppleSmartBatteryManager.kext solved coconut 2.7 and iStat battery info issue
EDIT2: BatteryMon.app by KWS here does the job for me.

#23
THe KiNG

THe KiNG

    InsanelyMac Legend

  • Gurus
  • 674 posts
  • Gender:Male
Very good job, congrats! :(

I have some ideas how to bypass Lion ACPI EC SMBus stuff, we might need to implement a fake SMB0 device and put there the SMRD method as Apple does with the hope it will not block it...
AFAIK I can test only on Lion DP1, dunno how diff is ACPIPlatform b/w DP1 and GM.

L.E. Tested and is not/will not work ever on Lion.
I even tested latest apple code from mbair and it prints same errors when debug=0xffff, so the code is still there for other OS but not Lion.
Only thing they care is to find the SMB0 device with 0x0f status, rest is driver job...

It is a very good solution for Snow but that's it, as far I can see Apple will not allow anything on SMBus within ACPI, or they rushed things, or the plan was to break it.

So, that return us to the original driver fix, :)

#24
robi62

robi62

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 264 posts
  • Gender:Male
  • Location:Javea Spain
Hi I tried you next and now it show in system info but although it show time left of batteryon menu it shows 0% left

this is system info

Battery Information:

Model Information:
Serial Number: Unknown-Unknown
Charge Information:
Charge Remaining (mAh): 2960
Fully Charged: No
Charging: No
Full Charge Capacity (mAh): 0
Health Information:
Cycle Count: 0
Condition: Normal
Battery Installed: Yes
Amperage (mA): -1712
Voltage (mV): 10838

System Power Settings:

AC Power:
System Sleep Timer (Minutes): 0
Disk Sleep Timer (Minutes): 0
Display Sleep Timer (Minutes): 24
Automatic Restart on Power Loss: Yes
Wake on Clamshell Open: Yes
Wake on LAN: Yes
Display Sleep Uses Dim: Yes
PrioritizeNetworkReachabilityOverSleep: 0
RestartAfterKernelPanic: 157680000
Battery Power:
System Sleep Timer (Minutes): 10
Disk Sleep Timer (Minutes): 0
Display Sleep Timer (Minutes): 10
Wake on Clamshell Open: Yes
Current Power Source: Yes
Display Sleep Uses Dim: Yes
Reduce Brightness: Yes
RestartAfterKernelPanic: 157680000

Hardware Configuration:

UPS Installed: No

AC Charger Information:

Connected: No
Charging: No

where should Iput the fix in my dsdt????


I tried a few time with your fix and bbc9 ones but I get error all the time
At least is an improvement getting info in system profiler ;)

An update change kext infoplist to false now showing percentage but lost system info

At least coconut and istat show battery info

#25
robi62

robi62

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 264 posts
  • Gender:Male
  • Location:Javea Spain
Gsly here are the files you asked me at Project Osx

Attached File  dsdt.aml.zip   14.03KB   11 downloads

Attached File  kernelog.zip   1.86KB   4 downloads


Thanks

#26
weizh126

weizh126

    InsanelyMac Protégé

  • Members
  • PipPip
  • 64 posts

NIXin/JBraddock, I confirmed my suspicion about just renaming the class files to get some of the 3rd party software to work. XCode's refactoring is {censored} so I had to rename the classes and a LOT of other stuff in the project to enable me to build "AppleSmartBatteryManager" vs. "AppleACPIBatteryManager". After removing the latter and installing the former, I was able to see data in iStat (unhacked) and coconutBattery as you can see:



EDIT: Added compiled versions for the renamed driver in original post.


Hi gsly, I've modified the source code of AppleACPIBatteryManager to enable it in 64 bit mode and it works perfect, but I don't quite understand how to change the AppleACPIBatteryManager to the AppleSmartBatteryManager, and I just rename every classes name, and build it without any error, but the OSX do not load it. The source is attached below. I am really appreciated if you get some time to fixed it out.
Thanks
Attached File  AppleACPIBatteryManager.zip   62.28KB   30 downloads

#27
NIXin

NIXin

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 114 posts
  • Gender:Male
  • Location:Krakow, Poland
Any progress on the project?
Good luck and keep up the great work ;)

#28
gsly

gsly

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 142 posts
  • Gender:Male
  • Location:The Great White North

Any progress on the project?
Good luck and keep up the great work :(

I haven't had a lot of time the past few weeks. I'm in the middle of 2 streams, the first one is doing some dis-assembly/debugging to see what Apple changed in the ACPI platform driver that causes previous code to fail. (There is more to it than just the EC access others have found). The second stream is looking into getting the native battery driver to work, or to just build the missing SMBusController controller class that Apple does not provide the source to in order to build the Apple SmartBattery driver.

#29
gsly

gsly

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 142 posts
  • Gender:Male
  • Location:The Great White North
I made some progress last night on the Lion issues, and surprise surprise, it looks like its another bug in HP's code not mine ;)

It appears that the new Apple ACPI platform kext for 10.7.x installs exception handlers on the ACPI methods/devices and bugs that were previously ignored in 10.6 are being caught in 10.7. It also appears they are using the ACPICA AML parser (psparse) so I might be able to use those tools to hunt down any other DSDT bugs as well, although its unknown what version Apple is using...

Anyway, the issue is in the SMRD (SMBus Read) method as seen in this ACPI parsing stack error trace:

ACPI Exception: AE_BAD_PARAMETER, Returned by Handler for [EmbeddedControl] (...)
ACPI Error (psparse-0632): Method parse/execution failed [\_SB_.PCI0.LPCB.EC__.SMRD] (...), AE_BAD_PARAMETER
ACPI Error (psparse-0632): Method parse/execution failed [\_SB_.BAT0.UPBX] (...), AE_BAD_PARAMETER
ACPI Error (psparse-0632): Method parse/execution failed [\_SB_.BAT0._BIX] (...), AE_BAD_PARAMETER
AppleSmartBatteryManager::getBatteryBIX: evaluateObject error 0xe00002bc

As you can see, _BIX calls UPBX that calls SMRD that fails. As SMRD is a fundamental function that wraps the various protocols and returns from the SMBus, it causes all of the calls to the Smart Battery System (SBS) to fail and eventually the evaluateObject() call in the battery kext fails as you can see here:

Attached File  Lion_ACPI_Error.jpg   227.07KB   56 downloads

Now I just have to debug HP's code :)

#30
THe KiNG

THe KiNG

    InsanelyMac Legend

  • Gurus
  • 674 posts
  • Gender:Male

i change smw0 that have 16 bit value to 8 bite and and add this to SMRD section:

How long it will take until you will realize we discuss here a different driver and the goal is to use EC's SMBus method instead EC's battery registers that you are trying to mix?

#31
Cyrus the Great

Cyrus the Great

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 276 posts
  • Gender:Male
  • Location:tehran

How long it will take until you will realize we discuss here a different driver and the goal is to use EC's SMBus method instead EC's battery registers that you are trying to mix?

i know this post is about what.know need to you speak Discourteous with me.
i have limited knowledge i know but i don't need to you Remind me it in this way.
this is just report about what i doing and result .
nobody force you to read my post and answer to it.
i suggest when you see my name above a post just skip it .

#32
gsly

gsly

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 142 posts
  • Gender:Male
  • Location:The Great White North
Yes! Got it working in Lion 10.7 (GM) although I don't see why I had to do this after re-reading the ACPI SMBus specifications and looking at a MacBookPro6,1 functionality again.

Anyway, as previously reported by bcc9, the Apple ACPI platform device driver throws an exception if any of the registers in the EC are accessed using anything other than byte access (8-bit). As the SMBus is accessed through the EC, we must also use byte access even though the SMBus specification allows 16-bit word access.

So I rewrote the portions of the SMBus Read/Write (SMRD/SMWR) methods that read/write SMBus Words and Blocks (Strings) to do it via bytes (8-bit) and now all of the existing battery methods work again, allowing the driver to work again as you can see:

Attached File  Screen_Shot_2011_09_17_at_2.15.07_PM.png   1.25MB   138 downloads

I still need to see why the driver isn't loading on boot (might be my Lion install) and clean up some debugged and do a little more testing so hang in there for a bit more!

#33
Cyrus the Great

Cyrus the Great

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 276 posts
  • Gender:Male
  • Location:tehran

Yes! Got it working in Lion 10.7 (GM) although I don't see why I had to do this after re-reading the ACPI SMBus specifications and looking at a MacBookPro6,1 functionality again.

Anyway, as previously reported by bcc9, the Apple ACPI platform device driver throws an exception if any of the registers in the EC are accessed using anything other than byte access (8-bit). As the SMBus is accessed through the EC, we must also use byte access even though the SMBus specification allows 16-bit word access.

So I rewrote the portions of the SMBus Read/Write (SMRD/SMWR) methods that read/write SMBus Words and Blocks (Strings) to do it via bytes (8-bit) and now all of the existing battery methods work again, allowing the driver to work again as you can see:

Attached File  Screen_Shot_2011_09_17_at_2.15.07_PM.png   1.25MB   138 downloads

I still need to see why the driver isn't loading on boot (might be my Lion install) and clean up some debugged and do a little more testing so hang in there for a bit more!

thanks.
i am currently use your smart battery driver it load without problem in lion.i try many time to fix 16 bit in ec and smrd but without success .i am waiting for your dsdt fix to find my mistake.(the university of hakintosh)

#34
nobb1x

nobb1x

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 331 posts
  • Location:Italy
i got it working on my acer laptop, it use a different access to the battery (no smbus)
i have some bugs still to sort, no time to discharge but working percentage and i get an "error collecting informations" on energy tab of sysinfo.
just dsdt job to make it working, i include mine, original and after the mod for someone who want to look at it and enhance. just run a diff to see what changed.
i'm not available for assistance, so pls do not IM, all i know is here.
i'm using the acpi version of the kext with:
UseExtendedBatteryInformationMethod=false
UseExtraBatteryInformationMethod=false

Attached File  dsdt_ec_8bit.zip   73.15KB   34 downloads

#35
THe KiNG

THe KiNG

    InsanelyMac Legend

  • Gurus
  • 674 posts
  • Gender:Male

Yes! Got it working in Lion 10.7 (GM) although I don't see why I had to do this after re-reading the ACPI SMBus specifications and looking at a MacBookPro6,1 functionality again.

Great news!
Waiting to see the new SMBus read/write methods, it may save my time implementing PECI access withing ACPI :(

#36
NIXin

NIXin

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 114 posts
  • Gender:Male
  • Location:Krakow, Poland
Indeed awesome news!
:jester:
Can I buy you a beer gsly? ;)

#37
Jingu

Jingu

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 119 posts
gsly,

I'm using MacBookPro6,2 identifier for My Asus Core i7 notebook.

Looks like My Asus Notebook uses an ACPI Battery control method:

Posted Image



But, it's using ACPI 2.0

Posted Image



Not sure I can use your ACPI 3.x/4.x method.

Also, what is your device SMRD? I don't seem to have it at all in my dsdt.

#38
Komano

Komano

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 175 posts
Waiting on this gsly! :rolleyes:

#39
dgrx

dgrx

    InsanelyMac Protégé

  • Donators
  • 75 posts
  • Gender:Not Telling
Nice work gsly :rolleyes:

Eagerly awaiting a release :D

#40
gsly

gsly

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 142 posts
  • Gender:Male
  • Location:The Great White North

Great news!
Waiting to see the new SMBus read/write methods, it may save my time implementing PECI access withing ACPI ;)

They should be transferable to any system that uses an SMBus written to the standard with the exception of the timing bits. Note the HP functions do a brute force retry/sleep loop that doesn't look ideal, but perhaps the SMBus chipset is that unreliable :(



Indeed awesome news!
:)
Can I buy you a beer gsly? ;)

I never turn down free beer NIXin ;)

See original post for the new methods. Hopefully you can follow what I did and update the auto-patcher library. There may be some things I renamed, modified from the stock BIOS but you'll figure it out (let me know!)




gsly,

I'm using MacBookPro6,2 identifier for My Asus Core i7 notebook.

Looks like My Asus Notebook uses an ACPI Battery control method:
...
But, it's using ACPI 2.0
...
Not sure I can use your ACPI 3.x/4.x method.

Also, what is your device SMRD? I don't seem to have it at all in my dsdt.

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.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy