PPCGeeks Forums HTC Arrive HTC HD2 HTC Thunderbolt HTC Touch Pro 2 HTC Evo 4G HTC Evo 3D Samsung Galaxy S II Motorola Droid X Apple iPhone Blackberry
Go Back   PPCGeeks > Windows Mobile > WM HTC Devices > HTC Touch Pro 2 > Android On TP2
Register Community Search

Notices


Reply
 
LinkBack Thread Tools Display Modes
  #31 (permalink)  
Old 06-01-2010, 11:45 PM
Unknownforce's Avatar
PPCGeeks Regular
Offline
Pocket PC: HTC Evo 3D™
Carrier: Sprint
Threadstarter
 
Join Date: Nov 2008
Posts: 234
Reputation: 545
Unknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuff
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Battery Meter and Temp reading "Fix" (workaround)

Quote:
Originally Posted by obrienmd View Post
Unknown - looks like it's working, can you update to latest zImage? Do you turn off debug, like the balsat.hopto.org zImages? These non-debug kernels improve speed for me.
I haven't changed anything in my builds other than what I specified already, so unless it's disabled by default, then no it's not off. I can look into turning it off, but right now, I don't have the time. I at least updated to the latest zImage for now.
__________________

Phone: Sprint HTC EVO 3D
ROM: Synergy Nightly with Own Mods
"If you have the stereo on, why would you turn up the volume on the TV?" 'Cause I like to party
Reply With Quote
This post has been thanked 1 times.
  #32 (permalink)  
Old 06-02-2010, 02:04 PM
sovereignty03's Avatar
Lurker
Offline
Pocket PC: Tilt 2
Carrier: AT&T
 
Join Date: Mar 2009
Posts: 13
Reputation: 50
sovereignty03 is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Battery Meter and Temp reading "Fix" (workaround)

Quote:
Originally Posted by Unknownforce View Post
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... This has ONLY been tested on MY OWN Sprint Touch Pro 2... I cannot guarantee it will work on ANY other device including other sprint tp2's.. I just know that it works on MY device... so I figured I'd share it...

Thirdly... 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)

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.

The zImage includes all zImage updates including the one from today ( 5/29/10 )

Here's the link:

http://www.mediafire.com/?sharekey=2...ecd7d091ba63d2
Where does one get the source htc_battery_smem.c for the calculations? Where is it located in the tree while in android? I was curious about the calculations to see where the accuracy problem is. Does it have to do with temperature compensation? That right there would probably be different than the Raphael... I am using the latest stuff from Reefermattness along with your workaround and it is working so far, just not accurate.

Using Tilt2...

EDIT: Just tried a find in Terminal Emulator and didn't get a result

Last edited by sovereignty03; 06-02-2010 at 02:10 PM.
Reply With Quote
  #33 (permalink)  
Old 06-02-2010, 03:28 PM
Unknownforce's Avatar
PPCGeeks Regular
Offline
Pocket PC: HTC Evo 3D™
Carrier: Sprint
Threadstarter
 
Join Date: Nov 2008
Posts: 234
Reputation: 545
Unknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuff
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Battery Meter and Temp reading "Fix" (workaround)

Quote:
Originally Posted by bhuggins View Post
Where does one get the source htc_battery_smem.c for the calculations? Where is it located in the tree while in android? I was curious about the calculations to see where the accuracy problem is. Does it have to do with temperature compensation? That right there would probably be different than the Raphael... I am using the latest stuff from Reefermattness along with your workaround and it is working so far, just not accurate.

Using Tilt2...

EDIT: Just tried a find in Terminal Emulator and didn't get a result
The source is here: http://gitorious.org/linux-on-qualco...battery_smem.c

What I changed is the static int function called htc_rhod_batt_corr here: http://pastie.org/989450

All I really did was use a little common sense, when the topaz fix was released, I looked at the code that was changed, and basically just did a little testing. I set it to think that it was a topaz, which made the battery report 100 all the time, Then I noticed that the mV readings were way off, so I just adjusted the numbers to get it to show that number to be a little closer to accurate, and in doing this, I discovered that the battery level would also show somewhat close to accurate because apparently the current code seems to directly relate the two (battery % and mV readings) As such, when you plug your phone in, the %age jumps WAY up because the mV readings increase dramatically. I've been thinking about writing some kind of stabilization code to lower the % reading based on status of charging and the increase in mV readings to help stabilize the %age number, but it's been so long since I've done any type of these kinds of Mathematics, I have to do much testing in order to get a proper table in which to write some formula to correctly stabilize it...

Something like if charging = 1 and mV = a certain range, than adjust the % reading to xyz.. But this would only be a "workaround" for another workaround. what we really need are the exact calculations from the battery driver itself. I'm slowly learning ARM ASM to accomplish this, but I've been working 2 jobs, so when I get in the "groove" so-to-speak, it gets interrupted and I have to re-start my train of thought from the beginning... it's very frustrating...

Last edited by Unknownforce; 06-02-2010 at 04:46 PM.
Reply With Quote
This post has been thanked 2 times.
  #34 (permalink)  
Old 06-02-2010, 06:43 PM
sovereignty03's Avatar
Lurker
Offline
Pocket PC: Tilt 2
Carrier: AT&T
 
Join Date: Mar 2009
Posts: 13
Reputation: 50
sovereignty03 is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Battery Meter and Temp reading "Fix" (workaround)

Quote:
Originally Posted by Unknownforce View Post
The source is here: http://gitorious.org/linux-on-qualco...battery_smem.c

