New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
LibiSC
Old
(Last edited by LibiSC; 2nd December 2012 at 06:53 PM.)
#1  
Senior Member - OP
Thanks Meter 505
Posts: 466
Join Date: Mar 2012
Default [KERNEL] 02122012-- Battery extender 1.6 -- STOCK ROMS

I found this kernel mod donde for Nexus S.


http://forum.xda-developers.com/arch...t-1257497.html

I think maybe i could try to port it to galaxy ace. C++ stuff. Tell me if it's not technically possible so i can quit





Alpha 1: 11/04/2012
-Deprecated
-Changed source to make battery percentage reading more accurated (didn't touch voltage settings yet)
- Forgot to put a name so no changes in system information
- I flashed it overt cf root and didnt lose cf root stuff so same for you probably
-After recharging you will see a quick drop because battery doesnt charge till max (70% aprox) after that should be accurate. tell me if you see the difference

Lol i forgot to upload the file. Just use cwm to flash it (choose zip from sdcard) and wipe dalvik cache.

Alpha 2: 12/04/2012 (zImage-Mod.v1.5+Battery_patch1.1-sign.zip) for cyanogenmod roms.

- 4V bug fixed. It will show mV instead.
- Change rpc timing to see if makes it refresh faster.
- Using dragonnn's patches - zImageMod cause i can't make the flashable zip yet (thanks man)

Alpha 3: 22/04/2012 (batteryPercent_alpha3STOCK.zip) Tested on DDKQ8

- 4V bug fixed. It will show mV instead.
- Change rpc timing to see if makes it refresh faster.
- Some options added in config file to achieve more battery life.
- IT'S FOR STOCK ROMS ONLY.

Alpha 4: 25/04/2012

(batteryExtenderAlfa4.zip) Teste on DDKQ8

(batteryExtenderAlfa4CustomRom.zip) Tested on custom rom


- Added Smartassv2 (cause it's the one i use, ask if you want other)
- Changed battery source to allow to function a little more with low charge (i think that works but i need confirmation)
- added advance power emulation and voltage something in config (just to try it)
- Still for stock
- Ext3, ext4 activated in config

I tried to let it charge more than the normal charge... but apparently it will need serious depuration to find out what's blocking me (damn).
i dont remember where i saw wifi drivers... when i remember i'll add them.

[Beta1:batteryExtenderbeta1.zip: 29/04/2012

Sames as alfa 4 but some bug fixes were done.
(not important things)

Also tried to overcharge it but seems that is not possible...hardware is controlling max charging.


batteryExtenderRC.zip: 21/05/2012


Well i've been playing with code for a while. I realized that the maximum real charge is 3700mV... but after the power is cut i drops very fast... so that's why samsung dudes put it in 3632 as maximum... but wasn't enough... so i lowered even more to 3400 mV.... but it doesn't mean we get less battery life... we just see 100% early... still you have to wait till full charge notification to unplug it.

Everybody knows that the screen lowers brightness in 10% so to avoid going darker faster because of the new maximum i have lowered the minimum to compensate (It will give more battery life in theory too but you tell me).

Also i changed the full battery notification to stop waiting for the counter (¿?) they used instead i'm using a maximum of 3660 mV real voltage ( if you realize it's higher than 3400 mV).

I changed a couple of things more but i can't remember ... I have not focused enough on it sorry I have a job and stuff xD

I wanted to check skynet's kernel and add some stuff but i've been pretty busy so i couldn't even add the governor i promise... i will add it later sorry.

I think it's all i can do with the battery code for now

Dropbox url... "20.zip"

http://dl.dropbox.com/u/73853654/20.zip


also in attachments batteryExtenderRC.zip

Tested in Cheetah v2... custom rom from tj_droid based on stock DDKQ8


batteryExtenderRC1.1.zip: 24/05/2012

-Went back to use counter cause it kinda stabilize voltage... also corrected a bug cause i ****ed up a sign xD (> instead of <)
-Added some tweaks i found related to deadline and other stuff

From now on i will copy stuff from githubs i find cause i can't do anything more for the battery code.

batteryExtenderRC2.0.zip: 26/05/2012

- Added all the mainstream governors (intellidemand is the coolest of all of them, i just don't get lulzactive)

- Added SIO, CFQ and Noop scheduler

- Some tweaks from skynet's kernel
+Added ARM CPU topology
+ Frequency table... i think it contains the voltage... not really sure but paste differences to try
+Disabled fsync
+Optimized rcutree-better application responsiveness.
+Some other tweaks.

-This one includes also the other tweaks i found before in other kernel (I lost the page but wasn't a galaxy ace but a galaxy device)


All credits to skynet for the new things in his kernel and me for gathering new and old stuff xD


batteryExtenderRC2.1.zip: 27/05/2012

- Reduced the number of governors cause one of them was causing reboots when the screen was off... not sure wich one... i left the most important... i'll add the others when i fix it.
- Found the page where i took the other changes and they are
+mmc: core: eMMC in Sleep mode before suspend
+some other tweaks (page writeback... lowmemorykiller)
+cpuidle: extend cpuidle and menu governor to handle dynamic states

And now the name of the kernel appears in system info ... lol



batteryExtenderRC2.2.zip: 28/05/2012
For stock Roms..

-Increase lower bound value cause it goes to fast from 10% to shutdown.
- Some secret stuff xD tell me if you feel it better or worse... I won't tell you so you dont get influenced by it.


batteryExtender1.0.zip: 02/06/2012

- More features from skynet`s kernel
+Changed voltage of wifi
+Dmcache
+cleancache
+And some more

-Restored governors except lulzactive that was causing the reboots.
-Changer battery driver so update time will go from 1 seconds to 60 seconds in suspend mode and some other stuff


And no more changes til linux kernel 3.4 with android merged lol


batteryExtender1.1.zip: 03/06/2012

-Hotfix:Lower bound was too low again... sorry i noticed when i commited to github

batteryExtender1.2.zip: 08/06/2012

-Added BLN support
-Added Cpu OC cappabilities
- Added wakelocks on battery driver to see if helps.... i read some pages and the issue with the inaccurate battery readings also happens in a lot of devices even if they implement the fuel gauge... so dont expect it to be fixed easyly.... maybe when a new official kernel comes.... by official i mean android merged to the main branch of linux

I find BLN pretty lame but many people ask for it... so if you dont like just dont use it like me.

I find OC pretty dumb too in an smartphone at least it is impress a geek girl... but i added anyway..

Enjoy...

batteryExtender1.3.zip: 16/06/2012
-Removed wake_locks cause didnt help and had conflicts for some users.
-Removed some stuff that might cause a little lag for some people.
-Increased lower bound
-Trying something for better readings

batteryExtender1.3.1.zip: 17/06/2012
-Sysfs it's kind of lazy... so i changed update value to 1 sec. Tell me if the sudden drops diminish or increase.


batteryExtender1.4.zip: 27/06/2012
- Core power manager class and cpuidle ported from Linux 3.2 (thanks to dragonnn for the tip)
- cgroup class from linux 3.4
- removed stuff testing in battery driver cause was messing with the proximity sensor but the update time is fast.... better distributed the ranges bigger in lower values to try avoid great falls

batteryExtender1.4.1.zip: 12/07/2012
- Just changed method that calculates percentages.... a mod of the method in the original driver... a hotfix will be more tweaked later. This is for the fast drops between 20% and 0%.
batteryExtender1.4.2.zip: 12/07/2012

-Another approach to the problem similar to 1.4.1... Two twins version one with OC and one without it. In this version you are the testers if something behaves funny just rollback ti 1.4.1


batteryExtender1.5.zip: 17/07/2012

-I decided to add the things that were missing from skynet original kernel.... So i added frontswap and zcache in the config and activated the stuff needed to make it work (now swap it's activated to be use in frontswap i dont recommend it using it for something else) and double the battery life i got with my normal use.

-Also added a new step in frequencies from draggonn firekernel and some modifications in tcp and classes that used cleancache (It might be the cause for the pump in the battery life but i checked the config and zcache is not activated im gonna ask him later).

Link in dropbox cause it wont let me upload one here

BatteryExtender1.5

[B]batteryExtender1.5.1.zip: 04/08/2012

Fsync was activated for some reason so woops. I deactivated... also some other small changes. Battery driver is the same.
This time NONOC and OC.

batteryExtender1.6.zip: 02/12/2012

- Mutex backporte from linux kernel 3.5
- Crc32 optimization
- Zram/Zcache/Cleancache fully enabled (i had a feeling something was missing, I uploaded a script to activate it for sure)
enablezram



If you like it dont hit thanks... grab a potatoe and worship it

To do list:

-Kernel compiling/flashing tutorial
-Add governors.(done)
-Change voltage source code methods (done)




thx to an0nym0us_
thx to dragonnn
thx to tossan
thx to skynet28


According to blah blah blah here is the link to the github with the Source code
Attached Files
File Type: zip batteryExtenderRC.zip - [Click for QR Code] (5.85 MB, 268 views)
File Type: zip BatteryExtenderRC1.1.zip - [Click for QR Code] (5.85 MB, 123 views)
File Type: zip BatteryExtenderRC2.0.zip - [Click for QR Code] (5.88 MB, 177 views)
File Type: zip BateryExtenderRC2.1.zip - [Click for QR Code] (5.87 MB, 202 views)
File Type: zip BatteryExtenderRC2.2.zip - [Click for QR Code] (5.87 MB, 338 views)
File Type: zip BatteryExtender1.0Final.zip - [Click for QR Code] (5.93 MB, 337 views)
File Type: zip BatteryExtender1.1Final.zip - [Click for QR Code] (5.93 MB, 398 views)
File Type: zip BatteryExtender1.2.zip - [Click for QR Code] (5.93 MB, 1147 views)
File Type: zip BatteryExtender1.3.zip - [Click for QR Code] (8.95 MB, 282 views)
File Type: zip BatteryExtender 1.3.1.zip - [Click for QR Code] (8.95 MB, 559 views)
File Type: zip BatteryExtender1.4.zip - [Click for QR Code] (8.95 MB, 933 views)
File Type: zip BatteryExtender1.4.1.zip - [Click for QR Code] (8.95 MB, 326 views)
File Type: zip BatteryExtender1.4.2OC.zip - [Click for QR Code] (8.95 MB, 300 views)
File Type: zip BatteryExtender1.4.2.zip - [Click for QR Code] (8.95 MB, 479 views)
File Type: zip batteryextender1.5.1OC.zip - [Click for QR Code] (8.89 MB, 1518 views)
File Type: zip batteryextender1.5.1.zip - [Click for QR Code] (8.89 MB, 4554 views)
File Type: zip BatteryExtender1.6.zip - [Click for QR Code] (8.92 MB, 4062 views)
The Following 132 Users Say Thank You to LibiSC For This Useful Post: [ Click to Expand ]
 
LibiSC
Old
(Last edited by LibiSC; 5th June 2012 at 05:42 AM.)
#2  
Senior Member - OP
Thanks Meter 505
Posts: 466
Join Date: Mar 2012
SOME IMPORTANT INFO:

there is an excel file in attachments that shows how battery behaves based on the method

calculate_batt_voltage

the method makes sense cause the difference between real (voltage dc) and voltage used to calculate percentage is little in high values and big in lower values.

Values are constants in source code.

So i didn't change the method, just changed the lowest value used. I tried to change highest value but it is regulated somewhere else, I haven't found where yet.

Source in attachment ( i didnt do much really)
Also pics of the battery life I achieved ( first time i've gotten these values so i think that my kernel works)

Edit:24/05/2012

Latest source in attachment
Attached Thumbnails
Click image for larger version

Name:	SC20120428-175605.png
Views:	8407
Size:	26.0 KB
ID:	1030009   Click image for larger version

Name:	SC20120428-175611.png
Views:	8481
Size:	18.5 KB
ID:	1030010   Click image for larger version

Name:	SC20120428-175622.png
Views:	6986
Size:	13.4 KB
ID:	1030011   Click image for larger version

Name:	SC20120428-175626.png
Views:	6721
Size:	17.7 KB
ID:	1030012   Click image for larger version

Name:	SC20120428-175631.png
Views:	6290
Size:	18.1 KB
ID:	1030013  

Click image for larger version

Name:	SC20120428-175706.png
Views:	6483
Size:	198.8 KB
ID:	1030014  
Attached Files
File Type: xlsx batteryBehaviour.xlsx - [Click for QR Code] (83.6 KB, 646 views)
The Following 14 Users Say Thank You to LibiSC For This Useful Post: [ Click to Expand ]
 
CallMeVentus
Old
#3  
CallMeVentus's Avatar
Recognized Contributor
Thanks Meter 2661
Posts: 9,311
Join Date: Jul 2011
Location: Singapore
You don't even have a compiler

You might also want to edit the various paths so that the path isn't stuck at /home/carlos

Defy-ing all limits.
TeamCooper:
www.teamcooper.net



GitHub:
Personal: www.github.com/EmoBoiix3
CyanMobile: www.github.com/CyanMobile
TeamFun (a.k.a GingerDX): www.github.com/TeamFun

Read this if you are new to your Galaxy Ace





"My friends are my power, and I'm theirs!"
"I am the boy with the heart of pure light."
 
LibiSC
Old
#4  
Senior Member - OP
Thanks Meter 505
Posts: 466
Join Date: Mar 2012
Lol i do. That message was confusing me. The real error was that there wasnt a param folder in the source i downloaded. So I created one and a Makefile within it and everything went ok.
 
shailpancholi
Old
#5  
shailpancholi's Avatar
Senior Member
Thanks Meter 73
Posts: 605
Join Date: Dec 2011
Location: Mumbai
Dnt post this unless yu getting it

Thanx meter is all he wants:thumbdown::thumbdown::thumbdown::thumbdown:: thumbdown::thumbdown::thumbdown::thumbdown::thumbd own::banghead:

show off is immature *-*
°_° ™®©¶√π
 
LibiSC
Old
#6  
Senior Member - OP
Thanks Meter 505
Posts: 466
Join Date: Mar 2012
that's where you are wrong (8).... I can't be the only one trying new things... people would google the same problem and would appear fixed here... so everybody learns... don't hate for no reason

P.D: i dont care about thanks it's just curiosity
The Following 2 Users Say Thank You to LibiSC For This Useful Post: [ Click to Expand ]
 
sergeantgeneral
Old
#7  
sergeantgeneral's Avatar
Senior Member
Thanks Meter 62
Posts: 107
Join Date: Jan 2012
Location: Sector 53,Mayall II, in the Andromeda Galaxy
Quote:
Originally Posted by LibiSC View Post
I got trouble when make clean. Any suggestion would be appreciated

make: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found
/home/carlos/kernel****/linux2/scripts/gcc-version.sh: line 25: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: No such file or directory
/home/carlos/kernel****/linux2/scripts/gcc-version.sh: line 26: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: No such file or directory
scripts/Makefile.clean:17: /home/carlos/kernel****/GT-S5830_Kernel/drivers/param/Makefile: No such file or directory
make[2]: *** No rule to make target `/home/carlos/kernel****/GT-S5830_Kernel/drivers/param/Makefile'. Stop.
make[1]: *** [drivers/param] Error 2
make: *** [_clean_drivers] Error 2
Do you know what exactly are you doing?
Do you know you should have the galaxy ace sources and should patch the above mod into kernel sources? Do you know you require a cross-compiler like codesourcery lite to compile the kernel and adjust the make file to the location of cross-compiler?
If not....then you are going nowhere...
Windows users are really dumb and will never understand the utility of linux..Hail Linux.
 
Prashanthme
Old
#8  
Prashanthme's Avatar
Senior Member
Thanks Meter 280
Posts: 1,236
Join Date: Sep 2011
Location: ಬೆಂಗಳೂರು-Bengaluru
I tought it was ported!!! It was suppossed to be posted in GENERAL section for request porting... First change the name or ask the mod to move the thread to GENERAL... [SHOCKED]


Emotion Injected; LOVE Infected!!
XDA ಅಲ್ಲಿ ಕನ್ನಡದ ಕಂಪು ಹರಡುತ್ತಾ

Phones:

Samsung Galaxy S2


ROMAHOLIC


Previous Gadgets: Nokia 5200 --> Nokia 5230 --> Samsung Galaxy ACE.
 
LibiSC
Old
(Last edited by LibiSC; 10th April 2012 at 04:00 AM.)
#9  
Senior Member - OP
Thanks Meter 505
Posts: 466
Join Date: Mar 2012
Quote:
Originally Posted by sergeantgeneral View Post
Do you know what exactly are you doing?
Do you know you should have the galaxy ace sources and should patch the above mod into kernel sources? Do you know you require a cross-compiler like codesourcery lite to compile the kernel and adjust the make file to the location of cross-compiler?
If not....then you are going nowhere...
I was just testing that the original source compiles to go and make the changes.

S5830 kernel is open source. I downloaded it and will just do the same that the dude did for galaxy S. If nothing happens then the battery source may be other. I have an idea of what I'm doing. "trust me. i'm an engineer"
 
CallMeVentus
Old
#10  
CallMeVentus's Avatar
Recognized Contributor
Thanks Meter 2661
Posts: 9,311
Join Date: Jul 2011
Location: Singapore
An engineer = able to debug such simple ****

Defy-ing all limits.
TeamCooper:
www.teamcooper.net



GitHub:
Personal: www.github.com/EmoBoiix3
CyanMobile: www.github.com/CyanMobile
TeamFun (a.k.a GingerDX): www.github.com/TeamFun

Read this if you are new to your Galaxy Ace





"My friends are my power, and I'm theirs!"
"I am the boy with the heart of pure light."