Hi,
This is a combination of 3 different methodologies to reduce Android lag due to low entropy.
1. Change wakeup threshold kernel parameters ala KAK.
2. Run rngd ala Seeder but not in intensive feed mode.
3. Remove /dev/random as it's blocking. Link it to non-blocking /dev/urandom. Since /dev/random is blocking and designed to protect us from Quantum alien cryptographers with mathematical certainty and urandom is non blocking pseudo-random device that most apps and OSs are using anyway.
I'm getting some good results on all Android devices I've tried this on.
You can check your results with this tool:
http://play.google.com/store/apps/de...ndentropyavail
You should get consistent values around the maximum 4096 with this mod.
This is the listing of /etc/init.d/00CrossBreeder (Can be run manually too) :
Your thoughts and experiences welcome.
Notes:
1. You can put the code in /etc/init.d/00CrossBreeder and make it executable with:
chmod 755 /etc/init.d/00CrossBreeder
This should run on every boot if you have init.d support. You can also run it manually.
2. You'll need to rename the attached rngd.img binary to /system/xbin/rngd and make it executable with:
cp rngd.img /system/xbin/rngd
chmod 755 /system/xbin/rngd
3. You'll need to stop the seeder service and disable auto start ( IMPORTANT as seeder rngd can take high cpu with the link enabled). Though you can run the app to see available entropy.
or flash zip ( update 31/01/13 ) => CrossBreederByMick.zip
CREDITS:
1. Seeder. This rngd binary is from the seeder util. ( http://xdaforums.com/show...php?p=33999592 )
2. KAK ( http://xdaforums.com/show...php?p=12058585 ).
This is a combination of 3 different methodologies to reduce Android lag due to low entropy.
1. Change wakeup threshold kernel parameters ala KAK.
2. Run rngd ala Seeder but not in intensive feed mode.
3. Remove /dev/random as it's blocking. Link it to non-blocking /dev/urandom. Since /dev/random is blocking and designed to protect us from Quantum alien cryptographers with mathematical certainty and urandom is non blocking pseudo-random device that most apps and OSs are using anyway.
I'm getting some good results on all Android devices I've tried this on.
You can check your results with this tool:
http://play.google.com/store/apps/de...ndentropyavail
You should get consistent values around the maximum 4096 with this mod.
This is the listing of /etc/init.d/00CrossBreeder (Can be run manually too) :
Code:
#!/system/bin/sh
busybox sysctl -w kernel.random.write_wakeup_threshold=4096
busybox sysctl -w kernel.random.read_wakeup_threshold=1333
rm /dev/random && ln /dev/urandom /dev/random
busybox mknod -m 666 /dev/random.fake c 1 8
busybox chown root.root /dev/random.fake
rngd -t 10 -T 1 -s 256 -W 80% -o /dev/random.fake
sleep 2
echo -8 > /proc/$(busybox pgrep rngd)/oom_adj
renice 5 `busybox pidof rngd`
rm /dev/random.fake
Your thoughts and experiences welcome.
Notes:
1. You can put the code in /etc/init.d/00CrossBreeder and make it executable with:
chmod 755 /etc/init.d/00CrossBreeder
This should run on every boot if you have init.d support. You can also run it manually.
2. You'll need to rename the attached rngd.img binary to /system/xbin/rngd and make it executable with:
cp rngd.img /system/xbin/rngd
chmod 755 /system/xbin/rngd
3. You'll need to stop the seeder service and disable auto start ( IMPORTANT as seeder rngd can take high cpu with the link enabled). Though you can run the app to see available entropy.
or flash zip ( update 31/01/13 ) => CrossBreederByMick.zip
CREDITS:
1. Seeder. This rngd binary is from the seeder util. ( http://xdaforums.com/show...php?p=33999592 )
2. KAK ( http://xdaforums.com/show...php?p=12058585 ).
Attachments
Last edited: