[Galaxy S II General] robertobsc:
Hi guys,

I had a little frustration, because two of the 4 things I told in that post don't save battery. And the reason is, to we undervolt a "driver" (cpu, gpu, etc) We need to change it specifically. But what we changed here was their regulators.

A regulator is a constraint. It doesn't change any voltage at all. When we change it he just allows the "driver" of that group changes it voltages between the min_volt / max_volt specified on regulator.

Example. I want to undervolt gpu to 750. But the gpu is "ruled" by a regulator. If I want to undervolt I must change gpu voltages and also change the min_volt of the regulator to 750. When I change it I tell that the gpu can be undervolted to 750, but I didn't undervolted in that moment. Got it?

So, the great internal voltages made in regulator of phenomenal are useless.

So the only thing that really do work in my post is the cpu asv voltages (the first two variables of the script).

So, that's all folks. We could try undervolting gpu less then 800 by changing it file + changing it's min_volt regulator with kmemhelper. In fact, I don't think this post is over. I'll try to find out which driver is been regulated by these regulators we are changing, then I'll add here, in the script.

==================

DO IT AT YOUR OWN RISKS

This is a advanced topic. Don't apply the things above if you don't understand it.

Hi people!

This thread is for all who wants who suffer from the "undervolting to save battery" disorder :D

In fact i would any undervolts that were possible to save battery. Today we can easily undervolt cpu and gpu, with apps. What is not so easy to undervolt is the internal voltages.

- "OMG! Internal Voltages?!?! You are going to crash your system!!!"

Calm, don't panic. Let's take a look in Phenomenal's Kernel. I think you agree with Phenomenal's good battery saving, at least reasonable. But what Phenomenal do? He is the SpeedMod Kernel compilated with cpu and gpu undervolting +

internal undervoltings

(in extreme variation)!

But i personally love the Siyah Kernel. 2 rom's, a lot of funcionalities, etc.

So i decided to apply the internal voltages of Phenomenal in Siyah Kernel!

Observation: This is not a guide that teaches undervolting values and approaches, that guide shows what to undervolt!

With the help of Phenomenals tutorial and droidphile's tutorial we can figure out how to do it.

The kmemhelper binnary can read and write variables at the kernel's memory address. In fact, he can get/set all variables that are in /proc/kallsysms.

Observaton: It may be possible to do it in other kernel's, but the variables must be in /proc/kallsyms and you MUST look in kernel's source code to be sure that the variable is really the one.

So, what we want to do is:

1 - Get the variables name that stores internal voltages

2 - See the values that they have

3 - Set the new values via init.d script.

What else you'll need:

1 - Script Manager

At this point a liitle observation:

From one version of Siyah to another, the values could be changed. It's kernel's owner call. With init.d we'll always overwrite his changes (if he does). But that's not a problem at all, since we want to undervolt and we can control how much we'll undervolt.

To get the variables names i first looked in Phenomenals tutorial. After that its necessary to look inside Siyah's source code to make sure that their names is the same.

Okay, so we got that the variables that contain the internal voltages are:

bus and cpu internal voltages:

exynos4_busfreq_table[] (-100000 in extreme)

exynos4_asv_volt[] (-50000 in extreme)

screen voltages:

ldo13_init_data (-300000 in extreme)

ldo18_init_data (-300000 in extreme)

memory voltages:

buck5_init_data (-100000 in extreme)

A really important thing: The stock internal voltages values are in Phenomenal's tutorial. So you undervolt that values, not the values that are in the kernel you want to undervolt! that's because the developer could already undervolted something. Pay atention!

I checked out what values Siyah Kernel had for that variables. I looked at the source code, but you can do this with kmemhelper also.

=======================================

#!/system/bin/sh

su

# /sbin is the location where my kmemhelper is. See where it is yours.

# could be in xbin also.

export PATH=$PATH:/sbin

FILE="/mnt/sdcard/variables.txt"

> $FILE

echo "Printing variables: " >> $FILE

echo "Bus voltages: ">> $FILE

kmemhelper -n exynos4_busfreq_table -t int -o 8 >> $FILE

kmemhelper -n exynos4_busfreq_table -t int -o 28 >> $FILE

kmemhelper -n exynos4_busfreq_table -t int -o 48 >> $FILE

echo "Cpu internal voltages: ">> $FILE

kmemhelper -n exynos4_asv_volt -t int >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 4 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 8 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 12 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 16 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 20 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 24 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 28 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 32 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 36 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 40 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 44 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 48 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 52 >> $FILE

kmemhelper -n exynos4_asv_volt -t int -o 56 >> $FILE

echo "Screen voltages: ">> $FILE

kmemhelper -n ldo13_init_data -t int -o 8 >> $FILE

kmemhelper -n ldo13_init_data -t int -o 12 >> $FILE

kmemhelper -n ldo18_init_data -t int -o 8 >> $FILE

