micky51100 Posted January 29, 2013 Share Posted January 29, 2013 (edited) 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.c....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) : #!/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 30 -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 29/01/13 ) => CrossBreederByMick.zip CREDITS: 1. Seeder. This rngd binary is from the seeder util. ( http://forum.xda-dev....php?p=33999592 ) 2. KAK ( http://forum.xda-dev....php?p=12058585 ). Edited January 29, 2013 by micky51100 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.