• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [zip]Seeder Entropy (Lag reduction)

realizm

Well-Known Member
Nov 17, 2011
178
17
Hey guys, I stumbled upon something which may be of use to you all. Found it just wandering around XDA. It's a Seeder Entropy zip which many claim reduces the amount of lag on their device. I don't have my Marquee anymore so I'm unable to test it.
Again this is not mine. I did not create it. I just found it and thought you guys might want to try it out. I can't imagine this effing your phone up but if it does I'm not responsible. If you're comfortable using Terminal Emulator you can check to see if it's working after flashing.

http://forum.xda-developers.com/showpost.php?p=35948379&postcount=159

Enjoy! Let me know if it works for you!
 
So I did a bit of digging and a bit of research and a bit of testing.
I really dunno if the tweak makes that big of an effect but I did discover a nice trick to have a nice fat entropy_avail with zero overhead.

One of the first pages I skimmed was http://linux.die.net/man/4/random which mentioned at the bottom these other files:
read_wakeup_threshold contains the number of bits of entropy required for waking up processes that sleep waiting for entropy from /dev/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

I also wondered why most users report that their entropy_avail was by default in the 200ish range while mine was always by default over 300.

I had also found this page at linuxinsight. I had used that site alot when researching Kick Ass Kernelizer's sysctl tweaks.

So I thought, hey I wonder if I can use sysctl to set good values and low and behold, I looked in my script and I already have settings for both lol:
Code:
busybox sysctl -e -w kernel.random.read_wakeup_threshold=128;
busybox sysctl -e -w kernel.random.write_wakeup_threshold=256;
As you can see, I had doubled the default values - and that's why my entropy_avail was always over 300.

So I decided to mess with sysctl a bit.

Connected the phone to the laptop.
In one command prompt I watched the entropy_avail with this one liner:
Code:
while :; do cat /proc/sys/kernel/random/entropy_avail; sleep 1;done
In a second command prompt I did the sysctl thing...
I found that write_wakeup_threshold didn't effect entropy_avail at all.

But read_wakeup_threshold is a totally different story :cool:

I did
Code:
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.

So it would never go down and would never get used.
I thought well maybe I should lower it so it does get used.
I kept lowering read_wakeup_threshold until it got down to 1200 and finally entropy_avail dropped to 2400+ and kept climbing until 3600 and then would drop to 2400 immediately and up again and so on...

I 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)

So it builds up 3 times the read_wakeup_threshold and then when it hits that limit, it drops the value of read_wakeup_threshold.

If you want to lock it it at the highest possible value (4096), you'd do:
Code:
echo 1366 > /proc/sys/kernel/random/read_wakeup_threshold
Or
Code:
busybox sysctl -w kernel.random.read_wakeup_threshold=1366
You can add either of those to any init.d script.
However, on my device, it won't go over 3600 so you can test for yourself how high yours will go.
If all you can get is 3600ish just go with 1200 (ie. 3600/3)

In Kick Ass Kernelizer I'm gonna make it like so:
Code:
busybox sysctl -e -w kernel.random.read_wakeup_threshold=1024;
busybox sysctl -e -w kernel.random.write_wakeup_threshold=2048;
That will make it bounce between 3072 max and 2048 min.
I'm making write_wakeup_threshold twice the amount of read_wakeup_threshold simply because that's what it is by default.

But hey, maybe I can save battery life if I make it 1280 just so it stays locked in at 3600+ and it doesn't have to keep rebuilding entropy_avail lol

So conclusion is: since there is a definite pattern on how entropy was being built up to a pre-determined level and dropped to a pre-determined level, it wasn't actually being used. That's just how it's programmed.

If the setting isn't there to "hold" all the entropy, it just drops/flushes it and force feeding it entropy won't make it not spit it out :p

So at least I found the setting that will make it hold it in lol

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.

Just adding this: after reading the whole thread, it seems like this may be a simpler solution (and better on battery life)
 
  • Like
Reactions: Phrant1c
Upvote 0
To give my input, at first I thought I was a placebo effect, than I realized that apps that normally lag very much, had no lag. I first found this app when I was scouring the nexus 7 threads, I tried it on the 7 but to be honest this tab is a beast ( especially when oc'ed) so it had little to no effect. I then tried it on the marquee and to my amazement there is absolutely no lag where I have come accustomed to seeing it. Also I have this coupled with pimp my ROM with the only change being that I turned off vsync. So yes this does work. And it is much much simpler than messing around with all the internal settings and files. Not everyone wants to spend all day messing with files, they just want something to work, and this accomplishes just that.
 
Upvote 0
To give my input, at first I thought I was a placebo effect, than I realized that apps that normally lag very much, had no lag. I first found this app when I was scouring the nexus 7 threads, I tried it on the 7 but to be honest this tab is a beast ( especially when oc'ed) so it had little to no effect. I then tried it on the marquee and to my amazement there is absolutely no lag where I have come accustomed to seeing it. Also I have this coupled with pimp my ROM with the only change being that I turned off vsync. So yes this does work. And it is much much simpler than messing around with all the internal settings and files. Not everyone wants to spend all day messing with files, they just want something to work, and this accomplishes just that.
Thanks for your feedback K28! I'm glad this thing is working for you guys. I agree about not wanting to mess with too many settings. I just wanna flash a zip and be done with it. Anyway, glad you like it.
 
  • Like
Reactions: k28king1
Upvote 0
Have anyone tested it? every time i reboot the app show it it's off, even with the start on boot thing.

Trust me, this app is only a placebo, I did a bunch of benchmark tests only too find out it makes no difference and that this quote below is true on some phones (happened on his Motion and my Optimus M):
PLEASE for the love of God, do NOT Install this! Your Motion will start to glitch out and the screen will turn purple. I figured out that it is because of this. Please, save your phone from what looks to be irreversible damage........
 
Upvote 0
Update from my previous post

Steve Kondik said:
I'm not suggesting that the seeder app does anything useful at all other than keeping the device out of idle states or *maybe* working around some issue in an older kernel. I don't have any devices that see any sort of benefit from that app.
 
Upvote 0
This is really making something, but on my marquee isn't anything good, whit seeder i got more noticeable lags, bot: the zip file and the apk, even lowers values on benchmarks.

Maybe the pimp my rom teaks affect it, i dont know, but cant see anything good with seeder.

That could be. I'm only using the scripts that come with CTMod with Zram enabled with 128mb compression on my Zram.
 
Upvote 0
Ok, so I haven't experienced Amy lag. But my phone has completely locked up a few times. Good thing I made a back up before I added that. Restored my backup and all is fine now. I'm not going to try this again until I do some more research.

You use the zip file from the post or the apk from xda?
The zipfile on that link is v3, there's a v6 version and apk 1.1, y think both are the same, the zip should be a more "direct effect" or something like that, and there's a uninstaller zip file too.

i think here's everything to be a little more clear: http://forum.xda-developers.com/showpost.php?p=36252773&postcount=738
 
Upvote 0
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones