Extemely slow charging - T-Mobile Samsung Galaxy S II SGH-T989

Im running CM9 final, and im not sure if this a rom issue or something else:
I have 2 batteries, the stock, and a mugen battery.
The stock should theoretically take ~3 hours to charge(650mah/hour and its 1850mah), and the mugen is 3900mah, so around 6 hours for that.
My battery was at 7%(the mugen), and after 14 hours, was at 89% while on the AC adapter. The stock battery, is only going at about 20%/hour, so MUCH slower than it should be.
Ive noticed this for a week now, is it possible that its an issue with CM, or something physically wrong with the phone. Ive used multiple cables and 2 batteries now, and they all charge very slowly.
Just wondering if someone else has this issue before i try a reflash.

Rekzer said:
Im running CM9 final, and im not sure if this a rom issue or something else:
I have 2 batteries, the stock, and a mugen battery.
The stock should theoretically take ~3 hours to charge(650mah/hour and its 1850mah), and the mugen is 3900mah, so around 6 hours for that.
My battery was at 7%(the mugen), and after 14 hours, was at 89% while on the AC adapter. The stock battery, is only going at about 20%/hour, so MUCH slower than it should be.
Ive noticed this for a week now, is it possible that its an issue with CM, or something physically wrong with the phone. Ive used multiple cables and 2 batteries now, and they all charge very slowly.
Just wondering if someone else has this issue before i try a reflash.
Click to expand...
Click to collapse
Are you using the Samsung charger that came with the phone?

Also are you charging through ac or usb from comp. Apps running in the background can slow charging as well. Charging specs vary based on circumstance. I'm in cm 9 stable with darkside latest kernel and cpu sleeper i can charge from completely dead to full in about 3-4hrs roughly.
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!

this is how the kernel defines charging...
Code:
if (enable) { /* Enable charging */
switch (info->cable_type) {
case CABLE_TYPE_USB:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
val_chg_current.intval = 500; /* USB 500 mode */
info->full_cond_count = USB_FULL_COND_COUNT;
info->full_cond_voltage = USB_FULL_COND_VOLTAGE;
break;
case CABLE_TYPE_AC:
case CABLE_TYPE_CARDOCK:
case CABLE_TYPE_UARTOFF:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 900mA, output : 900mA */
val_chg_current.intval = 900;
info->full_cond_count = FULL_CHG_COND_COUNT;
info->full_cond_voltage = FULL_CHARGE_COND_VOLTAGE;
break;
case CABLE_TYPE_MISC:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 700, output : 700mA */
val_chg_current.intval = 700;
info->full_cond_count = FULL_CHG_COND_COUNT;
info->full_cond_voltage = FULL_CHARGE_COND_VOLTAGE;
break;
case CABLE_TYPE_UNKNOWN:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 450, output : 500mA */
val_chg_current.intval = 450;
info->full_cond_count = USB_FULL_COND_COUNT;
info->full_cond_voltage = USB_FULL_COND_VOLTAGE;
break;
default:
dev_err(info->dev, "%s: Invalid func use\n", __func__);
return -EINVAL;
}
as you can see if your using a cheap generic charger from china 'CABLE_TYPE_UNKNOWN' it is only going to charge at 450mA, in comparison to the Samsung charger 'CABLE_TYPE_AC:' that came with the phone that will charge at 900mA.. and charging from USB 'CABLE_TYPE_USB' will only charge at 500mA

thederekjay said:
this is how the kernel defines charging...
Code:
if (enable) { /* Enable charging */
switch (info->cable_type) {
case CABLE_TYPE_USB:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
val_chg_current.intval = 500; /* USB 500 mode */
info->full_cond_count = USB_FULL_COND_COUNT;
info->full_cond_voltage = USB_FULL_COND_VOLTAGE;
break;
case CABLE_TYPE_AC:
case CABLE_TYPE_CARDOCK:
case CABLE_TYPE_UARTOFF:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 900mA, output : 900mA */
val_chg_current.intval = 900;
info->full_cond_count = FULL_CHG_COND_COUNT;
info->full_cond_voltage = FULL_CHARGE_COND_VOLTAGE;
break;
case CABLE_TYPE_MISC:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 700, output : 700mA */
val_chg_current.intval = 700;
info->full_cond_count = FULL_CHG_COND_COUNT;
info->full_cond_voltage = FULL_CHARGE_COND_VOLTAGE;
break;
case CABLE_TYPE_UNKNOWN:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 450, output : 500mA */
val_chg_current.intval = 450;
info->full_cond_count = USB_FULL_COND_COUNT;
info->full_cond_voltage = USB_FULL_COND_VOLTAGE;
break;
default:
dev_err(info->dev, "%s: Invalid func use\n", __func__);
return -EINVAL;
}
as you can see if your using a cheap generic charger from china 'CABLE_TYPE_UNKNOWN' it is only going to charge at 450mA, in comparison to the Samsung charger 'CABLE_TYPE_AC:' that came with the phone that will charge at 900mA.. and charging from USB 'CABLE_TYPE_USB' will only charge at 500mA
Click to expand...
Click to collapse
Huh...something learned everyday lol
Been working on building kernels and other software, this code actually made so much sense it's awesome lol
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!

Someone in the CM thread had me check cpu spy, my phone never sleeps, it just sits at 384 min..
As for the charger, its the samsung one, and a generic usb cable from china...it used to charge faster on one of these cables then recently slowed down ALOT.

Hmmm...so you use the sleeper app or the script? The app has never worked for me, but the script works fantastically. Have you tried just simply flashing back to stock and starting over. Could be something with a recent update, could be your media server is running rampant. Have you use gsam battery monitor to see what things are running?
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!

Rekzer said:
Someone in the CM thread had me check cpu spy, my phone never sleeps, it just sits at 384 min..
As for the charger, its the samsung one, and a generic usb cable from china...it used to charge faster on one of these cables then recently slowed down ALOT.
Click to expand...
Click to collapse
There device will never "deep sleep" while charging. I am also running CM9 stable and my device is charging without issue. I would try to wipe and flash again. Avoid restoring any system data. If that doesn't remedy your issue, it's either the device itself or the batteries and or cable. Try a different cable. Try a different battery. There are only a few variables, just need to isolated what is the culprit.

thederekjay said:
There device will never "deep sleep" while charging.
Click to expand...
Click to collapse
+1 what he said lol
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!

EnigmaticGeek said:
Huh...something learned everyday lol
Been working on building kernels and other software, this code actually made so much sense it's awesome lol
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
Click to expand...
Click to collapse
Nice. That is only a few lines from sec_battery.c. That file contains 4433 lines of code

thederekjay said:
Nice. That is only a few lines from sec_battery.c. That file contains 4433 lines of code
Click to expand...
Click to collapse
Yeah, the kernel codes are long as i learned by decompiling the stock one...
That was initial reaction, but it makes sense as i go through the code.
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!

EnigmaticGeek said:
Yeah, the kernel codes are long as i learned by decompiling the stock one...
That was initial reaction, but it makes sense as i go through the code.
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
Click to expand...
Click to collapse
You can't really decompile a kernel. If you're referring to a boot.img, that is not the same as the kernel (zimage) kernel source consists of 10's of thousands of files with each file consisting from a few lines up to thousands of lines of code.

thederekjay said:
You can't really decompile a kernel. If you're referring to a boot.img, that is not the same as the kernel (zimage) kernel source consists of 10's of thousands of files with each file consisting from a few lines up to thousands of lines of code.
Click to expand...
Click to collapse
Yeah i haven't quite gotten the terminology down pat, still relatively new to this type of environment. Working each day to get up there with you guys
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!

Rekzer said:
Someone in the CM thread had me check cpu spy, my phone never sleeps, it just sits at 384 min..
As for the charger, its the samsung one, and a generic usb cable from china...it used to charge faster on one of these cables then recently slowed down ALOT.
Click to expand...
Click to collapse
I think it does charge pretty slow, but I'm used to the sensation... It would charge really fast. Does yours need a reboot after removing the usb to go into deep sleep?

thederekjay said:
Nice. That is only a few lines from sec_battery.c. That file contains 4433 lines of code
Click to expand...
Click to collapse
You gotta love c language xD
Sent from my SAMSUNG-SGH-T989 using Tapatalk 2

Battery is at 100% atm. TDJ was right, taking it off the charger enabled it to sleep.
If i still have issues, Ill try a wipe after nandroiding. So far ive tried 2 cables, 2 batteries, PC and Samsung chargers. So its software or phone now. Ill try tomorrow and let ya know!

Noticed this as well..although I'm on Jedi v6..doesn't matter what cable or source. I'll have to test, but it also seems like deep sleep can't be obtained after unplugging cable until reboot. Is that normal? Or kernal issue?
Sent from my SGH-T989 using xda app-developers app

md95 said:
Noticed this as well..although I'm on Jedi v6..doesn't matter what cable or source. I'll have to test, but it also seems like deep sleep can't be obtained after unplugging cable until reboot. Is that normal? Or kernal issue?
Sent from my SGH-T989 using xda app-developers app
Click to expand...
Click to collapse
Hmmm...that's not normal no. Mine will deep sleep almost immediately after being removed from the charger. I wouldn't guess a kernel issue, but it is possible. Have you ever achieved deep sleep with a reboot?
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!

EnigmaticGeek said:
Hmmm...that's not normal no. Mine will deep sleep almost immediately after being removed from the charger. I wouldn't guess a kernel issue, but it is possible. Have you ever achieved deep sleep with a reboot?
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
Click to expand...
Click to collapse
Oh yes, it deep sleeps just fine. I did a quick charge test and it does go into sleep fine now..although I didn't charge to 100%..I'll have to try that next. This is a new phone and rom for me, as I was using cm7 on a mytouch4g before acquiring the s2
Sent from my SGH-T989 using xda app-developers app

md95 said:
Oh yes, it deep sleeps just fine. I did a quick charge test and it does go into sleep fine now..although I didn't charge to 100%..I'll have to try that next. This is a new phone and rom for me, as I was using cm7 on a mytouch4g before acquiring the s2
Sent from my SGH-T989 using xda app-developers app
Click to expand...
Click to collapse
Errr...that was supposed to ask, without a reboot have you ever achieved deep sleep lol. (Friggin auto-correct!) But you answered that, hopefully it was simply the rom settling into the phone. But it should still sleep even at 100%
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!

Related

Change the charging rate (200mA to 950mA)

look at kernel source file /Kernel/drivers/power/max8997-charger.c, line 171:
Code:
static int max8997_set_charging_current(struct chg_data *chg, int chg_current)
{
struct i2c_client *i2c = chg->max8997->i2c;
int ret;
u8 val;
if (chg_current < 200 || chg_current > 950)
return -EINVAL;
[COLOR=Red][B]val = ((chg_current - 200) / 50) & 0xf;[/B][/COLOR]
dev_info(chg->dev, "%s: charging current=%d", __func__, chg_current);
ret = max8997_update_reg(i2c, MAX8997_REG_MBCCTRL4,
(val << MBCICHFC_SHIFT), MBCICHFC_MASK);
if (ret)
dev_err(chg->dev, "%s: fail to write chg current(%d)\n",
__func__, ret);
return ret;
}
above we can see that charging rate is calculated as [x * 50 + 200] with x being the bit set on lines 220 & 229:
Code:
static int max8997_enable_charging_x(struct chg_data *chg, int charge_type)
{
struct i2c_client *i2c = chg->max8997->i2c;
int ret;
u8 val, mask;
/* enable charging */
if (charge_type == POWER_SUPPLY_CHARGE_TYPE_FAST) {
/* ac */
dev_info(chg->dev, "%s: TA charging", __func__);
/* set fast charging current : [COLOR=DarkRed]650mA[/COLOR] */
ret = max8997_update_reg(i2c, MAX8997_REG_MBCCTRL4,
[B] [COLOR=Red](9 << MBCICHFC_SHIFT), MBCICHFC_MASK);[/COLOR][/B]
if (ret)
goto err;
} else if (charge_type == POWER_SUPPLY_CHARGE_TYPE_TRICKLE) {
/* usb */
dev_info(chg->dev, "%s: USB charging", __func__);
/* set fast charging current : [COLOR=DarkRed]450mA [/COLOR]*/
ret = max8997_update_reg(i2c, MAX8997_REG_MBCCTRL4,
[COLOR=Red][B](5 << MBCICHFC_SHIFT), MBCICHFC_MASK);[/B][/COLOR]
if (ret)
goto err;
} else {
dev_err(chg->dev, "%s: invalid arg\n", __func__);
ret = -EINVAL;
goto err;
}
/* set auto stop disable */
ret = max8997_update_reg(i2c, MAX8997_REG_MBCCTRL6,
(0 << AUTOSTOP_SHIFT), AUTOSTOP_MASK);
if (ret)
goto err;
/* set fast charging enable and main battery charging enable */
val = (1 << MBCHOSTEN_SHIFT) | (1 << VCHGR_FC_SHIFT);
mask = MBCHOSTEN_MASK | VCHGR_FC_MASK;
ret = max8997_update_reg(i2c, MAX8997_REG_MBCCTRL2, val, mask);
if (ret)
goto err;
return 0;
err:
dev_err(chg->dev, "%s: max8997 update reg error!(%d)\n", __func__, ret);
return ret;
}
the bits 9 & 5 above set AC charging to 650mA (9*50+200) and USB charging to 450mA (5*50+200).
Battery Monitor Widget says that my phone charges at 200mA with display on, which makes sense once you assume that phone runs off usb (sucks about 250mA w/ display on) and uses the rest of available 450mA to actually charge the battery (200mA).
so there ya go, to get faster charge either get a different usb cable (d-/d+ pins shortened, or fit a 200k resistor there) or change those 9 & 5 bits to 15 and recompile the kernel to increase charging to full 950mAh. of course, your computer's usb port will not have enough power so instead use either a wall charger or use one of those usb cables that connect to 2 usb ports simultaneously and enjoy speedy charging. oh, and do watch the temperatures as i'm assuming super-charging will heat up your phone in no time
oh, and one more thing. while you're digging though the source, check out /Kernel/drivers/misc/max8997-muic.c, lines 90 to 113:
Code:
/* MAX8997 MUIC CHG_TYP setting values */
enum {
/* No Valid voltage at VB (Vvb < Vvbdet) */
CHGTYP_NO_VOLTAGE = 0x00,
/* Unknown (D+/D- does not present a valid USB charger signature) */
CHGTYP_USB = 0x01,
/* [COLOR=DarkRed]Charging Downstream Port[/COLOR] */
CHGTYP_DOWNSTREAM_PORT = 0x02,
/* [COLOR=DarkRed]Dedicated Charger (D+/D- shorted)[/COLOR] */
CHGTYP_DEDICATED_CHGR = 0x03,
/* [COLOR=DarkRed]Special 500mA charger, max current 500mA[/COLOR] */
CHGTYP_500MA = 0x04,
/* [COLOR=DarkRed]Special 1A charger, max current 1A[/COLOR] */
CHGTYP_1A = 0x05,
/* [COLOR=DarkRed]Reserved for Future Use[/COLOR] */
CHGTYP_RFU = 0x06,
/* [COLOR=DarkRed]Dead Battery Charging, max current 100mA[/COLOR] */
CHGTYP_DB_100MA = 0x07,
CHGTYP_MAX,
CHGTYP_INIT,
CHGTYP_MIN = CHGTYP_NO_VOLTAGE
};
from this i can assume that our phones technically can charge with rates up to 1000mA depending on what cable and/or adapter you use
Very good find, if you had found this yourself. But increasing the charging rate than what Samsung actually put it at will probably have some type of result, like you said overheating. But maybe developers could add this to their kernals, with an option to change charging rate (for speedy charges in certain situations, to slower more stable charges such as at night).
Going up to 1000 IMO is pointless. The difference between that and 950 is barely noticeable. I'd say it would cut maybe .2 hours off a full charge cycle. That's probably a generous estimate.
Our phones, using the wall charger, take around 6 hours for a full charge cycle. This being due to the 450-500 mAh current from the wall charger (don't have it with me so I can't look). This obviously is unacceptable as we've all discovered. So an increase to 750-800 mAh should be plenty. The phone WILL get pretty warm but nothing we haven't experienced in other models. That would drop the charge time to 2.8-2.7 hours.
Also, it would be nice to see kernel developers utilize the trickle charge so we can unplug our phones with a 100% charge, not 97%.
My rambling aside, nice find!
Really nice find
Yes I found it myself. Took a lot of digging through kernels logs and source code but it was worth it.
Here is an idea. Instead of permanently forcing hight current charging i'd love to see devs implement a dynamic rates, where one could change the rate just like we can change cpu & gpu speeds. Anyone up for SetCPU-like system for charging?
Using the stock samsung charger that came with the phone I'm testing, the rates appear dependent on how drained the battery is. If I drain the battery down to 10% and start charging from there, Battery Monitor Widget estimates at 1000 mA give or take a little. As the battery starts getting charged, Battery Monitor Widgets records the charging rate at reduced values. It ends around 260 mA or 180 mA, I forget which, would need to look back at the logs. If I start at 60%, the rate starts off lower, with the same charger.
So I think these are probably max values and there is a separate mechanism to determine actual charging rates based on battery levels.
Somebody mentioned trickle charge. Lol That reminded me of the cluster **** that topic created back in the OG EVO forums back in the days.
Sent from my Verizon Samsung Galaxy S II Epic Touch 4G WTF BBQ
sfhub said:
So I think these are probably max values and there is a separate mechanism to determine actual charging rates based on battery levels.
Click to expand...
Click to collapse
That could be true. I did see many other kernel functions that dealt with how much and how fast phone charged. The ones I quoted in OP were the ones that had actual solid numbers in them.
I'll grab my linux box tomorrow (can't do sooner) and will recompile the kernel with the changes I mentioned in OP, just to see what it does. Fingers are crossed that my phone insurance covers melted phones haha
My Battery charge very long time from 99% to 100%
but when took off the charger when it's fully charged it drops down to 99% directly...
anybody has this same problem?
zelduy said:
My Battery charge very long time from 99% to 100%
but when took off the charger when it's fully charged it drops down to 99% directly...
anybody has this same problem?
Click to expand...
Click to collapse
that's not a problem. it'd be a problem if it were to drop directly to 90% or even 95%. 99% is normal.
I like the slow charge time, you get a better charge from it. In fact I'm going to buy a cheap charger and spare battery and use that to charger my phone like I dogs with my evo
Sent from my SPH-D710 using Tapatalk
KCRic said:
Also, it would be nice to see kernel developers utilize the trickle charge so we can unplug our phones with a 100% charge, not 97%.
My rambling aside, nice find!
Click to expand...
Click to collapse
+1,000
coming from EVO and miss the trickle charge kernals
---------- Post added at 11:36 PM ---------- Previous post was at 11:35 PM ----------
flyboy1100 said:
I like the slow charge time, you get a better charge from it.
Sent from my SPH-D710 using Tapatalk
Click to expand...
Click to collapse
yeh strange, like i charged my phone from my laptop's usb,took forever, but when it was full, it was FULL. No instant drop in % when disconnect
SayWhat10 said:
+1,000
coming from EVO and miss the trickle charge kernals
---------- Post added at 11:36 PM ---------- Previous post was at 11:35 PM ----------
yeh strange, like i charged my phone from my laptop's usb,took forever, but when it was full, it was FULL. No instant drop in % when disconnect
Click to expand...
Click to collapse
Correct, that cheap external battery charger I had for my evo had a usb port that only output 350ma and I really like that, it may take 6hrs to charge but since I only plug out in when I go to sleep that is ok
Sent from my SPH-D710 using Tapatalk
Read the description.
I have to update the stuff in my kernel to the newer gingerbread sources.
Maybe someone will be able to port it over to the Epic Touch (my kernel is for the OG Epic).
=]
SayWhat10 said:
yeh strange, like i charged my phone from my laptop's usb,took forever, but when it was full, it was FULL. No instant drop in % when disconnect
Click to expand...
Click to collapse
Really? I think I'm gonna try it.. coz it's really weird to drop directly to 99% after I disconnected it, its instantly drop.. my other phone could stay 100% for a quiet long time..
HondaCop said:
Somebody mentioned trickle charge. Lol That reminded me of the cluster **** that topic created back in the OG EVO forums back in the days.
Sent from my Verizon Samsung Galaxy S II Epic Touch 4G WTF BBQ
Click to expand...
Click to collapse
Haha I remember that too. It seemed to spread like wild fire. Man that was lame
::bump::
Any upd8s, new developments, anything about this?
Yeah, I'm kind of curious about any updates too.
Buy 1A wall charger and all your charging problems solved. That's what I ended up doing.
Takes about 1.5-2 hours from very low to charge. 5A charger
Sent from a yakju GSGN

