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?
 
k0rner
Old
(Last edited by k0rner; 1st May 2012 at 07:16 PM.)
#1  
Member - OP
Thanks Meter 37
Posts: 69
Join Date: Jan 2010
Location: Kiev
Default [DEV][KERNEL] Tegra3 power management notes and tricks

This thread contains findings on how to view and set kernel parameters related to power management. Although there is no kernel source for One X, some information can be obtained from Transformer Prime kernel sources (also a Tegra 3 device), and from the device itself via sysfs interface.

sysfs files related to CPU power management:

/sys/kernel/debug/tegra_hotplug/max_cpus - maximum CPUs to use. User-configurable, default 4. This is not touched by the Android OS, and will remain in whatever state we set until reboot.
Set this to "1" to make the phone a lot less power-hungry and overheating.
At the cost of performance, of course.

*NOTE: second core will activate sometimes if this is set to "1", but 3rd and 4th cores are disabled for sure.

/sys/kernel/debug/tegra_hotplug/min_cpus - minimum number of CPUs to use.
This _is_ touched by the OS, and can not be set reliably.

/sys/kernel/debug/tegra_hotplug/stats - time each core spent active. Including 5-th "low-power" core.
e.g.:
Code:
cpu:            G0         G1         G2         G3         LP
transitions:    26         12         0          0          25
time plugged:   3110       1222       0          0          95122
time-stamp:     4296183486
/sys/kernel/debug/cpuidle/lp2 - another stats interface.

/sys/module/cpu_tegra/parameters/cpu_user_cap - Max frequency cap for all cores. Default 1500000 (1.5GHz), can be set to any lower value to underclock.
But it is often set by the OS different values (most frequently, back to it's maximum). Maybe, changing this string in libhtc-opt2.so via hex editor can prevent system from changing it?

/sys/kernel/cluster/active - currently active CPU cluster. "LP" for low-power core, "G" for generic (normal) cores.
Can be changed manually, but is also modified by the system at will.

All above values can be changed from root shell via "echo 'value' > /sys/path/to/file"

Maybe, this will come handy to some ROM or CPU-monitoring app developers.

References:
Asus Transformer kernel source
[DEV] Enable 2D GPU rendering in HTC One X & about build.prop tweaks
some findings by phirenz
...
W/Camera ( 2242): Camera server died!
W/AudioSystem( 660): AudioPolicyService server died!

I/DEBUG ( 1930): debuggerd committing suicide to free the zombie!
...


Wait, WHAT?
The Following 16 Users Say Thank You to k0rner For This Useful Post: [ Click to Expand ]
 
slvrarrow
Old
#2  
Senior Member
Thanks Meter 36
Posts: 358
Join Date: Jul 2008
is there any way to request more use of the companion core?
 
lowjoel
Old
#3  
Member
Thanks Meter 33
Posts: 37
Join Date: Aug 2009
Location: Singapore
In case anyone's wondering, I just found out that /sys/kernel/cluster/active must be opened as root even for reading; opening the file as any other user will not succeed.

The other files seem to allow reading as a standard user, however.
 
schriss
Old
#4  
Senior Member
Thanks Meter 97
Posts: 1,300
Join Date: Feb 2006
Location: Dublin
It woulod be great is someone created an app for setting number of CPUs. It is useful sometimes to set it to 1 when you are traveling and want to get max possible battery.
It would be even better if it was possible to disable all 4 cores and force system to use LP core only. It would be brilliant max power saving mode.
HTC One
Previous: Asus Padfone 2, HTC One X, Samsung Galaxy Nexus, Samsung Galaxy S II, HTC Desire Z, HTC Touch Pro2, i-Mate Ultimate 9502, iPhone 3G
 
lowjoel
Old
#5  
Member
Thanks Meter 33
Posts: 37
Join Date: Aug 2009
Location: Singapore
I've modified OS Monitor to support Tegra 3's stuff (temperature, number of cores and determining whether it is low power/general CPU in use) and my experience is that there's no or very little battery gains to be had because the other 3 cores are off most of the time anyway (when idle)

I'm using stock 1.28. The low power core doesn't seem to like being activated for more than a few seconds at a time, too.
 
vallandil
Old
#6  
vallandil's Avatar
Senior Member
Thanks Meter 50
Posts: 193
Join Date: May 2009
Location: @Home

 
DONATE TO ME
Quote:
I've modified OS Monitor to support Tegra 3's stuff
Can u share the apk here...xD???
White One X --- ViperX 3.4.0
White One X --- Stock 3.18.401.01
White Galaxy Note 10.1 --- N8000 Rooted and Themed 4.1.2

Saying Thanks never hurt

About me:
IT Consultant and Photographer
cameijers.nl
 
gabby131
Old
#7  
gabby131's Avatar
Senior Member
Thanks Meter 126
Posts: 904
Join Date: Sep 2010
Location: Winnipeg, MB Canada
thanks to the OP.....I don't have a One X but this info helped me to force all 4 cores of my Asus TF300T go online and offline as i wish.
 
One-X-master
Old
#8  
One-X-master's Avatar
Senior Member
Thanks Meter 506
Posts: 2,182
Join Date: May 2012
Location: Germany :)
Quote:
Originally Posted by schriss View Post
It woulod be great is someone created an app for setting number of CPUs. It is useful sometimes to set it to 1 when you are traveling and want to get max possible battery.
It would be even better if it was possible to disable all 4 cores and force system to use LP core only. It would be brilliant max power saving mode.
use core control or francos kernel updater works for every custom kernel also stock kernel and you can choose how many cores...but battery life is not better with deactivated cores and soemetimes even worser -.-
If i helped, please click on the thanks button it would be nice

Using different Roms

Now at first Insertcoin with XM-Kernel

Tags
frequency, power, tegra3, underclock

XDA PORTAL POSTS

Avoid Framework Bootloops on Xperias Running Jelly Bean

If you’re a Sony device owner running a stock Android Jelly Bean firmware and … more

Forum Added for the Samsung Galaxy Mega

What do you do when the Galaxy Note line is simply not big enough? You get theSamsung Galaxy Mega. … more

Voice Control Your Phone with Tasker and AutoVoice – XDA Developer TV

XDA Developer TV Producer Kevin set up his phone to respond to … more

Guide to Take Better Control of Your Volume Levels

Would you like to know one of the things that really annoys me on a daily basis? Tough, … more