PPCGeeks

PPCGeeks (http://forum.ppcgeeks.com/index.php)
-   Android On TP2 (http://forum.ppcgeeks.com/forumdisplay.php?f=179)
-   -   Battery Meter and Temp reading "Fix" (workaround) (6/22 Update) (http://forum.ppcgeeks.com/showthread.php?t=121614)

hyperfire21 06-06-2010 06:24 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
is anyone having a problem with the market? i tried the two included files zimage and modules. i keep getting an error when trying to connect to the market. i'm using the 6/1 aosp android build.

it says: A server error has occurred. Retry, or cancel and return to the previous screen.

demonlordoftheround 06-06-2010 10:17 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by hyperfire21 (Post 1795926)
is anyone having a problem with the market? i tried the two included files zimage and modules. i keep getting an error when trying to connect to the market. i'm using the 6/1 aosp android build.

it says: A server error has occurred. Retry, or cancel and return to the previous screen.

It must be the market server was temporarily down because I haven't had any problems getting apps from Android Market.

kroewe 06-06-2010 05:04 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
markets all good for me on the same build...

now i am just dreaming of sound, camera, and 3d hardware support...
and a more stable rosie build...

hyperfire21 06-06-2010 07:07 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
are u using wifi to access the market? and are u sure ur using the zimage and modules files from the first post in this thread? i keep getting an error.. tried both the android 6/1 build from both the .rar and .cab and still no go

Update - actually the problem seems to be with the 6/1 build because i cant access the market with the included files

pyro254750 06-07-2010 02:36 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by hyperfire21 (Post 1797097)
are u using wifi to access the market? and are u sure ur using the zimage and modules files from the first post in this thread? i keep getting an error.. tried both the android 6/1 build from both the .rar and .cab and still no go

Update - actually the problem seems to be with the 6/1 build because i cant access the market with the included files

Im using the 6/1 build (cab installer) and the zImage file from the first post, but not the modules file (i have no idea what the modules file is for so i didnt download it). Everything works fine on my end with that combination, battery meter is much more accurate than previously, data and voice work fine, market works fine, and i have encountered zero errors. Been downloading apps and playing with the phone all morning with zero problems.

aldamon 06-07-2010 03:08 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Any chance you could just attach the file here instead of using Mediafire?

pyro254750 06-07-2010 03:27 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
1 Attachment(s)
Here you go: Attachment 71727

Unknownforce 06-07-2010 03:59 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by aldamon (Post 1799074)
Any chance you could just attach the file here instead of using Mediafire?

Done, and also updated with the latest from 6/6 (although the 6/6 modifications changed nothing for us rhodium users)

aldamon 06-08-2010 09:18 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by Unknownforce (Post 1799211)
Done, and also updated with the latest from 6/6 (although the 6/6 modifications changed nothing for us rhodium users)

Thank you. This mod made Android usable for me instead of a toy.

surge 06-08-2010 09:32 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by Unknownforce (Post 1799211)
(although the 6/6 modifications changed nothing for us rhodium users)

The 6/6 rootfs fixes GPS so it works with other apps.
I get satellite counts and speed readings with GPS apps.
Google Navigation also works great now.

NeoMatrixJR 06-10-2010 10:27 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
unknownforce, are you going to get these changes into the xdanadroid dev tree so we can see this on the regular builds?

Unknownforce 06-10-2010 10:57 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by NeoMatrixJR (Post 1806365)
unknownforce, are you going to get these changes into the xdanadroid dev tree so we can see this on the regular builds?

I can offer it to them, but it's up to them if they want to include it or not... I can't commit the changes myself as I'm not a dev. And as I said before one of the Dev's that I spoke with when I first started looking at this said that using the Raph's Battery calculations was not correct... So I'm not sure that they would commit the changes.

ylopez2007 06-10-2010 10:39 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
I copy the zImage over the zImage file that I currently have but there was no change. It keeps indicating that the battery is at 5% even though it says 60% in Windows Mobile. :(

sovereignty03 06-10-2010 11:23 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by ylopez2007 (Post 1807994)
I copy the zImage over the zImage file that I currently have but there was no change. It keeps indicating that the battery is at 5% even though it says 60% in Windows Mobile. :(

You have to copy the module file also....

And either rename your old module file to not have "module" prefix or just delete it

surge 06-12-2010 09:17 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Unknownforce,

Have you looked at Post #37 by sovereignty03?

He lists something to try which looks like it may give more accurate readings since the calculations you are using appear to be from a phone with lower capacity.

Unknownforce 06-14-2010 11:27 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by surge (Post 1810536)
Unknownforce,

Have you looked at Post #37 by sovereignty03?

He lists something to try which looks like it may give more accurate readings since the calculations you are using appear to be from a phone with lower capacity.

av_index is used for identifying the proper temperature being pulled from the temperature array listed in htc_battery_smem.h, There are 1347 entries in that array. This is why it says if the av_index is higher than this, than it would cause the battery to freeze because it's trying to pull a value beyond the size of the array.

It has no correlation to the battery capacity.

Trust me if it were that easy, the Devs would have already had it working long ago.

The calculations I am using are very close, but they are just not as accurate as they should be. And there ARE no calculations that keep the battery level STABLE under different discharge/load levels at the current time. In just what little I have gathered from my limited disassembly of the battery.dll, it looks like there are 2 different ways it calculates the battery based on whether or not it's discharging or charging, (which is kind of what I have done in the 6/4 update) and then inside that there's multiple battery percentages it stores... One is a "stabilized" reading, another is a "immediate" reading, and another I believe is used in the stabilizing process, most likely a "previous" percentage used to "average" the battery level... So probably the only thing left to do on this is to just stabilize the load to percentage ratio and give it a condition to NEVER go up in percentage if it's NOT charging. But the current code doesn't seem to take load into consideration very well.

drewcam888 06-14-2010 03:58 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Should I be deleting the old module.gz from my phone? Or do I just copy the attached modules file?

demonlordoftheround 06-14-2010 11:04 PM

Wirelessly posted (Mozilla/5.0 (Linux; U; Android 2.1; en-gb; HTC Legend Build/ERD79) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17)

Quote:

Originally Posted by drewcam888
Should I be deleting the old module.gz from my phone? Or do I just copy the attached modules file?

I put my old zimage and modules files into the my documents folder for saafe keeping in case I wanted to to go back. But this battery fix works pretty good.

sovereignty03 06-15-2010 06:39 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by Unknownforce (Post 1813951)
av_index is used for identifying the proper temperature being pulled from the temperature array listed in htc_battery_smem.h, There are 1347 entries in that array. This is why it says if the av_index is higher than this, than it would cause the battery to freeze because it's trying to pull a value beyond the size of the array.

It has no correlation to the battery capacity.

Trust me if it were that easy, the Devs would have already had it working long ago.

The calculations I am using are very close, but they are just not as accurate as they should be. And there ARE no calculations that keep the battery level STABLE under different discharge/load levels at the current time. In just what little I have gathered from my limited disassembly of the battery.dll, it looks like there are 2 different ways it calculates the battery based on whether or not it's discharging or charging, (which is kind of what I have done in the 6/4 update) and then inside that there's multiple battery percentages it stores... One is a "stabilized" reading, another is a "immediate" reading, and another I believe is used in the stabilizing process, most likely a "previous" percentage used to "average" the battery level... So probably the only thing left to do on this is to just stabilize the load to percentage ratio and give it a condition to NEVER go up in percentage if it's NOT charging. But the current code doesn't seem to take load into consideration very well.

Sorry...never updated my post. I realized what av_index is after looking into the code some more. You know, you are trying to do something about the increase while charging, but most devices I have used just display some type of animation while charging and then display the percentage again when it is unplugged.

About keeping stable under varying loads, There is a solution that uses the output impedance of the battery. I am in the (slow) process of compiling the data to plot a curve for the output resistance as a factor of battery temperature. If one knows this curve it is painless to calculate the correct percentage of charge. I'll share it with you when I get it done. I haven't had much time to dedicate to it yet...

Unknownforce 06-16-2010 11:37 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by sovereignty03 (Post 1817252)
Sorry...never updated my post. I realized what av_index is after looking into the code some more. You know, you are trying to do something about the increase while charging, but most devices I have used just display some type of animation while charging and then display the percentage again when it is unplugged.

Sure, it just shows the animation, but when you go into the spare parts and look at the battery percentage (without my latest release) it's at least 40% higher than it should be... This is why I manipulated the code to forcibly bring that number lower. Because of this, you can charge it a lot more accurately while charging with android. I set it to be a FEW percent higher than the reading android has while on discharge, so that it will hit 100% when it's more like 95-97 and, if the code is correct, STOP charging at that percent and not fry the battery or something.

WITHOUT this fix, it would ready 100% when it's more like 50-60% and not charge beyond that because it thinks it's are 100% because of the extreme increase in the voltage reading while on the charger.

Quote:

Originally Posted by sovereignty03 (Post 1817252)
About keeping stable under varying loads, There is a solution that uses the output impedance of the battery. I am in the (slow) process of compiling the data to plot a curve for the output resistance as a factor of battery temperature. If one knows this curve it is painless to calculate the correct percentage of charge. I'll share it with you when I get it done. I haven't had much time to dedicate to it yet...

The problem here is that I don't think it's reading the proper discharge values as WinMo does... WinMo I believe pulls the mA that's currently being discharged and uses it in it's calculations among the temp and voltage readings, now that COULD be calculated FROM the temp and voltage readings, but again, I don't know... I still haven't had much time to do much with the dll file and see exactly what's going on... and with my limited knowledge of ARM ASM... it's going to take quite some time... which is why I'm only guessing at numbers for now to at least get it CLOSE to what it should be reading.

sovereignty03 06-16-2010 11:53 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by Unknownforce (Post 1818454)
Sure, it just shows the animation, but when you go into the spare parts and look at the battery percentage (without my latest release) it's at least 40% higher than it should be... This is why I manipulated the code to forcibly bring that number lower. Because of this, you can charge it a lot more accurately while charging with android. I set it to be a FEW percent higher than the reading android has while on discharge, so that it will hit 100% when it's more like 95-97 and, if the code is correct, STOP charging at that percent and not fry the battery or something.

WITHOUT this fix, it would ready 100% when it's more like 50-60% and not charge beyond that because it thinks it's are 100% because of the extreme increase in the voltage reading while on the charger.

Ah, now I know why you are doing that. Good.



Quote:

Originally Posted by Unknownforce (Post 1818454)
The problem here is that I don't think it's reading the proper discharge values as WinMo does... WinMo I believe pulls the mA that's currently being discharged and uses it in it's calculations among the temp and voltage readings, now that COULD be calculated FROM the temp and voltage readings, but again, I don't know... I still haven't had much time to do much with the dll file and see exactly what's going on... and with my limited knowledge of ARM ASM... it's going to take quite some time... which is why I'm only guessing at numbers for now to at least get it CLOSE to what it should be reading.

Have you found which address WM is reading for voltage, current, and temperature in the ASM you are looking at? This is the first step to assure we are looking at the proper values. Then work on calculations.

Unknownforce 06-16-2010 12:33 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Quote:

Originally Posted by sovereignty03 (Post 1818498)
Ah, now I know why you are doing that. Good.





Have you found which address WM is reading for voltage, current, and temperature in the ASM you are looking at? This is the first step to assure we are looking at the proper values. Then work on calculations.


Unfortunately no, I haven't had any time to look at it in the last week or so, so when I get time to look at it again, I'll have to re-trace my steps and get back into it, I don't know when I'll have the time to do that, I'm working 2 jobs right now and I can barely even get any sleep, I'm replying from work right now, haha...

Hopefully I will get some time here soon to take a stab at it, but if not, I have a week off in the beginning of July, and I'll probably be able to dive into it then and hopefully figure it out.

Unknownforce 06-17-2010 04:28 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Brought up to date with the changes from 6/14. sorry for the delay, work is killing me.

LBushnell 06-19-2010 09:36 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/4 Update)
 
Thanks Unknown! This is a huge help man, keep up the good work.

Unknownforce 06-22-2010 05:05 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Added some stabilization code to hopefully level out the battery level and not be so erratic. THIS IS A BETA of this code, I plan to add more stabilization routines in eventually, but alas, I am just too busy. However, because this is beta type code, I have left the 6/17 update up for download incase this does not work.

To understand what it does and why it's a beta, have a look at the first post.

Thanks, and please let me know results and/or problems.

AndroidTroll 06-29-2010 12:52 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
how far is the hardware accelaration from being activated? Anyone know? The regular htc touch has it activated. Does anyone know if theres any build of android has the accelaration activated?

Unknownforce 06-29-2010 02:18 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Quote:

Originally Posted by AndroidTroll (Post 1843777)
how far is the hardware accelaration from being activated? Anyone know? The regular htc touch has it activated. Does anyone know if theres any build of android has the accelaration activated?

Firstly, wrong thread. This thread has nothing to do with hardware acceleration.

Secondly, hardware acceleration doesn't need to be "activated," it needs code to properly initialize and interact with the hardware. The hardware inside the TP2 is different than most other HTC Devices, including the TP1. So it can't just be "activated." We have to learn how it works and then adapt the android kernel to work properly with it. This is no easy task, and there is never a real ETA. You can't put a set time on discovery of the correct functionality, it just happens, there's a lot of trial and error. It could be today, it could be a year from today.

Please read a little before posting, and please post in the correct thread.

xicloe 07-01-2010 09:06 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Is this fix work with the froyo 2.2 just added at 1 juli ?, or maybe I should try and report back :)

Unknownforce 07-01-2010 11:25 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Quote:

Originally Posted by xicloe (Post 1848202)
Is this fix work with the froyo 2.2 just added at 1 juli ?, or maybe I should try and report back :)

Possibly, assuming 2.2 uses the same zImage type interface. I will have to test it out.

NeoMatrixJR 07-08-2010 05:44 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Actually, you're kernel seems to be the only way to get 2.2 working on a TP2. CONTACT ME. (or another dev). We need to get you merged in or something)

Unknownforce 07-08-2010 09:59 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Quote:

Originally Posted by NeoMatrixJR (Post 1857020)
Actually, you're kernel seems to be the only way to get 2.2 working on a TP2. CONTACT ME. (or another dev). We need to get you merged in or something)

Sorry, I've been really busy this week, and I regret to inform everyone that I will be ceasing development on this because I purchased an EVO and am going to be selling my TP2, as much as I wanted to get it working... I just couldn't do it with my time constraints...

Everytime I would try to get something done on it, I would have to start over on what I was working on because I would have to "rebuild" my train of thought... and then finally get a tiny bit closer to getting a small fix implemented.

As to why mine only works on 2.2, I can't explain that, as I said my changes are ONLY in the battery file, such changes should NOT affect the boot process, only the battery readings... See the link below for all the changes I made.

http://pastie.org/1036932

Oh and if need be, I can zip up my entire android development folder including all files as they are right now, (and were at the time of the last compile listed here) and post them somewhere if you like... that way you can do a compare on the entire listing maybe to one of your own that does not work and see where the fault is perhaps? IDK....

NeoMatrixJR 07-08-2010 11:08 PM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
We may need that whole file. I did a binary comparison to your modules vs. the same release from auto-build and they're all larger. You've done something different.... Thanks for your work. You'll be missed.

Unknownforce 07-09-2010 02:42 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Quote:

Originally Posted by NeoMatrixJR (Post 1857401)
We may need that whole file. I did a binary comparison to your modules vs. the same release from auto-build and they're all larger. You've done something different.... Thanks for your work. You'll be missed.

I'll post it as soon as I get a chance, but it will be at least a couple days out, sorry.

sjs01 07-09-2010 03:05 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Quote:

Originally Posted by Unknownforce (Post 1857563)
I'll post it as soon as I get a chance, but it will be at least a couple days out, sorry.

Yes thank you for all your work! It's so nice to actually have a somewhat accurate battery meter on Android. Thanks so much for all your work, hope you enjoy your EVO!

kidwolf908 07-09-2010 10:26 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
I copied over the modules file and the zImage to my andboot folder (Latest 2.1 with LauncherPro), but my battery indicator is still off. It's showing 5% in Android when WinMo displays 38%...

Do I need to delete the other modules file from my andboot folder for this to work? It didn't overwrite the modules file since the names are different.

NeoMatrixJR 07-09-2010 11:02 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Quote:

Originally Posted by kidwolf908 (Post 1857813)
I copied over the modules file and the zImage to my andboot folder (Latest 2.1 with LauncherPro), but my battery indicator is still off. It's showing 5% in Android when WinMo displays 38%...

Do I need to delete the other modules file from my andboot folder for this to work? It didn't overwrite the modules file since the names are different.

This is a "workaround," as I understand it, it's not going to give you a correct meter, just better than stuck at 5%.

kidwolf908 07-09-2010 11:04 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Quote:

Originally Posted by NeoMatrixJR (Post 1857861)
This is a "workaround," as I understand it, it's not going to give you a correct meter, just better than stuck at 5%.

But... if you read my post... it IS stuck at 5%. Even with the "Fix"

electrikjesus 07-09-2010 11:10 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
You will have to delete the old Modules file, and your data.img file. If that doesn't do it, You will also have to go into the root of your sd card and delete the /android folder if there is one.
If that conbo doesn't do it, PM me and I will help you out.

NeoMatrixJR 07-11-2010 12:57 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Quote:

Originally Posted by kidwolf908 (Post 1857871)
But... if you read my post... it IS stuck at 5%. Even with the "Fix"

At 30-some percent in winmo according to your other post. What about when winmo is at 100%? 75%?

NeoMatrixJR 07-15-2010 12:31 AM

Re: Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)
 
Unknownforce, please PM me ASAP when you can post more. I have my build machine running and I want to try and build a working kernel. Can you also let me know if you changed anything else? What kernel repo did you grab from? ANYTHING you did seemingly different. again, your modules files were MUCH bigger than those downloaded from xdandroid, so something more than the batt file had to have changed.


All times are GMT -4. The time now is 11:03 AM.

Powered by vBulletin® ©2000 - 2025, Jelsoft Enterprises Ltd.
©2012 - PPCGeeks.com


Content Relevant URLs by vBSEO 3.6.0