Jump to content

Superhai, DiaboliC and the PowerManagement saga


Netola
 Share

14 posts in this topic

Recommended Posts

Hello Superhai and Diabolic.

Its great to see your success to fix the powermanagement.bundle with the right hex numbers to reflect the real battery status ;)

 

Thank you very very much Superhai. Diabolic is right, u're OSX god, lol.

 

Ive changed the powermanagement to the one that you sent to DiaboliC, and surprise, his config is almost equal mine! So now my battery icon is changing when AC or not, charging/not, etc. Buuut, his config and the powermanagement that you have compiled is slightly different from mine...

 

I think ive got the logic in the battery status with the IORegistryExplorer and now Ill show you my results:

 

 

AC: 100% fully charged

0x80

0x0

0xfa0

0x39d0

 

On AC charging: (0% to 99%):

0x82

0x0

0% 0x0 / 50%: 0x7d0 / 99%: 0xf78

0x39d0

 

 

============

 

 

 

On Battery (11% to 99%):

0x1

0x0

95%: 0xed8 94%: 0xeb0 93%: 0xe88 92%: 0xe60 91%: 0xe38 90%: 0xe10

89%: 0xde8 88%: 0xdc0 87%: 0xd98 86%: 0xd70 85%: 0xd48 84%: 0xd20

83%: 0xcf8 82%: 0xcd0 81%: 0xca8 62%: 0x9b0 61%: 0x988

53%: 0x848 52%: 0x820 51%: 0x7f8 50%: 0x7d0 41%: 0x668

16%: 0x280 15%: 0x258 14%: 0x230

0x39d0

 

On Battery Low (10% to 1%-):

0x9

0x0

10%: 0x190 9%: 0x168 8%: 0x140 6%: 0xf0 and finally 1%: 0x28

0x39d0

 

On battery (0% - empty):

0xd

0x0

0x0

0x39d0

 

 

 

Ok, the number 2 goes from 0 (0%) to 4000 (100%) in decimal or simply 0x0 (0%) to 0xfa0 (100%) in hex, right?

 

I cant measure the first number when On Battery 100% (I think its 0x1 too), because my battery drops to 99% instantly after I unplug my cable. Anyway, I dont know if this is important or not.

 

The fact is that the new powermanagement compiled to diabolic solved the most part of my issues, but not all of them. Well, we only have to recompile the powermanagement reflecting exactly my numbers, and voyla! :)

 

Superhai, I dont want to disturb you and I know that you do what you do for pleasure and for free (what is admirable). So, if you want I can compile my own powermanagement (just send me the source), or if your prefer, you can compile it for me. Its up to you... :P

 

Just to finish, maybe on a near future you can compile different versions of PowerManagement.bundle according to the notebook series.So, we could have "Powermanagement.bundle for Dell, for Toshiba, for Acer, for HP, etc". Well, maybe its just an idea to include on future distros of OSX.

 

Sorry for my poor english (im from italy and brazil) and keep up the good work fellas :(

Link to comment
Share on other sites

What kind of laptop is this on? And what features are you missing? Your amperage value shows 0 so it is hard to tell how much current your pc is drawing. That value is required to calculate time remaining. I guess that is what you miss. You also have a very constant voltage value so I think that is just hardcoded.

 

There shouldn´t be necessary with different powermanagement.bundles for different brands.

Link to comment
Share on other sites

What kind of laptop is this on? And what features are you missing? Your amperage value shows 0 so it is hard to tell how much current your pc is drawing. That value is required to calculate time remaining. I guess that is what you miss. You also have a very constant voltage value so I think that is just hardcoded.

 

There shouldn´t be necessary with different powermanagement.bundles for different brands.

 

When the battery is fully charged the icon is not a lightning bolt (remains as if its charging, with a plug inside).

When im charging battery the icon in SlimBattery Monitor remains green (not orange, the color of charging) and the standard battery icon give me the message "Battery is not charging". Of course the battery charges but the system doesnt recognize it...

 

As you know my time remaining dont work too (is there any other way to discover my amperage? even if its hard...).

 

Im now using your AppleSMBios and finally my system shows both cores and right bus speed. My xbenchs marks improved a lot :P

 

My config:

TOSHIBA Satellite A135-S4527, Intel Core Duo T2080, 1 GB RAM, Vid:eo: Intel 945GM, Audio: Intel 82801G (works with Azalio Audio), Wireless: Atheros, Lan: Realtek.

 

Everything works fine, except for: Audio Input, Microphone, Brightness Control (fn+f6 or f7), Sleep and Fans. To turn on the laptop fans I have to plug or unplug the power cable after the temperature reachs 46+ Celsius Degrees. A reboot works to start the fans too...

This is a very strange problem, I read carefully the All Fans Issues/Overheating posts but didnt find any real solution to this.

 

Thank you for your answer, Superhai.

:)

Link to comment
Share on other sites

Hey Netolas,

 

Nice to see that OSX86 sruff for our S4527 are getting better.

 

I see that you are from Brazil, right? If you use MSN Messenger please add me buddy:

 

bernardfbs@hotmail.com

 

 

Superhai,

 

We still have the fans issue. Really don't know how to manage this situation.

 

Thanks for all the effort ;)

Link to comment
Share on other sites

  • 1 month later...

Superhai, the APCIBattery.kext is amazing. Works great on my system, almost. I am on an HP dv2617us with a 6 cell Lithium-ion battery. I am running retail 10.5.4. I have two small problems:

 

