Samsung Moment Forum
  
Welcome, Guest. Please login or register.

News: Do you like Samsung Moment?
Advanced search
Scratch-Proof your Samsung Moment        Best Price on Sprint Phones      Screen Protection Latest Ringtone for your mobile
Pages: 1 ... 4 5 [6] 7
Print
Topic: Working on the battery issue... I think - New battery code based on BEHOLD II  (Read 6024 times)
zefie
Pro Member
****

Cookies: 29
Posts: 458


View Profile Email
« Reply #75 on: January 02, 2010, 04:49:05 PM »

ZE08 dev released with patch applied
Logged
numus
Pro Member
****

Cookies: 3
Posts: 279


View Profile Email
« Reply #76 on: January 02, 2010, 06:25:17 PM »

WARNING HIGHLY EXPERIMENTAL!
This is a further modification of the battery file to allow for integer 5 reports... I tried debugging myself but didnt find any mistakes (granted i didnt find any the first time around on the other one)...
spareparts only gives 2 digit voltages.. if this holds true across the board this new patch wont work very well since some of the variables are only different in the third digit

The reporting values might be a little jumpy.. there seems to be a problem with the way the adc is read from the power supply that is making it a little jumpy.... The meter might jump a little but should be more accurate then before atleast.. this is something sammy is going to have to fix since we dont have acccess to these files

* s3c6410_battery.h (4.24 KB - downloaded 12 times.)
* s3c6410_battery.c (67.98 KB - downloaded 7 times.)
« Last Edit: January 02, 2010, 07:30:53 PM by numus » Logged
numus
Pro Member
****

Cookies: 3
Posts: 279


View Profile Email
« Reply #77 on: January 02, 2010, 08:05:12 PM »

I changed polling interval from 2 seconds to 4 seconds.. maybe this will stablize it jumping around so much

Well i am not running the poll update yet, but running the ze08-dev which includes the new integer 5 code.. seems to be working on my phone.. says 75% remaining.. hopefully this is stable when it gets to lower and ADC values get blured but this should be much more accurate then anything we have had so far.. i hope

* s3c6410_battery.c (67.98 KB - downloaded 3 times.)
« Last Edit: January 02, 2010, 08:31:37 PM by numus » Logged
numus
Pro Member
****

Cookies: 3
Posts: 279


View Profile Email
« Reply #78 on: January 02, 2010, 08:41:54 PM »

Letter i sent to
MODULE_AUTHOR("Minsung Kim <ms925.kim@samsung.com>");
MODULE_DESCRIPTION("S3C6410 battery driver");
MODULE_LICENSE("GPL");


Dear Samsung Coder,
I do not know if you still work at samsung, but you are the author listed on the S3C6410 battery driver module... This code has been modified to actually work without reporting 15% at nominal voltage. I do not know if samsung is aware of this problem (they have blown me off anytime i try to inquire) but it is a big issue. Furthermore, the header variables have been adjusted to correlate with battery voltage information from the BEHOLD II which uses the same battery, thus voltage reporting levels should be reasonably close. It would be benefical if you went back to the spica or 9bit adc value instead of the new *100/848*100 since this gives small values and makes it impossible to create percentage lists to correlate to adc values (multiple voltages would share the same adc value).. This code has been modified to report in integers of 5 (100,95,90,85,ect)...
Thank you for your time
- Numus
Logged
TBone
Jr. Member
**

Cookies: 2
Posts: 74


View Profile Email
« Reply #79 on: January 02, 2010, 08:58:53 PM »

Think we need to modify some stuff and set all the new variables from lines 1490 - 1501 of the attached file.  I modified some of the additional logic to be correct. (I commented out your line and added my own)  One thing to note is that the first s3c_get_bat_level method has different logic than the second method.  I'm not sure if that's what you wanted, but for example when the level is between critical and min, the lower method returns 3 while the upper method returns 5.  The upper method also returns 10 sometimes if the level is between low and critical and is more than half between the 2 while the bottom doesn't do that.  I didn't fix any of these as I wasn't sure if that's what you intended or not?

Attached code file is prior to the polling change.

* s3c6410_battery[1].c (68.69 KB - downloaded 6 times.)
* s3c6410_battery[1].c (68.69 KB - downloaded 3 times.)
Logged
numus
Pro Member
****

Cookies: 3
Posts: 279


View Profile Email
« Reply #80 on: January 02, 2010, 09:18:38 PM »