[KERNEL][4.0.3] Limited voltage charging for battery-saving paranoid and developers

This is a stock kernel for GSM Galaxy Nexus 4.0.3 with the following properties:
Root access with adb (a.k.a. insecure)
Charger is modified to stop charging at 4000mV and > 80%, and start charging again at 3990mV or < 80%.
Rationales:
Stock kernel: I value compatibility and stability. While the various mods and new features are undoubtedly very useful for many people, some of them are not well tested which results in lower stability. That is not to say stock Android is extremely stable (it is not), adding new features on top of which very often increases the likelyhood of crashes.
Limited charging: As a developer, my phone is virtually plugged in the computer all the time. As many of you are aware, leaving the phone charged greatly reduces battery life (Ref). This kernel frees you from having to unplugging and plugging in the phone repeatedly in fear of destroying your precious battery.
Visible differences:
Charging percentage will not increase after the phone is charged to 80% or more.
The phone never reports full charge, even if it's charged while being turned off. That means battery stats can accumulate which, after a while, makes it practically useless as the diagram is too compressed. This is a plus to me as I can see how I manage the battery over time, although I can make an alternate version which reports full charge whenever the phone stops charging under requests.
Perhaps I'm the only one who is paranoid about keeping battery charge between 10-90%, I wouldn't be surprised if no one is interested it this at all.
The kernel can be flashed using Odin or fastboot. If someone wants a CWM-flashable zip let me know.
Cheers.
You could have simply used my BLX mod.
Ezekeel said:
You could have simply used my BLX mod.
Click to expand...
Click to collapse
Glad to know I'm not the only one. When I was using the SGS2 I spent quite a bit of time looking for such mod to no avail. Searching for "android|galaxy nexus limit charging voltage" turned up lots of posts about changing kernel voltage which wasn't what I wanted.
I like to keep the kernel close to stock, but thanks anyway .
Hey, an idea to you devs: what about a apk that schedules the charge limit? for example, if you use to charge your phone at night and you wake up at 7 that app could charge the phone @ 60% and at 6 start charging'till it reaches the 100%
With ezekeel BLX mod it should be easy to schedule modifying the file, but i have no idea on programming nor cron
Guzmanus said:
Hey, an idea to you devs: what about a apk that schedules the charge limit? for example, if you use to charge your phone at night and you wake up at 7 that app could charge the phone @ 60% and at 6 start charging'till it reaches the 100%
With ezekeel BLX mod it should be easy to schedule modifying the file, but i have no idea on programming nor cron
Click to expand...
Click to collapse
You can do that with Tasker, it is a bit on the heavy side but saves having another service running in the background while leaves the possibility to do a lot more. I'm not aware of other light-weight but user friendly solutions for managing scripts, perhaps others could chime in.
Ezekeel said:
You could have simply used my BLX mod.
Click to expand...
Click to collapse
agree with ezekieel...his Battery Life eXtender (BLX)do the same thing(via file /sys/class/misc/batterylifeextender/charging_limit default 100),without give up at all the tweaks,oc,color control etc. try that if you want.anyway thanks for the work,personally it not interest me,but certainly someone will find it usefull!
fnf said:
This is a stock kernel for GSM Galaxy Nexus 4.0.3 with the following properties:
Root access with adb (a.k.a. insecure)
Charger is modified to stop charging at 4000mAh and > 80%, and start charging again at 3990mAh or < 80%.
Rationales:
Stock kernel: I value compatibility and stability. While the various mods and new features are undoubtedly very useful for many people, some of them are not well tested which results in lower stability. That is not to say stock Android is extremely stable (it is not), adding new features on top of which very often increases the likelyhood of crashes.
Limited charging: As a developer, my phone is virtually plugged in the computer all the time. As many of you are aware, leaving the phone charged greatly reduces battery life (Ref). This kernel frees you from having to unplugging and plugging in the phone repeatedly in fear of destroying your precious battery.
Visible differences:
Charging percentage will not increase after the phone is charged to 80% or more.
The phone never reports full charge, even if it's charged while being turned off. That means battery stats can accumulate which, after a while, makes it practically useless as the diagram is too compressed. This is a plus to me as I can see how I manage the battery over time, although I can make an alternate version which reports full charge whenever the phone stops charging under requests.
Perhaps I'm the only one who is paranoid about keeping battery charge between 10-90%, I wouldn't be surprised if no one is interested it this at all.
The kernel can be flashed using Odin or fastboot. If someone wants a CWM-flashable zip let me know.
Cheers.
Click to expand...
Click to collapse
Source code?? It has to have a link.
Since you modified the kernel
Mikey said:
Source code?? It has to have a link.
Since you modified the kernel
Click to expand...
Click to collapse
Not much to speak of tbh. Here is the patch. You can build it from the stock branch 4.0.3_r1 . I changed the compilation flags so it better matches Cortex A9 but I'm sure there are rooms for performance improvements.
GLaDOS kernel has this value configurable as well so aside from being stable, this kernel is worse all around .
I assume you meant 4000 mV, not 4000 mAh? Considering that not even extended batteries I've seen exceed 3500 mAh?
Entropy512 said:
I assume you meant 4000 mV, not 4000 mAh? Considering that not even extended batteries I've seen exceed 3500 mAh?
Click to expand...
Click to collapse
Post amended, thanks .
fnf said:
This is a stock kernel for GSM Galaxy Nexus 4.0.3 with the following properties:
Root access with adb (a.k.a. insecure)
Charger is modified to stop charging at 4000mV and > 80%, and start charging again at 3990mV or < 80%.
Click to expand...
Click to collapse
Ezekeel said:
You could have simply used my BLX mod.
Click to expand...
Click to collapse
Greetings gentlemen! I've been testing wireless charging with Galaxy Nexus and Nexus 5, and while I like the technology, I'm not comfortable with two side-effects: higher battery temperature, and higher average battery charge voltage. I'd like to work around this by limiting the charge capacity to 80% / 4.0v.
I think the lost battery capacity will work for me because the way I'm using the wireless chargers is keeping the batteries topped up all day. By keeping wireless chargers by the bed and the main work space, the phones hardly ever run down! But this also keeps the battery at 100% constantly. Thus my 5-year-old bright idea to limit the voltage!
What's the state of the art of this problem solution? Should I ask a kernel developer to include https://github.com/Ezekeel/GLaDOS-nexus-s/tree/blx ?