1. Time remaining never calculates in the battery in the menu bar. I get the ACPIBatteryPowerSource: Estimated time remaining (norate) 29 in dmesg (so it seems to work by the way).

 

2. The computer does not go to sleep automatically while on battery. On power, it goes to sleep automatically fine. I assume this is part of the calculating problem. I tried removing the rate calculations from the source code (only the part that does the (norate)), but still no automatic sleep.

 

Any ideas on what should be modified? Thanks again for the great work.

Link to comment
Share on other sites

Superhai, the APCIBattery.kext is amazing. Works great on my system, almost. I am on an HP dv2617us with a 6 cell Lithium-ion battery. I am running retail 10.5.4. I have two small problems:

 

1. Time remaining never calculates in the battery in the menu bar. I get the ACPIBatteryPowerSource: Estimated time remaining (norate) 29 in dmesg (so it seems to work by the way).

 

2. The computer does not go to sleep automatically while on battery. On power, it goes to sleep automatically fine. I assume this is part of the calculating problem. I tried removing the rate calculations from the source code (only the part that does the (norate)), but still no automatic sleep.

 

Any ideas on what should be modified? Thanks again for the great work.

 

1. I wrote it for someone, and asked him to test that, but he never replied. But I can make a modification so it should work (edit: try the new now). It is because your ACPI is not providing the battery usage rate for some reason.

2. If your computer dont go to sleep, you should check your energy profile.

 

You need also the stock PowerManagement.bundle (not any modified).

Link to comment
Share on other sites

Hmmm.

 

Looks like tr is a bit random. I am getting

 

Aug  1 00:42:37 Schemes-HP-Pavilion kernel[0]: ACPIBatteryPowerSource: Estimated time remaining (norate) 259 
Aug  1 00:43:36 Schemes-HP-Pavilion kernel[0]: ACPIBatteryPowerSource: Estimated time remaining (norate) 276 
Aug  1 00:43:36 Schemes-HP-Pavilion kernel[0]: ACPIBatteryPowerSource: Estimated time remaining (norate) 24 
Aug  1 00:43:37 Schemes-HP-Pavilion kernel[0]: ACPIBatteryPowerSource: Estimated time remaining (norate) 4320

 

Calculating still is not working unfortunately. You added the

 

if (tr) setTimeRemaing(tr);

 

but I still get "Calculating," which is weird.

 

The setting for sleep in energy preferences are set correctly. I have however realized that it might not be related to the battery kext. I seems that the computer goes to sleep eventually when on the adapter instead of the assigned time. I might be the same for the battery, I just have not left it long enough. It is probably then some daemon or something running in the background causing the auto sleep function to fail.

 

Update: I just disabled time machine, and it seems that on adapter, the computer goes to sleep on time now, however still no luck with the the battery. I will test this for the next few weeks and see what happens. If you can't see a way to get the Calculating to work for norate batteries, I'll see if I can play with the code to get it to work for me. I however have no idea how the battery library works. Thanks again man, great work.

Link to comment
Share on other sites

So I removed the norate calculation bit from the source and the computer now goes to sleep on Battery without trouble. The time remaining calculation for no rate seems fine (when monitor is off tr=4200 or something that ridiculous dues to low power consumption, when monitor is on tr=220-270 if battery is full, which is reasonable), but for some reason (probably the logging of it) it causes the computer to not go to sleep.

 

Thanks again man and awesome work.

Link to comment
Share on other sites

I´ll check some sources in xnu or powermanagement.bundle if there are certain factors that block sleeps when battery is calculating or fluctuating, it could be that it tries to protect the computer when it thinks it has not enough juice for sleeping safely.

 

The time remaining calculation is very simple, it just compare the remaining rate a minute ago and the delta with the current remaining rate, gives a rate during that minute. I think I know how to fix it, because pm.bundle shows calculating when either wrong sign, or if averagerate is outside certain values above or below the value of the currentrate. The clue is to ensure that when there is no rate that the values calculated are within that window.

Link to comment
Share on other sites

So I removed the norate calculation bit from the source and the computer now goes to sleep on Battery without trouble. The time remaining calculation for no rate seems fine (when monitor is off tr=4200 or something that ridiculous dues to low power consumption, when monitor is on tr=220-270 if battery is full, which is reasonable), but for some reason (probably the logging of it) it causes the computer to not go to sleep.

 

Try now and see if 1.1.3 fixes the calculating.

Link to comment
Share on other sites

My laptop is back to life and I am trying your new ACPIBattery. Unfortunately it looks like there is still no sleep on battery and it still just says "Calculating". I'll look into it more this week, but thanks for all your hard work Superhai.

Link to comment
Share on other sites

  • 4 weeks later...
My laptop is back to life and I am trying your new ACPIBattery. Unfortunately it looks like there is still no sleep on battery and it still just says "Calculating". I'll look into it more this week, but thanks for all your hard work Superhai.

 

 

Superhai-- I just got looking at OSX again and I installed JAS 10.5.4. I used your ACPIbattery.kext and its great except I suffer from the same fate as memorial after trying your newest version. Mine never calculates the time remaining. I never used to care but it would be cool if it worked. I am also wondering if the features under battery options work? Those are: slightly dim the display when using this power source & slightly dim display before display sleep. I never noticed that before on my old powermangement kext and ACPIplatform setup. Do those work or are they only a dream on a hack?

 

Thanks for all the hard work. You have great approaches to these problems. Now if only we could get someone to work on ALC862 and my BCM5906 Id be set.

Link to comment
Share on other sites

  • 3 months later...
 Share

×
×
  • Create New...