yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] theloginwithnoname:
agreed, providing you have a clean kernel

Seems his current work does:

http://github.com/pershoot/kernel-2635/blob/master/drivers/power/ds2784_battery.c

http://github.com/pershoot/nexus-kernel-2635/blob/master/ds2784_battery.c

(lines 472+)
[Nexus One Android Development] theloginwithnoname:
It is not OK. Probably because it takes pershoot's base kernel work.

We'll have to wait for pershoot to comment on his next moves...
[Nexus One Android Development] theloginwithnoname:
new zImage with dmesg logging tweaks

As you're probably already aware, RogerPodacter and myself have been working on extracting more info from our batteries to try and work out precisely when learning mode is hit, so that we can get optimal calibrations.

To achieve this, we need to know what's going on with our batteries a bit more precisely so I've been doing some tweaking of pershoot's .35.4 kernel (from 2nd Sept) to provide extra logging and quicker battery polling.

For those of you who think you have already hit this learning function and are now calibrated, we think that running any kernel with additional logic to prolong the charge will uncalibrate your batteries and return them to the old days of "jump from X to 0% or 100%".

The kernel Roger and myself have been testing, and are running now, just relies on the "battery.full" indicator so will compliment any batteries calibrated that have not had a "bogus" full on-charge since.

If you want to see what is happening to your devices every 9-10 seconds, you are welcome to use the zImage. To temporarily install it (til next reboot) fastboot boot <zImage-filenameAndPath>. It is available from http://www.mediafire.com/?wruwa95nosofelp

As usual, you do so at your own risk; I accept no responsibility for anything that may happen as a result of you using it, and by temporarily or permanently running the image on your device, you are agreeing to these terms. </disclaimer> :cool:

additional bits in dmesg log:

value in brackets after register status is decimal equivilent of the existing hex value

VAE - Voltage active empty

IAE - Current active empty (raw value)

AE - active empty (raw value)

AE13 - active empty as 13 bits (raw value)
[Nexus One Android Development] theloginwithnoname:
Don't forget that OS monitor reads from dmesg so it will be recorded - "dmesg | more" to start paged logs. Alternatively you can "more /sys/kernel/debug/batt*" to get the battery log from boot.

Battery logs are the only ones that show register status - say the value is 0xAB; if A is (1, 3, 5, 7, 9) then you're in learning mode as bit 5 is LEARNF.

Pictures look like calibration happened though. To confirm, the first line of the battery log (where timestamp is 0) *may* have the last value before shutting down - if the reg_stat starts with one of the above, it will confirm you hit learning.
[Nexus One Android Development] theloginwithnoname:
Adding in full screen brightness, I've just gone from 100% to 33% in 2 hours :eek: :cool:
[Nexus One Android Development] theloginwithnoname:
Can we have your logs please - specifically want to interrogate for mV and mA you start off at, and the reg_stat from start to end.
[Nexus One Android Development] RogerPodacter:
well i believe right now i am in performing a learn cycle. however i do not know because i am doing it off charge. i got down to 3.45 volts in OS monitor, wasnt able to catch any reading lower than that before i got the shut down message. so at that point, i know pretty much for a fact that learn flag got set. so i'm not even gonna risk trying to see my status reg value (i'll find out for sure after its fully charged). just gonna take it on faith, do a full off-charge, and see if anything changes i.e. no jump at the top, will my full be 1270mAh?

i will flash the previous zImage as well to see if age scalar updates at all. but first i'll boot up with the current zimage and take a look, then flash the older one at have a looksie.
[Nexus One Android Development] RogerPodacter:
well i guess bad news, i charged till green light turned on. immediately powered up, and reading 1352 mAh with zero current readings and 100% showing. status register is 0x81, but that is to be expected since learn cycle is terminated by the CHGTF flag. temperature is 26C. so i dont think it did a learn cycle, or it DID but just didnt do anything. very strange and frustrated.

EDIT: and no change with age scalar, still reads 121. and the other value of 30976 or whatever. perhaps i didnt get learn going.
[Nexus One Android Development] chowlala:
Again, did my calibration test last night. This morning the reading was 12xx mAh. First thing I did before even powering on, was to flash a regular kernel. So I'm on a reverted kernel by pershoot before the <mAh check/logic changes.