[KERNEL PATCH] Force AC (fast) Charging

This is for kernel devs only. The patch itself is useless to those who do not/can not compile their own kernel.
I put together this patch for you guys at the request of a few different members here in the nexus S forum who had saw my patch in the gnex forum. This allows one to force AC charging for any charger that is detected as USB (e.g. many car chargers) and pull the full current the charger can support. It also provides additional security when connecting to public charging stations because by forcing AC charging, USB/adb data transfers are disabled, protecting your data.
Fast charge can be toggled by issuing:
echo 1 > /sys/kernel/fast_charge/force_fast_charge
and off:
echo 0 > /sys/kernel/fast_charge/force_fast_charge
Some roms (AOKP) have also implemented toggles.
In addition I have created a toggle fast charge widget that may be used to toggle fast charge on and off right from your home screen:
https://play.google.com/store/apps/details?id=com.incredicontrol.fastchargewidget
For the widget (or any fast charge toggle) to work, you MUST be running a kernel that has this patch implemented.
As a good gesture to support a fellow dev, I ask that if you implement the patch into your kernel, please link to my widget as one means to toggle it. You are of course free to provide other ways to toggle it as well if you so desire.
Kernel devs, if you would like to test the widget yourself to confirm its working, and for convenience of testing, please contact me and I will provide you with a copy. You must show that you are a kernel dev though (i.e. link me to your kernel post so I can match your username).
Here you go. Good luck have fun:
http://www.incredikernel.com/wp-con...wnload.php?id=nexus_s_force_fast_charge.patch
Hopefully we will see this implemented into a lot of our kernels around here. It looks pretty sweet. If I knew how to compile kernels I'd be all over it.
Sent from my Nexus S 4G using xda premium
Thanks! I'd like to see this also!
Its been brought to my attention that the AOKP toggle interferes in some way with the widget. I'm going to contact them and see what's up. I think they may be setting the permissions of the fast charge toggle in an undesirable manner.
thank you x 1million!!! I requested this from mathkid about two weeks ago & never heard anything back....I hope this gets implemented now
hp420 said:
thank you x 1million!!! I requested this from mathkid about two weeks ago & never heard anything back....I hope this gets implemented now
Click to expand...
Click to collapse
Yup, I remember that and now its here to add! Looking forward to this
Sent from my SPH-D710 using xda premium
hp420 said:
thank you x 1million!!! I requested this from mathkid about two weeks ago & never heard anything back....I hope this gets implemented now
Click to expand...
Click to collapse
He messaged me and it took me a couple weeks to get around to it. Haha
Sent from my ADR6425LVW using XDA
chad0989 said:
He messaged me and it took me a couple weeks to get around to it. Haha
Sent from my ADR6425LVW using XDA
Click to expand...
Click to collapse
ahh, thanks for the response I'll write him and thank him for his part in researching this for matrix kernel.
any kernels on the nexus s 4g support fast charge? I cant wait to get this working! Great job!
I've always had a problem of GPS draining my phones battery no matter what ROM I'm running, or what car charger I use, been through about 5 of them. If this helps with that I'm super stoked about this, since it's the only thing that I don't like about my Nexus S.
id love to see how fast this makes charging, considering my phone already charges pretty god damned fast.
•neXus•S4G•ĄØKP•Mïlestøne 4•Aïr Kerneł 3.7•
Does anyone know if this can be ported over to the HP Touchpad?
Anyone have much luck with the fast charge toggle on this kernel? I'm helping my friend who just got a nexus s 4g and setup his touchstone from his palm pre. his phone only detects as USB while on the touchstone even though its a full 1 amp charger. Anyway if he plugs in he gets ac charging obviously. So I had him enable fast charge with this kernel and us NStools. It doesn't seem to work and actually glitches out and charges slower to the point that it never increases even with screen off. It indeed says ac in settings. If he then plugs into regular ac outlet it continues charging slow where it won't increase even a single percent for 20 min. Restoring stock kernel goes back to normal.
Anyone had any luck with fast charge? We're kinda baffled here. I know the nexus s is a slow charging phone already at 750 mA. anyone have any ideas? Thanks.
So I realize this is a bit of an older thread, but since it got bumped anyway...
Isn't this about the same thing as SBC? Meaning, won't this trash your battery very quickly? Fast charging is designed to be something that's only done in emergency situations (which is why people say only to use car chargers in emergency situations) otherwise it will kill your battery. This really shouldn't be something to use in a daily driver kernel.
thunder2132 said:
So I realize this is a bit of an older thread, but since it got bumped anyway...
Isn't this about the same thing as SBC? Meaning, won't this trash your battery very quickly? Fast charging is designed to be something that's only done in emergency situations (which is why people say only to use car chargers in emergency situations) otherwise it will kill your battery. This really shouldn't be something to use in a daily driver kernel.
Click to expand...
Click to collapse
car chargers charge your phone at a slower rate than a wall charger so no its absolutely fine for car chargers your other part i have no clue.
thunder2132 said:
So I realize this is a bit of an older thread, but since it got bumped anyway...
Isn't this about the same thing as SBC? Meaning, won't this trash your battery very quickly? Fast charging is designed to be something that's only done in emergency situations (which is why people say only to use car chargers in emergency situations) otherwise it will kill your battery. This really shouldn't be something to use in a daily driver kernel.
Click to expand...
Click to collapse
There are two charge modes: USB and AC. The phone determines the mode by reading the resistance value between the two USB data pins. If the value is zero, the phone charges in AC mode, which draws > 500mA current (eg. wall charging). If the resistance is very high, it charges in USB mode and draws <= 500mA of current (eg. charging from a computer USB port).
What this patch does is it forces the phone into AC mode so that it can draw higher current and charge faster. Hope it clears up your confusion.
Si_NZ said:
There are two charge modes: USB and AC. The phone determines the mode by reading the resistance value between the two USB data pins. If the value is zero, the phone charges in AC mode, which draws > 500mA current (eg. wall charging). If the resistance is very high, it charges in USB mode and draws <= 500mA of current (eg. charging from a computer USB port).
What this patch does is it forces the phone into AC mode so that it can draw higher current and charge faster. Hope it clears up your confusion.
Click to expand...
Click to collapse
That makes a bit more sense, I had my A's and D's crossed there. So basically this just helps speed up the charge if you're charging from a pc then. Gotcha.

