Saturday, February 5, 2011

Differences between rubix and liberty

If you're a ROM whore like me, you're constantly switching between ROMs and not loyal to a single ROM. However, my two favorites in the recent past has been rubix and liberty. I like the features of liberty and the smoothness of rubix. I believe you can have both if you're handy with vi and command line. Here are the differences at the OS level. (I could explain what each does but that would take too long).
  • build.prop ("-" is rubix, and "+" is liberty) :
-windowsmgr.max_events_per_sec=95
+windowsmgr.max_events_per_sec=55
-wifi.supplicant_scan_interval = 180
+wifi.supplicant_scan_interval = 90
-dalvik.vm.heapsize=48m
+dalvik.vm.heapsize=30m
-mot.proximity.distance=60
+mot.proximity.distance=55
-media.stagefright.enable-meta=true
-media.stagefright.enable-scan=true
-media.stagefright.enable-http=true
+media.stagefright.enable-meta=false
+media.stagefright.enable-scan=false
+media.stagefright.enable-http=false
-ro.telephony.call_ring.delay=1000
+ro.telephony.call_ring.delay=1500
  • cpufreq ondemand:
/sys/devices/system/cpu/cpufreq/ondemand/up_threshold
liberty: 86, rubix: 95
/sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
liberty: 46875, rubix: 37500
  • minfree (/sys/module/lowmemorykiller/parameters/minfree):
liberty: 1536,2048,4096,5120,5632,6144
rubix: 2048,3072,6144,15360,17920,20480
  • kernel scheduler (/sys/kernel/debug/sched_feature):
Liberty:
FAIR_SLEEPERS GENTLE_FAIR_SLEEPERS NO_NORMALIZED_SLEEPER START_DEBIT WAKEUP_PREEMPT ADAPTIVE_GRAN ASYM_GRAN NO_WAKEUP_SYNC NO_WAKEUP_OVERLAP NO_WAKEUP_RUNNING SYNC_WAKEUPS AFFINE_WAKEUPS SYNC_LESS NO_SYNC_MORE NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY NO_ARCH_POWER NO_HRTICK NO_DOUBLE_TICK LB_BIAS LB_SHARES_UPDATE ASYM_EFF_LOAD OWNER_SPIN

Rubix:
FAIR_SLEEPERS NO_GENTLE_FAIR_SLEEPERS NO_NORMALIZED_SLEEPER START_DEBIT WAKEUP_PREEMPT ADAPTIVE_GRAN ASYM_GRAN NO_WAKEUP_SYNC NO_WAKEUP_OVERLAP NO_WAKEUP_RUNNING SYNC_WAKEUPS AFFINE_WAKEUPS SYNC_LESS NO_SYNC_MORE NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY NO_ARCH_POWER NO_HRTICK NO_DOUBLE_TICK LB_BIAS LB_SHARES_UPDATE ASYM_EFF_LOAD OWNER_SPIN
  • And finally, sysctl.conf:
Liberty (yikes):
vm.dirty_background_ratio = 5
vm.dirty_ratio = 20
Rubix:
vm.dirty_background_ratio = 60
vm.dirty_ratio =95
Overall, Rubix tends to tune out of the box whereas Liberty settings are more or less stock and you'll have to tune them via the toolbox.  Or if you're like me, you tune them manually. :)  (Oh fyi - liberty will run quicker after applying some or all of the changes from rubix above.)

Below will make things easier if you want to try it out yourself.  Make sure you have a backup!

    20 comments:

    1. What is cache_pressure set to on Rubix?

      ReplyDelete
    2. That i'm not sure. On Liberty it's set to 100 which is not good. I think the only way to find out for sure is to flash back to Rubix for me but that's a lot of work. ;) If I were to guess I think Rubix default was 100 as well.

      ReplyDelete
    3. I did your (Sysctl tweaking for faster, longer lasting Android) tweaks on D2 running liberty 1.5 . Was wondering if i could also apply these rubix perks and get better battery and performance. Or would this cause a conflict?
      thanks

      ReplyDelete
    4. Good question. The kernel tweaks (everything but the build.props changes) should be safe. I'd approach build.props mods with caution though - make sure you back up the original in case something goes wrong. I'd imagine it's probably safe as well.

      ReplyDelete
    5. Thanks again! I'm about to go and change everything but the build props. Then I will backup (again), and change build props, just to see. Thanks for all the great work!!

      ReplyDelete
    6. Everything is running super smooth, and fast! Just one last question, On hear you have vm.dirty_background_ratio = 60
      vm.dirty_ratio =95
      On the tweaking for faster, better battery you have vm.dirty_background_ratio = 70
      vm.dirty_ratio =90
      running both of the setups, which would be the better way to go with the vm dirty settings?

      ReplyDelete
    7. Also every time I reboot everything is reset except for sysctl, and I have to re enter everything. Is there a way around this?

      ReplyDelete
    8. 90/65 is rubix default and 90/70 is what I recommended in the past. I tried both and I couldn't tell the difference.

      As to make the changes stick you will have to write a script in the /etc/init.d dir. I'll attach a sample script to the post a bit later.

      ReplyDelete
    9. Ok i've added links to the files at the end of my post.

      ReplyDelete
    10. Ok, I have downloaded the zip, and flashed. At first nothing changed, so i went into file 99imoseyon and had to change the permissions and check the execute boxes, (all 3). I then rebooted, and VIOLA everything is there, and seems to be working great so far! It even included the build props! I did notice a few things though.
      1. the minfree is different from above.
      (above) 2048,3072,6144,15360,17920,20480
      (actual) 256,512,1024,5120,15000,20000
      2. sysctl
      (above) vm.dirty_background_ratio = 60
      vm.dirty_ratio =95
      vm.vfs.cache_pressure = 1
      (actual) vm.dirty_ratio=90
      w vm.dirty_background_ratio=55
      vm.vfs_cache_pressure=20

      Should these be changed to the above numbers, or just left as is?
      All in all just wanted everyone to know that the zip flashed just fine for me. With no problems!
      Thanks again!

      ReplyDelete
    11. hi charlie,
      for minfree I'd actually recommend the first one. I inadvertently left the test values in there. For sysctl, I'd leave the numbers as is. Good luck!

      ReplyDelete
    12. K, and thanks again. This should be my final question. To change the minfree to the prefered, what exactly would i change in your script.
      (# leave more frequently used apps longer in mem
      #echo "256,512,1024,15360,17920,25000" > /sys/module/lowmemorykiller/parameters/minfree
      echo "256,512,1024,5120,15000,20000" > /sys/module/lowmemorykiller/parameters/minfree)
      just the bottom numbers or top also, and if top also what should they be.
      Again thanks, and sorry for being such a bother.

      ReplyDelete
    13. hey no worries - feel free to email me directly in the future at imoseyon@gmail.com.

      You want to remove the '#' from the first minfree line, and just remove the 2nd minfree line entirely.

      ReplyDelete
    14. how do i get the minfree and cpu to stay on reboot. i tried the zip above but it didnt work

      ReplyDelete
    15. i think i figured most of the minfree out from the above comments

      ReplyDelete
    16. hmm as long as the /etc/init.d/99imoseyon file has the right permissions it should execute at boot. Make sure that the permissions are set like the other scripts in the directory.

      ReplyDelete
    17. Your init.d script has you totally over writing sched_features with NO_NEW_FAIR_SLEEPERS. Don't we want all the other entries in sched_features as well?

      ReplyDelete
    18. ah /sys/kernel/debug/sched_features doesn't work like the typical /proc file system settings. Echoing a value there will set a flag, rather than overwriting the entire string.

      ReplyDelete