I did a bit of digging and testing about Android entropy and discover a nice trick to have a nice fat Android entropy, Android entropy is able to improve battery life when using and reduce lag.
If an Android entropy pool isn’t full, applications need entropy “just ‘hang” and wait for more to be created. That’s apparently what OPG Pro is designed to avoid.
kernel.random.read_wakeup_threshold contains the number of bits of entropy required for waking up processes that sleep waiting for entropy from /dev/random.
kernel.random.write_wakeup_threshold contains the number of bits of entropy below which we wake up processes that do a select() or poll() for write access to /dev/random.
Normally, read_wakeup_threshold is 64 and write_wakeup_threshold is 128
This page is about kernel random at linuxinsight
you can use sysctl to set good values and low and behold.
busybox sysctl -e -w kernel.random.read_wakeup_threshold=128;
busybox sysctl -e -w kernel.random.write_wakeup_threshold=256;
In one command prompt you can watch the entropy_avail with this one liner:
while :; do cat /proc/sys/kernel/random/entropy_avail; sleep 1;done
In a second command prompt you can do the sysctl thing…
we can find that write_wakeup_threshold doesn’t effect entropy_avail at all.
But read_wakeup_threshold is a totally different
busybox sysctl -w kernel.random.read_wakeup_threshold=2048
The entropy_avail just started climbing….
All the way up to 3600+ and just stayed there. Never went down at all.
Actually, the more I did stuff with the phone, the faster the level would climb.
we played with different values.
Setting it to 1000… entropy would go up to 3000 and then drop to 2000 and up to 3000 again….
Setting to 750…. entropy would go up to 2250 and drop to 1500 and up to 2250 again…
So the pattern is:
max entropy_avail=read_wakeup_threshold * 3
min. entropy_avail=read_wakeup_threshold * 2 (ie. read_wakeup_threshold * 3 – read_wakeup_threshold)
after testing, we found that it is better, but we don’t know it run the same well on all devices.
busybox sysctl -e -w kernel.random.read_wakeup_threshold=1366;
busybox sysctl -e -w kernel.random.write_wakeup_threshold=2048;
Maybe somebody would like to give it a try and test to see if it actually saves battery by setting read_wakeup_threshold to 1366.
OPG Pro have four profile, there are default,light,moderate,aggressive.
Default – Standby better than using in this setting
Light – It is similar with Moderate, just lower value.
Moderate – Using better than Standby in this setting.
Aggressive It is similar with Moderate, just higher value.
You can see these video.