Reputation: 45
I have created an application that compare the android phone cpu speed by running the same tasks on multiple phones. I noticed that on the HTC ONE X it becomes much slower if I turn off the screen while it does not change when doing the same thing on the other phone. In the program I put the task in a service and running in a separate thread with priority set to be the highest value 10.
I tried to use the partial wake lock to keep the cpu running when screen is off. But it doesn't make any difference in terms of the speed.
I understand that different OS/UI (HTC sense for example) has its own power management strategy. But I am wondering if there is any way to overcome it without rooting your phone, means keep cpu running in 100% clock rate?
Updates: recent experiments show that when screen is off, One X (with ICS) will reduce its cpu frequency and disable the multi-core functionality, the Galaxy Nexus (with ICS) will reduce about 25% performance, Nexus 7 will reduce about 25% performance most of the time (occasionally it can run at the highest speed while screen is off).
Upvotes: 3
Views: 4766
Reputation: 2320
For Qualcomm devices the hotplugging on and off of CPUs is handled with a program called mpdecision
. The mpdecision
file runs in our system as a vendor executable file and what it does is that it controls the governor for cpu. mpdecision
defines performance of your cpu1, the file gets executed every time your screen goes off, hence cpu1 scripts are useless because the mpdecision
file overwrites the cpu1 governor settings to userspace
ondemand
, userspace
is the governor when cpu1 is online and ondemand
is when offline. Reference
You need to stop mpdecision
, then you can keep CPU frequency. However, stopping mpdecision
need root privilege. So I think you can't keep CPU frequency without root privilege.
You can write value to /sys/devices/system/cpu/cpu0/online
to open or close core of CPU and write value to /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
to set frequency of each core. I tries this method in Nexus 4, and it works fine.
For more details you can see this.
Upvotes: 1