|
||||
Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
Just thought I'd share this here...
First and Foremost. This is NOT supported by the Devs... NOR am I a Dev... This is simply a modification of the code that generates the zImage file. (specifically the file htc_battery_smem.c) Secondly... It's not dead accurate, it's using some of the calculations from the raphael's battery calculations... I have been told by one of the devs that the rhodium calculates battery life much differently, so I will say that this isn't supposed to be a REAL fix, just a temporary workaround. OK, now that all that is out of the way... here's somewhat of a "fix" for the Battery meter for the SPRINT CDMA TP2 RHODIUM (At least that's all I've tested it on, I have heard that it also works with the Tilt 2 and other "rhodium" devices, but I can't confirm that) It's the same zImage as all the others with just a single modified source file compiled in. So all you have to do is copy it over the zImage file you currently have and run android like normal. 6/4 UPDATE As you may have noticed... when you plug your phone in the battery meter jumps WAY up... well I have done a slight modification to the code to have it show something a Little more accurate... (only slight testing done) Basically what I did was make it check to see if it's charging, if it is, it does less of a calculation based on the mV reading... It's not perfect, but it's much closer to accurate when charging now, And what I did was make it so that it's a few percent HIGHER than the actual reading, so hopefully (and I don't know for certain) it will think it's at 100% when it's more like 95 ish then it will stop charging the battery and it won't keep charging and possibly do damage... as I said, I've only done some slight testing with this... but I figured I'd post it and get some feedback... My next thing is to figure out how to stabilize the battery meter so that it doesn't fluctuate as much, As an example, the percentage should never go UP when the phone is not charging, and it does... and also when you're actually using the phone for something that's got a drain on the battery, the percentage drops a lot because the mV reading drops when it's under load, So I have to try to figure out how to add in some calculation to incorporate current load so that it doesn't drop dramatically when you're online or something... But back to the fix at hand here... You'll notice that at first when you plug it in, the % drops a bit, this is because the mV reading does not increase immediately, give it a minute or so and you will notice it start to climb back up as the mV reading increases. The inverse is also the same, in that when you unplug it AFTER charging for a bit, the % will spike for a bit, the mV reading will start to drop and it will stabilize in a minute or so. 6/22 UPDATE I added a tiny bit of stabilization code. It's not much, and it isn't changing any calculations, so no more "real" accuracy, but just more to stabilize the battery value when it's under different loads. What I did was give it a place to store a "previous" value, then compare it to the "current" value, and if it's more than 1 % different, stick with the previous value, but if it's more than 10% different, use the current value. (This is necessary for bootup and for charging times when it changes so dramatically that the previous value will always be used because it's more than 1% all the time) This should hopefully stabilize it a little further, but might need to be tweaked a bit, consider this a "BETA" of this code. I'm probably going to incorporate a little more math into this, because this is quite basic right now, but perhaps averaging values and pulling a value using both the previous and current values... But I haven't the time to sit down and really think about this right now... I have left the 6/17 up just in case it works better. The next thing I'm going to do is to make it never INCREASE in percentage if the battery isn't charging, this is easy to do, but I am busy right now, and this is all I could come up with for now. As with the last change, I also made the change apply to all devices (not just the rhodium) but I don't know that it's a problem on other devices, but figured it wouldn't hurt to add it as most people here are using the rhodium anyways... I will gladly share the code if anyone wants to take a peek. The zImage includes all zImage updates located here including the ones from 6/14/10 Enjoy!
__________________
Phone: Sprint HTC EVO 3D ROM: Synergy Nightly with Own Mods Last edited by Unknownforce; 06-22-2010 at 05:02 PM. |
This post has been thanked 22 times. |
|
||||
Re: Battery Meter and Temp reading "Fix" (workaround)
Well as I said, it's not going to be dead accurate, because I don't know (noone knows for that matter, other than the real devs of the phone software) the correct calculations the rhodium "battery.dll" uses to calculate the exact battery life for windows mobile. I tried doing some reversing on it, but it's just a little over my head, I don't know asm well enough to follow and find the proper calculations, so I just started messing with numbers until it came out about right... and this seems to work.
It's more so that it at least reads "close" to what it should be... but I found it to be pretty damn close. When I talked to the dev, he discouraged my using the raphael calculations, but I figure... it's WAY better than it was before what with starting at like 40% and mostly being at 10% all the time... |
This post has been thanked 2 times. |
|
||||
Re: Battery Meter and Temp reading "Fix" (workaround)
well..I can say 100% Batt on Windows = 100% Batt on Andriod for me
and after 15 minute use, the battery meeter also drops a bit.... so far so GREAT. Last edited by mxl180; 05-18-2010 at 07:06 PM. |
|
||||
Re: Battery Meter and Temp reading "Fix" (workaround)
Wait so if what you say works but only the battery is the issue..can't we use the calculation nue2chem has for nuebattery2 for the TP2?
__________________
Earn some spare cash and get cash back at stores like NewEgg and more:
http://quickrewards.net/?r=!F94VXV35D5MV2 (My shameless referral link) |
|
||||
Re: Battery Meter and Temp reading "Fix" (workaround)
Battery workaround works pretty good man!! Nice job. Only problem I see so far is that I lose my WiFi if i use that zimage. GSM Tilt2(Rhod300) Battery works VERY close though.
__________________
Last edited by Reefermattness; 05-18-2010 at 10:31 PM. |
|
||||
Re: Battery Meter and Temp reading "Fix" (workaround)
Great job! I do have other things to worry about than keeping track of the battery level on my phone 4 my phone.
I can not turn on wifi after using this zimage. Tested on a Sprint Touch Pro 2 Now if only some one could get sound to work I would totally ditch WinMo. Last edited by gface2k; 05-18-2010 at 11:44 PM. |
|
||||
Re: Battery Meter and Temp reading "Fix" (workaround)
it works much better than other ones using UScell TP2 i can say that wifi dose not work and that the battery will bounce around 10% but it still works much much better
|
|
||||
Re: Battery Meter and Temp reading "Fix" (workaround)
I'm glad this works at least mostly right.
I have a extended battery for my RHOD500. I wonder if that calculates ok. The only other thing I worry about is charging still not stopping when at 100% or phone keeps from fully discharging causing power on and as some had on xda boot issues. |
|
||||
Re: Battery Meter and Temp reading "Fix" (workaround)
the battery meter seems to work...do we know why the gps doesnt? how bout gettting this battery "fix" added to the standard package? also how about the fix for the gps from the gps thread? cuz i assume im correct currently we lose these fixes everytime we update?
|
This post has been thanked 1 times. |
|
|
|