Will see what happens tomorrow when I do a regular charge later today.
[Nexus One Android Development] RogerPodacter:
Have you tried the new kernel no name posted? I'm very curious what your values are especially since you see 1200 or whatever. It's only a temporary flash, though you may want to wait for one with age scalar added, that would be an important value to see.
[Nexus One Android Development] chowlala:
Nope. Haven't tried. Not sure what I'm supposed to do with it. Lol, been a little overloaded at work and seldom have time to dump through everything :(
[Nexus One Android Development] ram130:
So this morning I've been doing some heavy flashing, well just two files to get back to stock. Then I charged my battery while the phone was on and it hit 1262mah again, so it seems I was successful. Sorry no screenshots this time since I'm now unrooted and stock. This also proofs that the change in kernal(from enoms rom to stock) has no effect on the battery. The bad news is, the phone is gonna take a trip today, very sad that we getting somewhere and its going away..either way if you guys need me to help with info from the Vibrant do let me know, I'll be monitoring the thread.
[Nexus One Android Development] theloginwithnoname:
cross-posted from app thread

The spanner that is already in the works is that of the four of us that have hit calibration, all of us have gone no further than ~1280.

In the Pre thread, they set their age and "full" capacity to 100% and 1500mAh so that the calibrator can go up as much as it needs.

I suspect our full capacities are lower and in combination with that age (95%), our calibration high point is being set too low.

On the subject of deterioration with age, we could do some estimating to determine where our battery's age should be:

80% is considered the point where the battery is end-of-life

80% occurs around 1 year (warranty period)

from 95% (where it is when shipped, weirdly)

15% over 12 months = 1.25% a month.

Mine has been in use for 8 months = deterioration of 10%

means I should be on 85%

from 100%

20% over 12 months = 1.67% a month

8 * 1.67 = 13.33%

~86.7%

80% occurs around 2 years (expected replacement period)

5% off at 95% initially = 90%

6.67% off at 100% = 93%

i.e. none at 94.8% where *all* of those testing are now = BOGUS.

edit: my last off-charge calibration resulted in 1261mAh, which is 90% of 1400mAh.
[Nexus One Android Development] chowlala:
Testing tonight's usual charging with pershoot's latest kernel with the logic edits. Gonna test to see if the logics do affect our calibration, or is it just the "shut down" that affects it.

2 reasons:

1) Obviously to test if the logic edits in the kernel do affect calibration

2) Testing if "powering down" triggers a recalibration that leads to the % jump calibration at 80~%

Tonight's test: charging without allowing the phone to "power down".
[Nexus One Android Development] RogerPodacter:
So for those of you who have successfully recalibrated. When you just use your phone normally thru the day, maybe discharging to 80% or whatever, then plug in to charge full, are your new top numbers always stopping at the new 1280 or whatever?
[Nexus One Android Development] chowlala:
Kernel logic does not affect charging level if you don't let the phone go into "powering down" mode. Got up this morning and cap charge was 12xx mAh.

Not sure about this. Will give this a try in a few hours. I suspect the value will not change on a burst charge like that. I was at bout 20% last night when I went for my recharge to this morning's values.
[Nexus One Android Development] RogerPodacter:
I don't follow, are you saying with the phone powered off the kernel has no effect and the battery obeys strictly the ds2784 chip parameters for charging? If so I'd agree. However why is it that a "bump"charge worked in getting us higher mAh numbers than a powered on charge? That's a good question actually knowing now that the <80 mA is also built into the parameter block of memory. Interesting...
[Nexus One Android Development] chowlala:
Basically, I charge my phone without ever letting it die.

So... as long as you charge whenever without letting it go flat, the charge reaches the right calibration (ie: 12xx mAh).

But I suspect, if you let the phone go flat (ie: die at 1% or whatever) then the phone might re-calibrate when you plug in, and power it on, then the charge might hit the % jump bit we've been experiencing.

Hence, kernel logic has no effect on the battery calibration. It's how the phone handles the calibration when it hits "powering down".

Not sure. I might not be explaining this clearly. Haha.
[Nexus One Android Development] theloginwithnoname:
it will if it has code that makes it continue charging past when the battery says "i'm full"! Remember, you went back to an earlier kernel.

Correct up to ** ;) One loses the jump if the battery is calibrated - one gets a jump if the battery is "over-charged".