Think we need to modify some stuff and set all the new variables from lines 1490 - 1501 of the attached file.  I modified some of the additional logic to be correct. (I commented out your line and added my own)  One thing to note is that the first s3c_get_bat_level method has different logic than the second method.  I'm not sure if that's what you wanted, but for example when the level is between critical and min, the lower method returns 3 while the upper method returns 5.  The upper method also returns 10 sometimes if the level is between low and critical and is more than half between the 2 while the bottom doesn't do that.  I didn't fix any of these as I wasn't sure if that's what you intended or not?

Attached code file is prior to the polling change.
Tbone looks like you change batt_cal to BATT_CAL correct? that was a typo from the original coder but it still functioned the same..
Ya the first one uses the averages of the 2 reporting levels, then adds the average to the lowest value and if the number is above this, it reports the higher one.. the 2nd one just sees if the value is inbetween the 2 reporting levels it is in there.. these are waht you are talking about right?
Those are the (low)level and (mid)level as reported in debug...
The reporting difference at the lower numbers is something i was unable to think of a solution to fix due to the way it checks at lower numbers (adc values start to merge together).. if you can think of a fix that would rock..
As for the variables in 1490-1501 i had to use that naming scheme to keep myself from getting confused.. as for the adc values in teh header, those are correct even tho they seem to high...
Zef is experiencing a rapid change in the meter when plugged into usb, my only solution is for us to change the polling interval from 2 seconds to 10 seconds.. the behold 2 uses a 10 second polling interval
Logged
TBone
Jr. Member
**

Cookies: 2
Posts: 74


View Profile Email
« Reply #81 on: January 02, 2010, 09:31:45 PM »

Some instances of setting the values use the constant BATT_CAL while another method in the code passes in a variable they've balled batt_cal and adds the constants to that value.  I'm just making sure that the values are being set everywhere the other high, almost high, etc. variables are being set.

Yes, those are what I'm talking about.  If you look, there are two methods called s3c_get_bat_level, but the logic is different in the two.

We could potentially start to use floating point numbers (decimals) as the values merge together, however that scares me a bit.

Polling change is fine, I just made my modifications to the logic, etc. prior to your posting the polling fix.  So, if we use the file I posted, we need to re-add your polling stuff to it.
Logged
numus
Pro Member
****

Cookies: 3
Posts: 279


View Profile Email
« Reply #82 on: January 02, 2010, 09:34:10 PM »

Some instances of setting the values use the constant BATT_CAL while another method in the code passes in a variable they've balled batt_cal and adds the constants to that value.  I'm just making sure that the values are being set everywhere the other high, almost high, etc. variables are being set.

Yes, those are what I'm talking about.  If you look, there are two methods called s3c_get_bat_level, but the logic is different in the two.

We could potentially start to use floating point numbers (decimals) as the values merge together, however that scares me a bit.

Polling change is fine, I just made my modifications to the logic, etc. prior to your posting the polling fix.  So, if we use the file I posted, we need to re-add your polling stuff to it.
all those variables SHOULD be pulled from the BATT_CAL in the header file.. i am guessing they did it this way so they could change all adc values by changing only 1 variable
as for the logic being different.. one is reporting to (low)level and one is reporting to (mid)level.. what these are used for i have no fing clue... the small values (15 -> 0) need to be fixed but i have no idea how to..

BTW the first set of code that is reporting to (low)level is correct.. it is the 2nd set reporting to (mid)level that is broken
« Last Edit: January 02, 2010, 09:42:32 PM by numus » Logged
numus
Pro Member
****

Cookies: 3
Posts: 279


View Profile Email
« Reply #83 on: January 02, 2010, 09:35:58 PM »

Logic changes implemented by TBone and Change polling frequency from 2000 milliseconds to 10000 milliseconds

* s3c6410_battery.c (68.69 KB - downloaded 14 times.)
Logged
dolinmyster
Newbie
*

Cookies: 0
Posts: 34


ICU


View Profile Email
« Reply #84 on: January 05, 2010, 12:12:58 AM »

I a noob. But have experience in the past with simple code's and being able to follow instructions. Vague ones and detailed ones. So my question is this. How do i load this fix into my phone. I've read through the multiple post until my eye's bleed, and apparently i missed how to do it. I would like to be able to get this fix loaded. Appreciate the work you guys are doing. Someone, even if it's not Samsung, needs to fix the mess up's some smeg head did when they codded this awesome phone.

Edit: NVM I belive i just found my answer. I guess thats what i get for not looking around before opening my big mouth.
« Last Edit: January 05, 2010, 12:15:53 AM by dolinmyster » Logged

Two men walked into a bar, the third one ducked.
numus
Pro Member
****

Cookies: 3
Posts: 279


