Hello, I've been trying for a while to make sense of some behavior I didn't expect. No matter what workload I throw at this device it will only fully load CPU cores 1-3, leaving core 4 mostly unused. I have a CPU monitor app on at all times in the notification bar (I use the open source "CPU Stats" app) which allows me to see this happening in real time. Some examples: AnTuTu benchmark will light up 3 cores but the 4rth will be nearly idle resulting in 75%-80% CPU usage. BOINC research app will allow me to run 4 jobs at once but only uses 3 cores no matter the setting. Using Termux to run ffmpeg and transcode 4k video only uses 3 cores. But, and this struck me as interesting, installing large apps from the Play Store will briefly provoke that fourth core into action and can sometimes result in 100% CPU usage. Going into free window mode and resizing and dragging windows quickly can result in momentary 100% usage. I wonder if the system has reserved core 4 for itself? Is this a thing? If I use Kernel Auditor to shut down core 4 then 1-3 still easily ramp up to 100%, as will cores 1 & 2 if I shut down 3 & 4. If I shut down 2 & 3 then core 1 easily goes to 100% and 4 still refuses to do so unless handling a system workload. I used to think I had a bum core but it can be provoked into use by the system so I now think it's been reserved somehow.
Kinda wish I could override it. I'd like to transcode on 4 cores, for example. By the way, the 3 cores match or slightly exceed the 4 cores in the Pixel-xs for some ffmpeg commands, and run away with it over time because the phone throttles.
Anyone else seeing this? Am I on to something, do I have a bum device, am I nuts?
It's because the apps are programmed to use that many core. Simple apps can actually get away with with only 1 core being used. On those apps that need to run on multiple cores, it's actually very difficult to design the program efficiently. In short, more cores utilized = more difficult to program.
Even if you have multiple programs open at the same time, you only have 1 program that has focus at each given moment. Then what you're most likely experiencing is that threads from other programs are suspended, so your cores get utilized by only that program which has focus.
Related
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
is there any way to request more use of the companion core?
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.
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.
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.
I've modified OS Monitor to support Tegra 3's stuff
Click to expand...
Click to collapse
Can u share the apk here...xD???
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.
schriss said:
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.
Click to expand...
Click to collapse
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 -.-
I used to be able to do this, but now I'm using n3o kernel and I can't find the tegra_hotplug folder inside sys/kernel/debug. Help?
joeystar said:
I used to be able to do this, but now I'm using n3o kernel and I can't find the tegra_hotplug folder inside sys/kernel/debug. Help?
Click to expand...
Click to collapse
Man ask this in kernel thread not here....-.-
Sent from my HTC One X using xda app-developers app
This may have been answered before but I haven't stumbled across any discussion of this as of late. To put it simply, how does quad core affect phone speeds? Sure it makes for great benchmark scores, but does it function similarly to pc CPUs in the sense that if the app doesn't support more than 1 core then you're not fully utilizing the entire CPU? If that's so wouldn't a quad core just be draining battery life on a phone? Or do phone apps not have core limitations and that each core will always be used no matter if you're flipping through pages of apps or running a game?
Just like a PC working. Some appsmaube just running in single core but some apps use it. Multi core help system let say it android system working more fast. Because system use all cpu
Sent from my ADR6300 using xda app-developers app
So aside from flipping through the android os screens and making calls or writing notes, Internet browsing, video watching, and games are all limited by how they're coded to use the cores? Are the unused cores at least inactive to prevent battery drain?
zergslayer69 said:
So aside from flipping through the android os screens and making calls or writing notes, Internet browsing, video watching, and games are all limited by how they're coded to use the cores? Are the unused cores at least inactive to prevent battery drain?
Click to expand...
Click to collapse
Yes.
Sent from my GT-N7100 using Tapatalk 2
I AM NOT RESPONSIBLE FOR ANY NEGATIVE IMPACTS OR CONSEQUENCES ON YOUR PHONE IF YOU SO CHOOSE TO USE THESE TIPS.
I've created a couple threads on the ZTE U950 and LG G2, and one problem is the battery life. The battery cannot come out of these devices and thus we cannot combat this with a bulkier, beefier replacement for heavy usage. Charging constantly is something I try to avoid, so these are a few simple tips that can help optimize your battery life (and that APPLY to ANY PHONE):
TIPS
BATTERY
1a) Buy and download CPU Sleeper (root required). There are two versions, one for dual-cores, and the other for quad-cores. Essentially, when a phone is "sleeping", it is actually still running all its cores, helping drain battery faster. This app turns off all but one core when it is "sleeping" so that your battery is not drained nearly as fast.
BATTERY
1b) To take this step a bit further you can download a free app called Multicore CPU Control. In this app you can control your other cores. You can setup profiles to turn on or off cores, and setup each core with different governors. On my LG G2, I setup a profile to only have one core running at 960MHz (2.2GHz originally) after using the steps from below. If you plan to only run one core, then you do not need to buy CPU Sleeper.
NOTES ON 1b: Multicore CPU Control is the name when installed, it is called CPU Performance Control Free on the Google Play Store (either name will work on Google Play). The program needs to be turned on after each boot. When first setting up a profile save it and edit it in order to manipulate the other cores available. The app does not always apply a profile even if it has already been selected. To turn on a profile, click on the profile desired and go to the CPU Monitor tab to check if it has been applied. If not, repeat the process until it does (it usually takes me about 3 times at most).
BATTERY/RAM
2) Download Greenify (root required), a great free app! Sometimes a user does not have a ROM with a kill all button, so pesky apps just stay on without consent. This app allows a user to turn off any app that may want to run in your background, and even shows you which apps are currently running. Apps like Facebook, Talkatone, etc. can all be stopped even if your "task killer" supposedly took care of them.
BATTERY
3a) Wakelock Detector-Save Battery is a free app that checks for apps that continue to work while the phone is "asleep". While Greenify will display the most troublesome apps, this app will help discover any other apps that are running without consent.
BATTERY/RAM
3b) If Greenify does not show the apps discovered in Wakelock Detector-Save Battery, then download Disable Services (root required). This free app allows a user to disable an entire service, or just parts of a service that are bothersome. Click on a service/app to find out what other services accompany it. Read the accompanying services and discern whether or not the service is needed. A good place to start in this app is to check any service/app that has a blue number next to it.
EXAMPLE 3b: I use the Outlook app a lot, but sometimes it gets annoying with updates for insignificant email. I can open Wakelock Detector-Save Battery and click the Outlook app. I turn off "AppWidgetUpdateService" to disable Outlook email updates. Not all services have obvious names, so be careful on system apps if performing trial-and-error.
BATTERY/RAM
3) Buy and download BetterBatteryStats (CPU Spy Reborn/Plus is FREE and only shows CPU states). This app tells me what CPU States are used the most often and is what I download first before my next step. A user can also determine battery-draining apps and turn those off. If turning off those apps is not possible through Settings>Apps just Greenify them!
BATTERY
4) Underclocking. This is an amazing step for saving battery! If you have ran BetterBatteryStats for at least a day, this will come in handy and is highly recommended. You can use numerous programs like SetCPU or Voltage Control to set the clock of the CPU. The key is to find a point that will still be responsive, yet lower than the maximum.
EXAMPLE 4: For this example I will be using my ZTE U950 and Voltage Control. According to BetterBatteryStats, my most used clock was at 1.2GHz and 860MHz. I left my minimum clock at the lowest possible setting, while my maximum clock I changed to 860MHz. I ran this for a few days and saw a noticeable difference in battery life. Another important part to this if choosing the right I/O Scheduler and CPU Governor. I found the default I/O Schedule ("cfq") to perform the best, despite "noop" being good for sluggish memory. "Powersave" is a good Governor at stock CPU speeds, but it will not get a user the savings of power that a step like this will. I tested with this Governor with this step and got horrible reaction times and would often need to restart the phone. The best results I have are with "ondemand" and "interactive". I am currently using "interactive" with a maximum clock of 475MHz! I arrived at that number after checking my BetterBatteryStats while running at 860MHz and found that to be the next most used clock. Now my battery is lasting about twice as long as it normally did! My phone's response time is a bit slower at this low clock speed, but that can combated...
BATTERY/RAM/SPEED
4b) (IF YOU HAVE INIT.D SKIP TO STEP 4c) My LG G2 is underclocked to 960MHz, as noted in step 1b. I am saving quite a bit of battery, but the UI response can lag a lot at times. The use of boot scripts can be helpful to compensate for this. However, my LG G2 does not have init.d support. There are numerous threads that explain how to get init.d support for a lacking Android phone. The simplest method is to install an app from Google Play. I use one called Init.d-Installer just because it forces the phone to reboot once it has installed; others do not seem to do anything to inform a user if they have received init.d support
BATTERY/RAM/SPEED
4c) Download a script called V6 SuperCharger. The thread may seem daunting, but it is fairly easy to install. Download the newest PDF and change it to TXT. Ensure you have init.d support, BusyBox installed (also in the thread if needed), and SuperSU. Run the script in a free app like SManager with SU permissions and follow the instructions. This script gives the ability to enhance speed and power. I install this in order to ensure my UI stays responsive, and LG G2 runs almost at stock speeds (alongside all my other enhancements)!
BATTERY
5) Undervolting (root required/custom kernel required). This is also a great way to save battery. I decrease the voltage in steps of 25 and test from there. If I find no quirks, I leave it. If I find sluggishness or have random phone reboots, I increase by increments of 25 (or 12.5) until I find something stable.
Most phones will not allow undervolting without a custom kernel. To see whether a phone can undervolt or not download, Sytem Tuner. There is a free and paid (Pro) version of this app, but the free one should be sufficient for what we want to do. After installing, open the app and click on the Voltage settings tile on the left-lower side of the screen. All the phone's CPU MHz steps and the amount of voltage applied to each step can be viewed. At the bottom of the screen are buttons to increase or decrease voltage in 12.5 increments (which will apply to all steps). If the -12.5 button is clicked and the values of all the steps drop, then a phone can undervolt. Additionally, System Tuner allows a phone to manually apply undervolting to each step if wanted.
To test undervolting, just push the decrease button until the phone freezes up. There is no harm to your phone or CPU as neither are being overpowered (just the opposite), and a reboot after freezing will reset the phone to default voltage settings. A - 75MHz drop is normal for a phone while remaining stable; and in a lot of cases -100MHz is achievable.
NOTE: Tips #4 & #5 also can be applied to GPUs.
NOTE 2: One thing that should be mentioned is to be careful about putting more than one app that controls CPU clocks. They can read differently and trump the other when used in combination. Instead, install and use one at a time to get more accurate readings. The same should apply to undervolting apps.
BATTERY/RAM
6) A user can change the Dalvik cache a bit to see if that helps optimize RAM, and possibly battery. I did quite a few tests for these to see how they performed. I think the only reason I noticed any changes immediately is because of how far underclocked my CPU is. Anyways, the best results I was able to get with my ZTE U950 was as follows:
124m - dalvik.vm.heapsize (2nd one, not 1st)
8m - dalvik.vm.heapstartsize
For other phones, these are the items to trial-and-error with:
davilk.vm.heapsize (may be more than one at different values)
davilk.vm.heapstartsize
davilk.vm.heapgrowthlimit (may be more than one at different values)
A user can change these settings by downloading an app like Build.Prop from Google Play. I did notice my battery seemed to drain slower with these changed. The RAM was the best optimized for the self-made tests I performed and was nearly the best in all the tests I had ran. A user may or may not notice any differences unless they multitask a lot.
BATTERY/RAM/SPEED
7) All other well-known methods apply as well:
A. Battery Saver apps/settings
B. Battery Calibration apps
C. Refrain from the use of widgets
D. Automatic Brightness apps/settings
E. Small Screen Times before Screen Sleep
F. Turn Off WiFi and/or Data when not needed
G. Task Killers apps/settings
Having been talking to various people about various art apps. The concensus seems to bee that beyond 2000 x 2000 most devices suffer from lag and performance issues with drawing programmes. My assumption is that this is due to both processor and RAM demand but have wondered if playing with some of the settings in the dev options would help with this.
I know that android is designed to ballance apps in the background on the fly, but when your main use it to use just the one app, would playing with the "limit background processes", "force gpu rendering" and other options I perhaps have not considered help with the performance of the app in question (even if its at the cost of having a slower tablet in general due to having to load up processes on the fly rather than having them stored in RAM)?
Would this also help with resource intensive games?
I already turn all the animation options off, have a plain background and limit the number of widgets on my homescreens in order to free up as much as possible for my art apps in question.
I also use Greenify to limit apps opening on their own accord and use a gaming booster than shuts down other background apps and stops them opening when said art apps are in use.
I used to OC, but have gone back to 1600mhz and 533mhz for the CPU and GPU respectively having had concerns with how hot my tablet gets in the edge of the screen under load.
hertsjoatmon said:
Having been talking to various people about various art apps. The concensus seems to bee that beyond 2000 x 2000 most devices suffer from lag and performance issues with drawing programmes. My assumption is that this is due to both processor and RAM demand but have wondered if playing with some of the settings in the dev options would help with this.
I know that android is designed to ballance apps in the background on the fly, but when your main use it to use just the one app, would playing with the "limit background processes", "force gpu rendering" and other options I perhaps have not considered help with the performance of the app in question (even if its at the cost of having a slower tablet in general due to having to load up processes on the fly rather than having them stored in RAM)?
Would this also help with resource intensive games?
I already turn all the animation options off, have a plain background and limit the number of widgets on my homescreens in order to free up as much as possible for my art apps in question.
I also use Greenify to limit apps opening on their own accord and use a gaming booster than shuts down other background apps and stops them opening when said art apps are in use.
I used to OC, but have gone back to 1600mhz and 533mhz for the CPU and GPU respectively having had concerns with how hot my tablet gets in the edge of the screen under load.
Click to expand...
Click to collapse
I don't use any apps for drawing and rendering. But, within the last month, I have noticed a huge improvement in performance swapping out my class 10 SD card for a professional quality 633x SD card. I would think any card capable of both 65+ MB/s read and write should help with bottle necks. Though you want to set your app to use the SD card for saving, as it will utilize caching to SD card. I have setup my device to point to SD card for most all app saves and caching. Some apps will use system cache, so unless you are able to tweak further, there is no way to unlimit stock caching. Though I do have trickster mod (Though it is very limited with stock ROM), and found bumping from 128 read ahead cache to 256 to 384, as it seems best with how I utilized my ultra fast SD card. Also you may set the Governor as well, but I have a feeling that is pretty much the same as what you are doing in Greenify. As for antivirus apps, they all have some ways of checking what is going on. If you can temporarally disable and test it may help.
Hi i was wondering, i was observing some games and app usage of the cpu cores, as u know there are small and big cores.
I noticed big cores got barely used, and almost all Kernel tweaks recognize only the 1.44GHZ cores.
I was wondering is there a way to force big cores to be used first? or probably we need to wait for a custom Kernel?
Also those of u who run PPSSPP emulator, will notice that multithreading decrease performance substantially, that due to inability of the emulator to use the right cores...
I think some lag of the games/software are as direct results of using invalid core config.