Running hot!

Is there a reason why ics rooms run hot under the same conditions as gb roms?
Sent from my SPH-4710 using Tapatalk 2
Mines never run hot on either GB or ICS.
That doesn't help mine obviously can't b the only one. Its happening while charging via car charger and watching a video
Sent from my SPH-4710 using Tapatalk 2
Mine only gets hot when on wifi or 4g.
Sent From My IcE Cold E4GT
Gb doesn't do this it runs fine and cool and charges fast on ics it barely trickle charges and burning up
Sent from my SPH-4710 using Tapatalk 2
btaylor545 said:
That doesn't help mine obviously can't b the only one. Its happening while charging via car charger and watching a video
Sent from my SPH-4710 using Tapatalk 2
Click to expand...
Click to collapse
Just giving you a little feedback about my phone.
Which roms have you tried? This is a pretty generic statement, without more info I doubt you will get a very constructive answer.
Sent from my ridiculously long named phone ---
Sprint Samsung Galaxy S II Epic 4G Touch
Very true Sry ran hot on the newest aokp build 39 and CM9 alpha 5 for ics roms and IM running calks 3.0 and have ran blazer both with no issues
Sent from my SPH-D710 using Tapatalk 2
Give blue kuban a try. I had some issues with AOKP but that was several builds ago. I remember certain games made it run really hot but not every time.
Sent from my ridiculously long named phone ---
Sprint Samsung Galaxy S II Epic 4G Touch
im running cm9 alpha 4 and while on the charger last night i got call and answered it, it damn near burned my ear off.
threw on my clarus widget and that ***** was running at 111 degrees.
Ya mine was running so hot today it wouldn't charge on my car charger (in an a/c'd car) had it on there for 3hrs and it didn't charge past 40% restored back to caulks gb (barely had 8% battery left after restore) and in an hr I was at 90% and the phone was at room temperature.
Sent from my SPH-D710 using Tapatalk 2
This happens to me from time to time, usually when using large amounts of data in poor signal areas.
GPS and the car charger usually makes for a hotter than normal device as well. This was true on my evo, tp2 and tp also.
Sent from my SPH-D710 using Tapatalk 2
Mine has ran hot on every ICS rom. I havent used any akop or cm9 roms. Mine does it every now and again and all I do is reboot leave it alone for a couple minutes and its back to normal. I haven't ssen a rhyme or reason to when mine runs hot other than when its on and off of a charger. I have changed several things and nothing seems to help. My screen also get hot sometimes but it has been like this now ever since I started using ICS roms 6 or 8 months ago.
Car charger Vs. AC charger
Could part of your problem also be that since the car charger is set on a 12VDC input, but most cars while running are at 13-14VDC, could be pushing a high voltage to your battery than the AC charger? Don't know if that helps just some input. Mine runs hotter (99* F) when I'm charging in the car. 80* F when I'm charging with my AC charger. (My car's voltage while its running is 13.5VDC) I'm running stock ROM with Rogue_ET-1.5.0+ kernel, OC/UV @ 1400 MHz step.
g_ding84 said:
Could part of your problem also be that since the car charger is set on a 12VDC input, but most cars while running are at 13-14VDC, could be pushing a high voltage to your battery than the AC charger? Don't know if that helps just some input. Mine runs hotter (99* F) when I'm charging in the car. 80* F when I'm charging with my AC charger. (My car's voltage while its running is 13.5VDC) I'm running stock ROM with Rogue_ET-1.5.0+ kernel, OC/UV @ 1400 MHz step.
Click to expand...
Click to collapse
Normal charging voltage for a vehicle is around14 volts. When your engine its off you will see 12.6 volts. Typical cell battery is around 3 volts. Your car charger is designed to reduce that voltage to the proper level. They are designed to handle those fluctuations. I use a oem Motorola charger I got for6 bucks on Amazon. I dont have nearly as many issues as I did with the generic charger I had before. You get what you pay for
Been doing electrical work for over a decade and rebuilt alternators for 3. So trust me when I say I know what I am talking about.
Sent from my ridiculously long named phone while firing up a Blu Kuban ---
Sprint Samsung Galaxy S II Epic 4G Touch
g_ding84 said:
Could part of your problem also be that since the car charger is set on a 12VDC input, but most cars while running are at 13-14VDC, could be pushing a high voltage to your battery than the AC charger? Don't know if that helps just some input. Mine runs hotter (99* F) when I'm charging in the car. 80* F when I'm charging with my AC charger. (My car's voltage while its running is 13.5VDC) I'm running stock ROM with Rogue_ET-1.5.0+ kernel, OC/UV @ 1400 MHz step.
Click to expand...
Click to collapse
Ravaged Pheonix said:
Normal charging voltage for a vehicle is around14 volts. When your engine its off you will see 12.6 volts. Typical cell battery is around 3 volts. Your car charger is designed to reduce that voltage to the proper level. They are designed to handle those fluctuations. I use a oem Motorola charger I got for6 bucks on Amazon. I dont have nearly as many issues as I did with the generic charger I had before. You get what you pay for
Been doing electrical work for over a decade and rebuilt alternators for 3. So trust me when I say I know what I am talking about.
Sent from my ridiculously long named phone while firing up a Blu Kuban ---
Sprint Samsung Galaxy S II Epic 4G Touch
Click to expand...
Click to collapse
Hmmmmm this makes sense if it was doing this for all roms but just for ics roms still makes no sense plus its done it on my normal charger as well like the other guys above.
Sent from my SPH-D710 using Tapatalk 2
Download Tegrak and try to undervolt your CPU.
CPU gets overworked for many reasons, poor signal, lots of data, many processes, etc.
Overheated CPU overheats battery then battery charging turns itself off.
When I was with AT$T (note my sig), they throttled my data. To them they were just slowing me down. For me, it basically made my phone a brick during the throttled periods because it overworked the processor trying to pull a bowling ball through a garden hose. I made them waive my EFTs because I showed then they were physically damaging my phone with their "new" policy. Sorry for the rant...
Ravaged Pheonix said:
Normal charging voltage for a vehicle is around14 volts. When your engine its off you will see 12.6 volts. Typical cell battery is around 3 volts. Your car charger is designed to reduce that voltage to the proper level. They are designed to handle those fluctuations. I use a oem Motorola charger I got for6 bucks on Amazon. I dont have nearly as many issues as I did with the generic charger I had before. You get what you pay for
Been doing electrical work for over a decade and rebuilt alternators for 3. So trust me when I say I know what I am talking about.
Sent from my ridiculously long named phone while firing up a Blu Kuban ---
Sprint Samsung Galaxy S II Epic 4G Touch
Click to expand...
Click to collapse
I belive you. Lol. Im work on generators and hvac sysytems. Good to knpw though about the chargers.
Oh just found this out. My wife has a cheap charger we have had for years. It just started flaking out on her. If the voltage to the phone gets too high the phone will beep and come up with a warning about the voltage being to high and charging will stop. So your charger definitely is not directly causing the hot battery
Sent from my ridiculously long named phone while firing up a Blu Kuban ---
Sprint Samsung Galaxy S II Epic 4G Touch
I'm using a new Duracell charger its cheap but nvr got a warning or anything from using it
Sent from my SPH-D710 using Tapatalk 2

Working Fastcharge mode in Vicious Jelly Bean V5 with Faux Kernel.

I am playing with Fastcharge in JB with the Faux Kernel. Here are the specifics of my experiment.
App: Galaxy Nexus Fast Charge (from market). I wish there was a toggle or widget but I'll probably have to wait for AOKP JB.
All charges were done with networking OFF, screen OFF. I would have liked to do a longer experiment but I didn't have time and didn't think extending the experiment time would yield a noticeable difference.
The phone did in fact register as an INTF2 device when I turned on fastcharge, where it shows as a Media Device when it's in USB mode. This is the same as when I had it in ICS (AOKP) with Franco Kernel, which definitely worked (very well).
Phone: Galaxy Nexus LTE
Carrier: Verizon
ROM: Vicious Jelly Bean V5
Kernel: Faux Kernel JB 019
Fastcharge OFF, 10 minutes, USB = 5%
Fastcharge ON, 10 minutes, USB = 9%
I wanted to see if it would also change the voltage/amperage draw from the stock charger that came with the phone.
Fastcharge OFF, 10 minutes, AC = 9%
Fastcharge ON, 10 minutes, AC = 9%
AC was same as expected. I didn't know the kernel had fast charge mode since it doesn't brag this feature but apparently it does.
This is good news considering the poor battery life I've gotten with Vicious JB/Faux Kernel compared to the great life with AOKP ICS/Franco Kernel.
look4alec said:
I am playing with Fastcharge in JB with the Faux Kernel. Here are the specifics of my experiment.
App: Galaxy Nexus Fast Charge (from market). I wish there was a toggle or widget but I'll probably have to wait for AOKP JB.
All charges were done with networking OFF, screen OFF. I would have liked to do a longer experiment but I didn't have time and didn't think extending the experiment time would yield a noticeable difference.
The phone did in fact register as an INTF2 device when I turned on fastcharge, where it shows as a Media Device when it's in USB mode. This is the same as when I had it in ICS (AOKP) with Franco Kernel, which definitely worked (very well).
Phone: Galaxy Nexus LTE
Carrier: Verizon
ROM: Vicious Jelly Bean V5
Kernel: Faux Kernel JB 019
Fastcharge OFF, 10 minutes, USB = 5%
Fastcharge ON, 10 minutes, USB = 9%
I wanted to see if it would also change the voltage/amperage draw from the stock charger that came with the phone.
Fastcharge OFF, 10 minutes, AC = 9%
Fastcharge ON, 10 minutes, AC = 9%
AC was same as expected. I didn't know the kernel had fast charge mode since it doesn't brag this feature but apparently it does.
This is good news considering the poor battery life I've gotten with Vicious JB/Faux Kernel compared to the great life with AOKP ICS/Franco Kernel.
Click to expand...
Click to collapse
wrong section
j.curtis.369 said:
wrong section
Click to expand...
Click to collapse
Can a Mod move it please? I never post as you can see. I am not sure where it would belong, as it's more of a Kernel review than anything.
Nexus noob here. What is fastcharge? Does it basically remove any USB connection options and increase the charging speed?
Those guys did compile a GSM version I found it fishing around inside Goo and someplace else. I never flashed it but I did find one (Team Vicious)
Again ( Add This To Your Signature )
READ BEFORE POST
LOOK WHERE YOU POST
bittermormon said:
Nexus noob here. What is fastcharge? Does it basically remove any USB connection options and increase the charging speed?
Click to expand...
Click to collapse
1 A = 1 Amp
1 mA = 1 Milliamp (.001 Amps)
A charging AC port can give up to 1.5A through a USB cable, but when connected to a regular port (computer, some chargers), it only provides up to 500mA (0.5A).
What fastcharge does is allow the phone to view the USB connection not as a USB hub or computer, but as a devoted AC charger. This adds much Amperage and vastly improves charging. This allows you to plug into a computer and charge at nearly the same speed as your devoted AC charger. It also helps with car chargers, which for some reason can be stingy.
Some Kernels support this, and many roms have the toggle built in. I started loving it using AOKP, thinking it was BS, but it actually works very well. With AOKP and Franco kernel, I could charge my battery fully from car or USB in an hour, double the time it would take without fastcharge.
Only draw back is you lose the ability to transfer files via that USB connection (the connection to computer shows up as "INTF2" instead of "Media Device." No matter how you feel about it, it's great to have the option to suck some extra battery life, especially considering how crucial my phone is to my existence (I wish I was joking). So now when I'm at my friend's, if he has any device which takes a USB A to USB micro b (what droids use) then I don't need a wall charger and it will have nearly the same effect.
I was testing to see if the custom JB Kernels supported this feature, since I know with ICS and GB, the stock kernels wouldn't allow it. This is very exciting as now AOKP can built in the toggle and don't have to stress about how well it works or whether the majority of kernels support it.
look4alec said:
1 A = 1 Amp
1 mA = 1 Milliamp (.001 Amps)
A charging AC port can give up to 1.5A through a USB cable, but when connected to a regular port (computer, some chargers), it only provides up to 500mA (0.5A).
What fastcharge does is allow the phone to view the USB connection not as a USB hub or computer, but as a devoted AC charger. This adds much Amperage and vastly improves charging. This allows you to plug into a computer and charge at nearly the same speed as your devoted AC charger. It also helps with car chargers, which for some reason can be stingy.
Some Kernels support this, and many roms have the toggle built in. I started loving it using AOKP, thinking it was BS, but it actually works very well. With AOKP and Franco kernel, I could charge my battery fully from car or USB in an hour, double the time it would take without fastcharge.
Only draw back is you lose the ability to transfer files via that USB connection (the connection to computer shows up as "INTF2" instead of "Media Device." No matter how you feel about it, it's great to have the option to suck some extra battery life, especially considering how crucial my phone is to my existence (I wish I was joking). So now when I'm at my friend's, if he has any device which takes a USB A to USB micro b (what droids use) then I don't need a wall charger and it will have nearly the same effect.
I was testing to see if the custom JB Kernels supported this feature, since I know with ICS and GB, the stock kernels wouldn't allow it. This is very exciting as now AOKP can built in the toggle and don't have to stress about how well it works or whether the majority of kernels support it.
Click to expand...
Click to collapse
What a spot on post! And, yes, I really like how much AOKP supports, even though I'm not currently using it - who isn't using JB?
Yes, the JB kernels have started to re-implement features as JB is better understood. Franco's is also running great with JB (Official or AOSP).
Please Note: You may forget that you've unleashed the charging potential of whichever connection you're using. Remember, you will need to disable fast charge to use your phone's data connection properly. I'm guilty of forgetting myself from time to time. Nothing like being aggravated at something you did to yourself and can't figure out. lol
kynolin said:
What a spot on post! And, yes, I really like how much AOKP supports, even though I'm not currently using it - who isn't using JB?
Yes, the JB kernels have started to re-implement features as JB is better understood. Franco's is also running great with JB (Official or AOSP).
Please Note: You may forget that you've unleashed the charging potential of whichever connection you're using. Remember, you will need to disable fast charge to use your phone's data connection properly. I'm guilty of forgetting myself from time to time. Nothing like being aggravated at something you did to yourself and can't figure out. lol
Click to expand...
Click to collapse
Are you talking 3G/4G? I did not know it interferes! Does it interfere even when you're not charging? Have you tried Faux Kernel? I really like Franco but many were saying it conflicted with Vicious. Which Franco are you using? New nightly? I saw that he added JB support but the consensus on the Vicious forum is Faux. It seems alright but not as good as I was getting, battery-wise.
This is such an exciting time to be an Android user with the best (at least most supported) phone!
Any way of getting fast charge setting to stick after a reboot? Seems you have to enable it all the time.

Categories

Resources