kmemhelper -n ldo18_init_data -t int -o 12 >> $FILE

echo "Memory voltages: ">> $FILE

kmemhelper -n buck5_init_data -t int -o 8 >> $FILE

kmemhelper -n buck5_init_data -t int -o 12 >> $FILE

kmemhelper -n buck5_init_data -t int -o 56 >> $FILE

exit 0;

=====================================

Now that you got the actual values you can plan at how much you'll undervolt.

I didnt use the extreme values (not for now). Again, the undervolting values is at your own risk.

I suggest you to create a new script in init.d to apply these commands and backup init.d folder. If something went wrong you just remove init.d folder in recovery mode.

=====================================

#!/system/bin/sh

su

export PATH=$PATH:/sbin

#

# phenomenal kernel undervolting

#

# 1. bus frequencies: exynos4_busfreq_table

#static struct busfreq_table exynos4_busfreq_table[] = {

#{LV_0, 400000, 1100000, 0, 0},

#{LV_1, 267000, 1000000, 0, 0},

#{LV_2, 133000, 950000, 0, 0},

#{0, 0, 0, 0, 0},

#};

#

# -50 undervolting

kmemhelper -n exynos4_busfreq_table -t int -o 8 1050000

kmemhelper -n exynos4_busfreq_table -t int -o 28 950000

kmemhelper -n exynos4_busfreq_table -t int -o 48 900000

#define ASV_GROUP5

#static unsigned int exynos4_asv_volt[ASV_GROUP][LV_END] = {

#{1150000, 1050000, 1050000},

#{1125000, 1025000, 1025000},

#{1100000, 1000000, 1000000},

#{1075000, 975000, 975000},

#{1050000, 950000, 950000},

#};

#

# -50 undervolting

kmemhelper -n exynos4_asv_volt -t int 1100000

kmemhelper -n exynos4_asv_volt -t int -o 4 1000000

kmemhelper -n exynos4_asv_volt -t int -o 8 1000000

kmemhelper -n exynos4_asv_volt -t int -o 12 1075000

kmemhelper -n exynos4_asv_volt -t int -o 16 975000

kmemhelper -n exynos4_asv_volt -t int -o 20 975000

kmemhelper -n exynos4_asv_volt -t int -o 24 1050000

kmemhelper -n exynos4_asv_volt -t int -o 28 950000

kmemhelper -n exynos4_asv_volt -t int -o 32 950000

kmemhelper -n exynos4_asv_volt -t int -o 36 1025000

kmemhelper -n exynos4_asv_volt -t int -o 40 925000

kmemhelper -n exynos4_asv_volt -t int -o 44 925000

kmemhelper -n exynos4_asv_volt -t int -o 48 1000000

kmemhelper -n exynos4_asv_volt -t int -o 52 900000

kmemhelper -n exynos4_asv_volt -t int -o 56 900000

#

# 2. Screen undervolting

#

#REGULATOR_INIT(ldo13, "VCC_3.0V_LCD", 3000000, 3000000, 1,

#REGULATOR_CHANGE_STATUS, 1

#

#REGULATOR_INIT(ldo18, "TOUCH_LED_3.3V", 2500000, 3300000, 0,

#REGULATOR_CHANGE_STATUS | #REGULATOR_CHANGE_VOLTAGE, 1)

kmemhelper -n ldo13_init_data -t int -o 8 2700000

kmemhelper -n ldo13_init_data -t int -o 12 2700000

# Siyah undervolted: 2500000

# kmemhelper -n ldo18_init_data -t int -o 8 2700000

kmemhelper -n ldo18_init_data -t int -o 12 3000000

#

# 3. Memory undervolting

#

#static struct regulator_init_data buck5_init_data = {

#.constraints= {

#.name= "VMEM_1.2V",

#.min_uV= 1200000,

#.max_uV= 1200000,

#.apply_uV= 1,

#.always_on= 1,

#.state_mem= {

#.uV= 1200000,

#.mode= REGULATOR_MODE_NORMAL,

#.enabled = 1,

#},

#},

#};

# - 50 undervolt

# didnt undervolt for now.

#kmemhelper -n buck5_init_data -t int -o 8 1150000

#kmemhelper -n buck5_init_data -t int -o 12 1150000

#kmemhelper -n buck5_init_data -t int -o 56 1150000

=====================================

=====================================

So, i think this is it. I ask you to not get this guide as the untouchable truth. It could be a detail or another wrong. But be sure, i did what i tell u to do. At that moment, my cel seems just fine at it was, with internal undervolt!!!

I would be happy if you guys that already have something like this could share your informations also, and for the adventurers who want to apply this guide i'm able to help.

And please, show the improovements of your battery!!!! :)

[EDIT]: I attached both scripts and the "var" result file so you guys can directly download it. Remove the ".txt" extension.

Cheers.

If you like, pls hit the thank button