View Profile Email
« Reply #85 on: January 05, 2010, 12:18:56 AM »

I a noob. But have experience in the past with simple code's and being able to follow instructions. Vague ones and detailed ones. So my question is this. How do i load this fix into my phone. I've read through the multiple post until my eye's bleed, and apparently i missed how to do it. I would like to be able to get this fix loaded. Appreciate the work you guys are doing. Someone, even if it's not Samsung, needs to fix the mess up's some smeg head did when they codded this awesome phone.

Edit: NVM I belive i just found my answer. I guess thats what i get for not looking around before opening my big mouth.
the original batt fix was loaded into ZE06 i believe.. the newest one (the one you see at the end of this post) was loaded into ZE08.. when you patch the kernel with zef's patch (ze** series kernels) it will load in the battery fix.. Note there is a recharge issue were it doesnt report the correct percent during a recharge, but once it hits 95% it stays there until the battery is fully charged at 100%.. also if you disconnect from the usb, within 10-30 seconds it should drop back to the reporting level the battery is really at.. this is an issue with the adc settings that we cant actually change (only samsung can)
Logged
dolinmyster
Newbie
*

Cookies: 0
Posts: 34


ICU


View Profile Email
« Reply #86 on: January 05, 2010, 12:30:54 AM »

the original batt fix was loaded into ZE06 i believe.. the newest one (the one you see at the end of this post) was loaded into ZE08.. when you patch the kernel with zef's patch (ze** series kernels) it will load in the battery fix.. Note there is a recharge issue were it doesnt report the correct percent during a recharge, but once it hits 95% it stays there until the battery is fully charged at 100%.. also if you disconnect from the usb, within 10-30 seconds it should drop back to the reporting level the battery is really at.. this is an issue with the adc settings that we cant actually change (only samsung can)

Thanks for the help. I'm mucking around with it right now. Will be really cool to find out if it will work for me. First time doing something like this to a phone. Kinda excited.
Logged

Two men walked into a bar, the third one ducked.
dolinmyster
Newbie
*

Cookies: 0
Posts: 34


ICU


View Profile Email
« Reply #87 on: January 05, 2010, 07:31:08 PM »

So installed the patch on my phone, and now every time it goes into standby a few seconds later the screen comes on. Is it something i did wrong when installing the patch? How do i stop it from doing that? I installed the ze08 patch btw.
Logged

Two men walked into a bar, the third one ducked.
masbirdies
Newbie
*

Cookies: 1
Posts: 14


View Profile Email
« Reply #88 on: January 06, 2010, 10:07:04 AM »

Hey, great work on the battery tweaks.  Since flashing to ZE08, I've noticed my phone no longer sleeps like it used to.  Could this have something to do with the polling for battery info? 

When I unplug the phone from charging and use Spare Parts, in sleep mode it states my phone is running 48% of the time.  So if I haven't touched it in 4 hours, it has run for almost 2 hours of that time.  Unlike some others are reporting, my screen does not turn on.

I have turned off everythign from auto sync, background data, wifi, gps, etc.....

Before this flash, my phone would show almost no run time while in sleep mode.  The end result is I used to get about 30-36 hours out of a battery full charge and yesterday I got about 14.

Also, this is not a complaint. I love what you guys are doing and want to let you know of something that may need tweaking.  Thanks!
Logged
numus
Pro Member
****

Cookies: 3
Posts: 279


View Profile Email
« Reply #89 on: January 06, 2010, 10:47:15 AM »

Hey, great work on the battery tweaks.  Since flashing to ZE08, I've noticed my phone no longer sleeps like it used to.  Could this have something to do with the polling for battery info? 

When I unplug the phone from charging and use Spare Parts, in sleep mode it states my phone is running 48% of the time.  So if I haven't touched it in 4 hours, it has run for almost 2 hours of that time.  Unlike some others are reporting, my screen does not turn on.

I have turned off everythign from auto sync, background data, wifi, gps, etc.....

Before this flash, my phone would show almost no run time while in sleep mode.  The end result is I used to get about 30-36 hours out of a battery full charge and yesterday I got about 14.

Also, this is not a complaint. I love what you guys are doing and want to let you know of something that may need tweaking.  Thanks!
Hey not going to be around for a while since i am trying to setup the new server and get all the data moved over but no this wouldnt be because of the polling change.. i changed it from 2 seconds to 10 seconds so if anything it is running 5 times less (it only checks battery levels 1/5 the time it use to)
Logged
Pages: 1 ... 4 5 [6] 7
Print
Jump to:  

Samsung Moment SPH-M900 (Full Body)






Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC