*** Update 5.21.13 *** Bugfix release. Busybox update. Stability and resilience. Change to write_wakeup_threshold ( 0 to 256). Removal of lag in rare cases. Netflix issue solved (?) Pixelserv stability. Installer disables animations ( one can change later by going to system setting but not recommended to have more than 0.5)
If you get any issues in the OS immediately after installation, do try a reboot to see if the problem goes away.
Please take a NANDROID backup of your device before installing this MOD. This MOD is beta and still some way to go before stabilising. Please do download both CrossBreeder and the Uninstall ZIP together to your SD Card so you can uninstall in case of any issues.
Please upgrade even if you're happy with a prior version as there are some prospective issues with prior versions which can result in your phone doing more work than necessary.
It is recommended to uninstall a prior version by flashing the attached uninstall ZIP before flashing the latest version.
Also do read the portion below on how to run the REMOVE_DNS_CLIENT command to disable the DNS portion only if you're getting network issues.
This is a new take at improving Android.
It's lightweight and won't consume battery. Users have reported drastic improvements in usability and even benchmark scores. It will show noticeable improvements.
All you need to try it is custom recovery. It is for all Android devices.
This is a combination of 5 different key methodologies to improve the Android experience:
1. It's a big new feature, DNS caching, parallelising and tether boost . A lot of the lag in a lot of apps, apart from the GUI lag, is due to slow DNS querying, specially on the mobile network.
CrossBreeder now runs a caching, parallelising DNS client on the device. So now most of your DNS queries will be served from the cache and if not found, the query will be sent in in parallel to multiple DNS servers including the two Google DNS servers and your two ISP servers and the quickest reply will be served to you, hot and transparent.
This speeds up network access and networked apps, like Browsers of course, and Tapatalk, Gmail and thousands of others drastically. And removes a lot of the lag where it was due to DNS querying. This will not increase your network or download speed but pages will load much faster.
This will future proof your devices as more and more apps start using HTML5 and/or reside completely as web pages or the like.
CrossBreeder now boosts your tethering connection. Client devices to your device will take advantage of the new DNS. Hence their usage is also improved! In many cases this update might even fix a broken tethering feature on your phone. So if your ROM doesn't have a working tethering support, you an try and install this update. It might magically start working!
CrossBreeder also renames any existing /etc/hosts file on your device. Testing has proven that keeping a system wide /etc/hosts file as is used by most Ad blocking software actually slows down your system. So it is recommended to use this method instead.
In order to achieve all this DNS related functionality, CrossBreeder relies on the excellent open source utilities - DNRD and Dnsmasq
2. Change kernel parameters specially the wakeup threshold ones so read blocks are released instantly and writes never wake up as we have an external entropy generator. And a host of other fail safe and working tweaks from the community for each key subsystem. ( one can look inside /etc/CrossBreeder/zzCrossBreeder ).
3. Modulate OS entropy levels for lag reduction ala Seeder. The whole OS reads either /dev/random or /dev/urandom and both need entropy. However this mod uses a completely different, lightweight and efficient random number generator called Havege . This sharply reduces cpu consumption and corresponding battery life loss compared to Seeder. It also does a better job at keeping entropy levels high hence your device is more responsive. It doesn't run in a CPU intensive loop either. The extend queue functionality has also been added to CrossBreeder. See here for another rationale favouring Havege compared to Rngd - ( http://code.google.com/p/csrng/ - Look for the limitations.)
4. 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 and with Haveged running, is as secure anyway as it's very difficult to empty the entropy pool faster than Havege can replenish it. Pre ICS devices have a lot to gain with this but ICS+ devices show visible gains too.
5. Frandom support (Optional) - CrossBreeder now supports linking both your random devices to the extremely fast alternative - Frandom ( http://billauer.co.il/frandom.html ). This module is orders of magnitude (10-50 times) faster than the standard character devices ( Check this out - http://forum.xda-developers.com/show...&postcount=134 ). The erandom character device also installed by Frandom doesn't use up system entropy at all on top of being fast. You will need to ask your ROM developer to develop the kernel module for you and then place it in /system/lib/modules. CrossBreeder will then try and load it and if successful, make all the necessary adjustments so that both /dev/random and /dev/urandom are pointing to /dev/frandom and /dev/erandom respectively. The speed benefits are to be seen to be believed. But since each ROM requires a unique kernel module, this option is left optional ( but auto detect ).
Your thoughts and experiences welcome and actively solicited.
HOWTO:
- If you want to install it automatically please flash the attached CrossBreeder_5.21.13.zip in recovery. That's it. You're done!
*** WARNING - Other entropy reduction apps like rngd standard and rngd from Seeder and qrngd are not compatible with this mod. In case you have Seeder running please disable it. You can run the app to see the entropy levels though. This mod blocks all other rngs so Seeder may not run. The nature of the /dev/random device is now faster non blocking link to urandom and different to what these apps expect. They would otherwise go into a CPU consumption loop at 60-70% cpu usage. There is no loss of functionality by disabling other rngs as this is a replacement and an improvement***
1. VALIDATION and TROUBLESHOOTING:
You can check your DNS boost functionality by running the following command:
Code:
getprop net.dns1
It should report 0.0.0.0
Then to verify Adblock you can select any one host from the blocked hosts file using the command:
Code:
tail /etc/CrossBreeder/dnrd_root/master
Pick one from there and browse to it in your browser. You should get either a blank space or the text [AD]
If you're experiencing any issues with your tethering, then you can first try and disable the tethering using:
Code:
su -c /system/etc/CrossBreeder/REMOVE_TETHER_BOOST
and rebooting.
You can re-enable it with:
Code:
su -c /system/etc/CrossBreeder/INSTALL_TETHER_BOOST
and rebooting.
Similarly if you're getting any issues with browser not reaching pages etc. then you can try and disable the entire DNS speedup functionality using:
Code:
su -c /system/etc/CrossBreeder/REMOVE_DNS_CLIENT
and rebooting.
You can re-enable it with:
Code:
su -c /system/etc/CrossBreeder/INSTALL_DNS_CLIENT
and rebooting.
Also of note is the Adblock feature. CrossBreeder now uses it's own Adblock file in /etc/CrossBreeder/dnrd_root/master ( NOTE - CHANGED FROM PREVIOUS VERSION). It also serves up these blocks in a clean blank format so you don't get an ugly 'Page not found' error instead of every ad. This is quite unique. If you want to disable Adblock to save around 3 MB of RAM on low end devices, you can run the command:
Code:
su -c /system/etc/CrossBreeder/DISABLE_ADBLOCK
You can re-enable it with:
Code:
su -c /system/etc/CrossBreeder/ENABLE_ADBLOCK
The biggest improvements are in general usability of apps, both local and network based.
2. You can check your entropy values with this tool:
You should get values moving to 4000 regularly with this mod.
Also of some use is this Lag Test app: Lag Test http://db.tt/eBHYJWYn ( Thanks MW86 ). This is for generally testing the CPU based GUI rendering functionality. The aim is to approach 60 fps, but there isn't a guaranteed correlation with CrossBreeder and your FPS result as of now. It is mostly related to your Governor but CrossBreeder certainly helps.
2. If for some reason, your entropy values aren't hovering around 4096 then the app most probably didn't start automatically. You can try and run it manually using:
Code:
su -c /system/etc/CrossBreeder/zzCrossBreeder
If the entropy values go up to around 4096 and stay there, it's working. CrossBreeder is now in it's separate directory and not dependent on your init.d support. You can make it run automatically on boot using an app like SManager from the Play store, just remember to check both 'BOOT' and 'ROOT' for the execution.
3. If you're still getting issues, you can run the collection script:
Code:
su -c /system/etc/CrossBreeder/CHECK_PROCS
(if it hangs you can close the window and run it again) and post the resultant /data/cb_CHECK_PROCS.log file here in this thread or anywhere else and post here pointing to it please. I will try to find a solution or post a bugfix soon.
You can also disable CrossBreeder if you have any problems using:
Code:
su -c /system/etc/CrossBreeder/DISABLE_CROSSBREEDER
4. If you tried (2) and (3) above and it still doesn't work for you or you would still like to uninstall the mod, then please flash the CrossBreeder_Uninstall.zip.
GENERAL RECOMMENDATIONS:
1. It is recommended to use the 'SmartAssV2' or 'Interactive' CPU governor along with the 'deadline' I/O scheduler. It is strongly recommended to disable all animations in your System settings and Launcher settings ( or keep them at 0.5 ). Also recommended is to disable haptic feedback and keypress sounds in your system, launcher and keyboard ( especially on low memory phones).
Some software recommendations include the Holo Launcher as a launcher replacement and exDialer as a dialer replacement.
These recommendations are general in nature and are not required for normal CrossBreeder functionality.
This is just a suggestion to reduce lag on Android devices based on others' findings that the blocking /dev/random device may be the cause of the significant lag on most Android devices.
Why can't we just remove the /dev/random device and link it to /dev/urandom?:
1. mv /dev/random /dev/random.ORIG ; ln /dev/urandom /dev/random
2. Stop the seeder service if it's running.
Wakelock and battery drain is probably not a concern as there's nothing running in the background. Also this may be better than feeding /dev/random from external sources as the device is now non blocking.
Saw this on some JDK optimisation site and decided to try it. I'm getting some good results on all Android devices I've tried this on.
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 guess usability is more important than catering to a one in a impossibillion chance and a billion devices performing sub optimally.
Edit: It's so hard to tell with these kinds of things whether they are working or it's placebo. If it is working, it is definitely not like an "in yo face" difference, on my device at least. Before it was pretty smooth with an occasional stutter here and there. Now it is pretty smooth with an occasional stutter here and there. It didn't blow up so that's a win.
Re: [MOD] Link /dev/random to urandom for lag reduction
Quote:
Originally Posted by DEF3NDER
Neat idea! Trying now. Thank you.
Edit: It's so hard to tell with these kinds of things whether they are working or it's placebo. If it is working, it is definitely not like an "in yo face" difference, on my device at least. Before it was pretty smooth with an occasional stutter here and there. Now it is pretty smooth with an occasional stutter here and there. It didn't blow up so that's a win.
Curious to hear what results other have though.
Hi,
Thanks for your feedback.
I just updated the post with the accompanying kernel parameters. You can try the whole thing as a bunch perhaps and maybe create an init.d script and reboot. Then after ensuring that it actually ran on boot, you can perhaps test.
Sent from my Transformer TF101G using xda app-developers app
Re: [MOD] Link /dev/random to urandom for lag reduction
I don't know how to make an init.d script but can I just run that code in adb for a temporary test? I tried that and I could swear it made a difference.
After reading about Dan Rosenberg’s bootloader exploit for the Samsung Galaxy S 4,I … more
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?