What I changed is the static int function called htc_rhod_batt_corr here: http://pastie.org/989450

All I really did was use a little common sense, when the topaz fix was released, I looked at the code that was changed, and basically just did a little testing. I set it to think that it was a topaz, which made the battery report 100 all the time, Then I noticed that the mV readings were way off, so I just adjusted the numbers to get it to show that number to be a little closer to accurate, and in doing this, I discovered that the battery level would also show somewhat close to accurate because apparently the current code seems to directly relate the two (battery % and mV readings) As such, when you plug your phone in, the %age jumps WAY up because the mV readings increase dramatically. I've been thinking about writing some kind of stabilization code to lower the % reading based on status of charging and the increase in mV readings to help stabilize the %age number, but it's been so long since I've done any type of these kinds of Mathematics, I have to do much testing in order to get a proper table in which to write some formula to correctly stabilize it...

Something like if charging = 1 and mV = a certain range, than adjust the % reading to xyz.. But this would only be a "workaround" for another workaround. what we really need are the exact calculations from the battery driver itself. I'm slowly learning ARM ASM to accomplish this, but I've been working 2 jobs, so when I get in the "groove" so-to-speak, it gets interrupted and I have to re-start my train of thought from the beginning... it's very frustrating...
Did you do any tweaking in the function "GetBatteryDischargeLevel"? It looks like this is where the accuracy might be corrected...still looking through the code, though

Last edited by sovereignty03; 06-02-2010 at 06:46 PM.
Reply With Quote
This post has been thanked 1 times.
  #35 (permalink)  
Old 06-03-2010, 12:07 AM
Unknownforce's Avatar
PPCGeeks Regular
Offline
Pocket PC: HTC Evo 3D™
Carrier: Sprint
Threadstarter
 
Join Date: Nov 2008
Posts: 234
Reputation: 545
Unknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuff
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Battery Meter and Temp reading "Fix" (workaround)

I changed nothing else other than the function I mentioned.
Reply With Quote
  #36 (permalink)  
Old 06-04-2010, 05:43 PM
Unknownforce's Avatar
PPCGeeks Regular
Offline
Pocket PC: HTC Evo 3D™
Carrier: Sprint
Threadstarter
 
Join Date: Nov 2008
Posts: 234
Reputation: 545
Unknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuff
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)

Updated today with a charging meter reading "fix." Same link, see first post for details and explanation.
Reply With Quote
  #37 (permalink)  
Old 06-04-2010, 06:43 PM
sovereignty03's Avatar
Lurker
Offline
Pocket PC: Tilt 2
Carrier: AT&T
 
Join Date: Mar 2009
Posts: 13
Reputation: 50
sovereignty03 is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)

Quote:
Originally Posted by Unknownforce View Post
Updated today with a charging meter reading "fix." Same link, see first post for details and explanation.
Hey man, I've been looking into the source, but haven't had time to set my system up to compile and test on my phone. If you don't mind, please try this: Look in htc_battery_smem.c for the line that reads "If ( av_index > 1347 )". Try changing that to "If ( av_index > 1500 )". The next line needs to be changed from "av_index = 1347" to "av_index = 1500". Just see what it does. The Raphael has a 1340mAh battery and the Rhodium has a 1500mAh battery. This is only a start as I see there also needs to be some changes in the scaling. When I have a chance, I am going to try to figure out some of the mV values that need to be put into "GetBatteryDischargeLevel". Just for test on the Rhodium, those values can be changed, but it will break the Raphael side. If the values are found to be good, then there needs to be some other stuff done to add the extra batt_vendor...

I'm gonna try your new stuff ASAP...

EDIT: later realized this is not what av_index is for...

Last edited by sovereignty03; 06-22-2010 at 11:53 AM.
Reply With Quote
This post has been thanked 1 times.
  #38 (permalink)  
Old 06-04-2010, 06:44 PM
sovereignty03's Avatar
Lurker
Offline
Pocket PC: Tilt 2
Carrier: AT&T
 
Join Date: Mar 2009
Posts: 13
Reputation: 50
sovereignty03 is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)

Oh, and sorry about the name change. I was bhuggins. I didn't want that showing so I asked the admins to change it to what I usually use, which is sovereignty
Reply With Quote
  #39 (permalink)  
Old 06-04-2010, 07:45 PM
dunebuggydude11's Avatar
Regular 'Geeker
Offline
Pocket PC: Evo 4G
Carrier: Sprint
Location: Irvine
 
Join Date: May 2008
Posts: 281
Reputation: 530
dunebuggydude11 knows their stuffdunebuggydude11 knows their stuffdunebuggydude11 knows their stuffdunebuggydude11 knows their stuffdunebuggydude11 knows their stuffdunebuggydude11 knows their stuff
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)

what is the "1.0" file for? it says it is a "0 File (.0)" is it supposed to be the modules.....file? thx
__________________
Evo 4G - Gingerbread CM7 / Deck's 2.3.3
Reply With Quote
  #40 (permalink)  
Old 06-05-2010, 12:23 AM
samjer111's Avatar
Lurker
Offline
Pocket PC: Touch Pro 2
Carrier: Sprint
 
Join Date: Jan 2007
Posts: 1
Reputation: 0
samjer111 is a n00b
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)

Thanks man. Keep up the Great work.
Reply With Quote
Reply

  PPCGeeks > Windows Mobile > WM HTC Devices > HTC Touch Pro 2 > Android On TP2


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 05:11 PM.


Powered by vBulletin® ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0
©2012 - PPCGeeks.com