Disagree. :D
[Nexus One Android Development] theloginwithnoname:
So I powered my phone down at around 40% last night and put it on an off-charge.

This morning I boot and the capacity is shown as 1385mAh!

Will be interesting to see what happens around 6-10%...
[Nexus One Android Development] chowlala:
Actually. No. I did go back to an earlier kernel, but last night I intentionally flashed to the latest updated kernel pershoot rolled out last night. I'm pretty sure it has the logic changes in place still.

So I'm quite sure the kernel doesn't affect the battery calibration at this point. It's how the phone handles the calibration when it hits shut down, we should explore if it even does anything. Lol.
[Nexus One Android Development] RogerPodacter:
ugh. so what does this mean, that the learn cycle takes place but does not take hold, or did not happen at all? or is it somehow disabled?
[Nexus One Android Development] chowlala:
3 boots without letting the phone go flat.

All charges hitting 12xx mAh.

Calibration is successful so far.
[Nexus One Android Development] theloginwithnoname:
running mine down to 0% now to see what's what, then I'll probably do an on-charge.
[Nexus One Android Development] theloginwithnoname:
it shut down at bottom end of 6% (3439mV). Now I'm really confused.:(
[Nexus One Android Development] RogerPodacter:
crap only choice maybe is to get learn to happen with phone on to really see what's what. It somehow happened that first time only but never again, but gotta be possible. I'm totally stumped.
[Nexus One Android Development] chowlala:
=(((

Yeah. This whole episode has become quite confusing. Maybe we should dig into what happens to files and hexes when we "plug in" and when we "unplug" and etc?
[Nexus One Android Development] b33zy682:
idk if this helps but maybe you guys can give me some insight. the battery that came with me nexus one is the battery i used since day one. long story short i called htc and told them my phone was getting a lil warm while using it and really hot while charging. i also told them my battery was dying at 10ish percent and that my battery life sucked. they told me the problem was my battery and sent me a new one TODAY! i was going to let it die then charge it overnight to get full battery life and it died at 11 percent just like my old battery. does that mean its a phone issue? battery life seems the same (HORRIBLE) but ill charge it full then let you guys know.
[Nexus One Android Development] RogerPodacter:
Like I said way back, my phone died at 10% when the phone was brand new / 1 day old. You're not doing anything wrong I'm sure your new battery is fine. My theory is our batteries are coming from the factory with not the most optimal parameters stored in the ds2784, so maybe we can tweak them eventually.
[Nexus One Android Development] ram130:
Well I had the Vibrant for about 5 days now and I must this battery dies at 0% each time..at one point I had it on 2% in flight mode for over 4hours! checking the screen every 10min and turning on the signal now and then since I was far from home. Anyway each day it dies at 0%..I notice some awkward stuff here and there but it's mostly been perfect...downside, it takes 3hours to charge and never gets warm while charging. Oh and has a usb cable connected to a wall charger that it comes with.

Help me out here guys, I'm not sure on what information to gather on the Vibrant to help you guys out with your research.
[Nexus One Android Development] EnhancerFIN:
I haven't been much part of this thread, but I started wondering when you told that your phone died at 10% even as a new one. I remember seeing the red battery icon replace the normal as the phone was at 0% charge and it kept running few minutes even after that. That was when mine was new, stock rom etc, propably half a year ago. Nowadays mine dies at 7-8%.

I ordered a spare battery with my phone, and switched to that 2 weeks ago, haven't noticed any changes. Of course, me flashing a new nightly all the time, can't say a thing about battery life going to better or worse, I on-charge the phone every night, and have done the bump charge a few times.

Do you think I could do some testing or something, as I have 2 batteries etc.?

Edit: I've never used other charger than Nokia AC-10E, which outputs 5V/1200mAh..the stock charger doesn't fit my wall outlet here in Finland :P
[Nexus One Android Development] EnhancerFIN:
Ok, so I killed all the conversation :D.

I did some tests yesterday, and got my phone to a zero charge afterall :P, with slow draining.

When there was 10% of battery left, I put the phone to a airplane mode, and activated every possible way to save power. In 7% I put the screen always on, and started rebooting the phone. When the phone showed 2% remaining, it shut it self down, but booted back up showing the 0% red battery icon with line crossing it :D.

It did not power up after that, so I off-charged it, about 9 hours, and booted up. Tried bump charging, as for it shut down the phone and plugged the charger in, but the charging light went straight to green.

Now, with normal usage I'm having about 20-25 percent more battery remaining as usual. 12 hours usage, battery meter showing 52%.
[Nexus One Android Development] RogerPodacter:
Ha you didn't kill the conversation. I just had to take care of some stuff this weekend. Plus get my head clear of all this battery talk to maybe start fresh with some new ideas.

So yeah interestingly I finally fired up my brand new second battery, but haven't yet gotten down to see where it dies. However interestingly it is a desire battery, part no last 3 digits are 06M where the nexus last 3 are 01M.

Also, the status register of this new battery reads the same as no name login's, 0x27, 0x87 and 0x07. I also did my first complete charge turned off, and it booted up at 1384 mAh. It's too bad we don't have dumpreg yet, cause a few bits are supposedly only set with a new battery, and cleared after first use. I was hoping to stretch it out, but couldn't wait any longer. This new battery seems to be more robust, lasts longer, but that could be placebo. Also the 100 to 99% drop happens lower, at 1344 mAh. But that could be cause the temp was much lower than normal.

My full 40 is 3485, age scalar is 121, but age capacity was different by 1 value, at 3345.

So basically all the same.

Voltage active empty and active empty current are still the same, which is expected, at 3.416 volts and 200 mA. And active empty point is the same, but keeps changing all over as my temp changes and I reboot, 528, 424, 384, and even 224.
[Nexus One Android Development] RogerPodacter:
Yeah you could first check the part no of each of your batteries and see if they're the same. You could also load up one of the posted kernels and post some of your values you get for certain register values. However I forget which kernel is which, so you may just wait till one exists that captures all values in one go. That may happen soon.

You could also post your fully charged logs with your full mAh numbers,and note if you have the jump to full issue.
[Nexus One Android Development] RogerPodacter:
First thing you could dig into the kernel files with root explorer and see what model battery the galaxy s has. Hopefully its the same ds2784. If so you could load up the kernel if rooted running cyanogen and see what numbers you get. Maybe wait for an all inclusive kernel though just to be safe.
[Nexus One Android Development] ram130:
Well this will be first time looking for those files. Could you give me a step by step? and yes I'm rooted but cyanogen has not release the galaxy s version of the rom yet.
[Nexus One Android Development] chowlala:
Is there a way for us to get hold of a system process for the battery?

Like what happens when we plug in, when chargers are loaded etc.

Anything like a battery process flow table?
[Nexus One Android Development] RogerPodacter:
i think you need root explorer, or maybe terminal to look thru directory files. but in root explorer it would by under sys/devices/platform and there you would find a folder called "ds2784-battery" which contains all the outputs that our driver creates such as voltage_now, current_now, etc. but i dont know if the galaxy would be in a different location? not sure, just look around i guess.
[Nexus One Android Development] RogerPodacter:
i do see ds2784 system process running in system panel every once in a while, but i dont think there's anything you can actually do with it unless a more advanced android expert knows. the only thing i can suggest is look thru the battery driver code posted earlier, if you can even follow it a little bit, it pretty much shows what happens for most all functions. its not too bad really.
[Nexus One Android Development] ram130:
Well I didn't find that. I found another name for it so I'm guessing it's not the same battery. Pics:
[Nexus One Android Development] ngocquynh85:
I tried and got good sound.

My battery inc to 4184mV when full charged.

But, when discharge, it down to 0% when it's 3810mV.

So, is there anyway to calibration of lower volt. I know that phone cound be run when battery still have more than 3500mV.
[Nexus One Android Development] ngocquynh85:
haizzz,

I use OS monitor and it's my result:

batt: 0% , 3859mV , 171mA (165 avg), 27.5 C, 0 mAh

I got 0 mAh when it's still 3859 mV.

So, what wrong, and how to fix ?
[Nexus One Android Development] chowlala:
That's normal...

Your phone runs on the mAh.

Not the mV.
[Nexus One Android Development] theloginwithnoname:
Wow, that is unheard of! And probably a good thing in terms of your battery life.

Let it run right down, monitoring the mV and mAh values, until it switches itself off, and report back what the last values were?
[Nexus One Android Development] theloginwithnoname:
Mine runs on the mV, chow. It nose dives towards 3400 when getting close to shutdown, even though I can be on 90 or even over 100 mAh. I think the battery tells the host device when it gets to 3.412v - the Active Empty point (RP will correct me on this ;)) and so device shuts down.
[Nexus One Android Development] RogerPodacter:
hey RAM, actually i think jupiter battery is not it, as i remember seeing that in the nexus one file structure as well. but it wasnt actually used, i.e.just place holder files. i'd guess that the "max8998" is your battery, but i dont know for sure.
[Nexus One Android Development] RogerPodacter:
that is very very strange. you can find all over the web that in general for a li-ion battery that 3.8 volts represents the "half way" point for all li-ion batteries. take a look at any discharge curve and that part of the graph is always nice and flat until around 3.6/3.5 vlts. i dont know what could be the problem, just try to export your logs next time and post them.

if you have the same battery as the nexus (ds2784) its possible you could change your empty voltage points if the app in the sister thread to this one ever gets going. but you'd have to be rooted and have the same xact batt.

all the incredible's i've played with at verizon store ironcially were at 4.22 volts at full charge which i thought was strange compared to the nexus...
[Nexus One Android Development] ngocquynh85:
hi all,

When it full charge, my phone is 4197mV, and power off in 3859mV.

When it power-off, I can't power on my phone, but I can go bootloader or recovery.

I have a test, go to bootloader, and take a cup of coffe for a while.

So, verry strange that my screen phone can light about 2.5h. It mean the empty point that my phone think is wrong.

So, how can I fix it ?

BTW, I use extended battery (2400mAh).
[Nexus One Android Development] ngocquynh85:
You said that the phone run on mAh.

So, I used extended battery 2400mAh, but it seem my phone think I used stock battery.

how can I fix it ?
[Nexus One Android Development] RogerPodacter:
Yeah that's strange. Something is not right. The OS thinks it needs to shut down when it really has more charge left. The only way to really help you is to export your battery log via OS monitor dmesg logs like we have done many times earlier in this thread. Filter for "batt" and run from full to near empty and export every hour or so. Then post so we can see.
[Nexus One Android Development] xghostyxjokerx:
PLEASE HELP!!! I WAS USING CYANOGEN MOD 6.0N1 BUT TOO MUCH BATTERY DRAIN NOW IM USING THE LEOFROYO2.1 NOW MY PHONE IS SETCPU LOW...THE SCREEN IS LOW...AND IT SEEMS LIKE EVERY MINUTE OR TWO THE PERCENT DROPS LITTERELY.....:mad::confused:

http://www.flickr.com/photos/50878426@N07/
[Nexus One Android Development] RogerPodacter:
Ok that's fine for now until you get down low when your phone is ready to turn off. Then post more.

So what phone and battery are you using? That sure doesn't look like a 2400 battery, it shows 1360 which is stock nexus battery. Weird.
[Nexus One Android Development] xghostyxjokerx:
okay i will post more pics later after the phone is low.....

Nexus one tmobile i have and this is a stock nexus one battery i have....
[Nexus One Android Development] RogerPodacter:
Sorry I was replying to ngocquynh85 about his logs. I have no idea why your battery drains so fast. 23 mins is short amount of time to lose 13%.
[Nexus One Android Development] xghostyxjokerx:
o can anyone help me?
[Nexus One Android Development] theloginwithnoname:
To those of you who are getting poor battery life - you need to first strip your systems bare of apps and get a baseline. Then do what I did and start adding them back in til you find the culprit(s).

Start at the post and work your way down - it's dull at times but it will hopefully get you there.

Swerving back on-topic, calibration would no doubt help your battery behaviour though
[Nexus One Android Development] RogerPodacter:
I think your phone is shutting down early because it reaches what the phone thinks is active empty point (mAh), but not yet crossed empty voltage point. I'm not sure how this could be fixed or why it even happens. I'd like to look at the driver for your phone. How long does your battery last compared to stock battery? It seems you are only getting half of the true capacity of of your battery.
[Nexus One Android Development] chowlala:
Most likely the battery is a fake. 2400 mAh. For the battery check stuff you gotta refer to the accessories thread where they check the true value and capacity of the batteries in mAh and mV's.