1. Are you ready for the Galaxy S20? Here is everything we know so far!

[GUIDE] Jay's Recipe for Buttery Goodness (REVISED 9/1/12)

Discussion in 'Android Devices' started by Jay Aristide, Aug 17, 2012.

  1. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter

    What we're doing, here, is turning your n7 into a multitasking muscle-machine, and giving it the I/O throughput to match. These instructions are for the stock ROM, but can be applied to any ROM with a little modification. Enjoy!

    Do the OTA update to 4.1.1 (if you're stock and haven't, already), and then......

    [KERNEL][GPL][Linaro][OC 1.6GHz][UV][GPU+][ZRAM][SIO+V(R)] 2012-08-10 motley 1.1.1

    From that thread, you need:

    a) the 1.1.1 kernel of your choice
    b) the 1.0.5b kernel with ramdisk (if you're already running a custom ROM with init.d support, you don't need this, nor do you need to create /system/etc/init.d in a future step)

    You'll also need:

    a) root
    b) cwm
    c) busybox (absolute must, use the JRummy installer from play store and install the latest)
    d) some type of root-enabled text editor (I use root explorer)
    e) a full featured cpu/sd management app (I use System Tuner)

    BEYOND THIS POINT, THERE BE DRAGONS. I'm not responsible if you FUBAR your device, but if you follow my instructions to the letter, you won't


    1) install cwm and root your tab (if you haven't already)

    2) reboot into CWM, flash the 1.0.5b kernel with ramdisk (if you're on stock or a stock-based ROM without init.d support), then immediately flash the 1.1.1 kernel you chose (gpu overclocking is nice and all, but I haven't found a game that doesn't run perfectly with the stock GPU speed of 416MHz..Looks great on benchmarks, though)

    3) reboot back into JB, fire up root explorer, remount /system rw, create a folder in /system/etc called init.d (permissions rwxr-xr-x), create a file in it called S90zRAMandSpeedTweaks (permissions rwxrwxrwx), and long-press to open it in a text editor

    4) make it look like this:

    Code (Text):
    2. #!/system/bin/sh
    4. #remount /data for faster i/o
    5. mount -o remount,noauto_da_alloc /data /data
    7. #disable fsync (controversial, I've been doing it for years with no real issues)
    8. echo 0 > /sys/class/misc/fsynccontrol/fsync_enabled
    10. #set zRAM size (recommended sizes are 64 and 128, as this compresses an actual block of RAM. Setting this higher will likely impede performance)
    11. echo $((1024*1024*128)) >  /sys/block/zram0/disksize
    13. #use busybox to create and activate zram0, if busybox is not in /system/xbin, modify accordingly
    14. /system/xbin/busybox mkswap /dev/block/zram0
    15. /system/xbin/busybox swapon /dev/block/zram0
    It's important to leave at least one trailing line in scripts. Just trust me, it's a linux thing.
    *NOTE* The above script does NOT check to see if it was successful, but if you copied it directly and installed busybox to /system/xbin then it will work. Once you reboot in a few minutes, you can check by using the command "busybox free" from a terminal emulator or adb shell

    5) Save the file, delete the .bak now in that folder, and close root explorer.

    6) Open System Tuner, tap on the SD option, change cache to 1024 and scheduler to deadline

    7) Tap the Voltage option and hit -25 4 times and save the settings as voltage_table_uv

    8) Tap the CPU option and tap Boot Settings. For CPU and SD, set the method to init.d

    9) Close System Tuner and reboot your device.

    10 Profit/consume butter

    It seems like a lot, but it really only takes about 15 minutes if you're a complete rooting n00b, and the end result is a buttery-smooth multitasking powerhouse (that blows iOS *away*). The 100mV undervolt also greatly extends battery life. I haven't had ANY issues at -100mV, but if you do, just increase it by hitting +25 on the voltage tab of System Tuner until you have something that works for you (in fact, you might want to start at -25mV and slowly grow it to -100mV, playing games and checking for instablity along the way)

    It's also worth mentioning that if you're currently completely stock, you will need to unlock your bootloader to root and install CWM, and unlocking the bootloader wipes your device (no way around it, unfortunately. Hook your N7 up to your computer and backup the entire contents of /storage/sdcard0 to make restoring your data as painless as possible)

    farmerbb's scripts - If you're having trouble getting your scripts to stick, or just don't want to be assed with installing System Tuner, use these! There are three different packages, for 64MB, 128MB, and 256MB zRam setups. Thanks, farmerbb!!

    ------- Revisions as of 9/1/12 -------

    Fixed first line of script so it will actually run
    Fixed zRam settings, as zRam is a block of actual RAM, not written to storage
    Removed JRummy busybox installer as recommended. Use whichever you like, just make sure your symlinks are good :)

    KLBrey, palmtree5, rootbrain and 3 others like this.

    1. Download the Forums for Android™ app!


  2. meckert15834

    meckert15834 Well-Known Member

    Very nice! I saw a post in the benchmark thread about this but I was kinda confused.
    This is what I need
    Thanks alot

    EDIT: working like a charm! thanks again
    Jay Aristide likes this.
  3. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter

    Tell your friends ;-)
  4. rootbrain

    rootbrain Android Enthusiast

    Just about to start this, but one quick question. Do the kernals in the link have the ntfs tweak for external storage devices? Would like to format a 180gb mypassport drive with ntfs so I can have larger (1gb+) HD movie files.

    There was nothing mentioned about it, I know there are custom kernals just for that.

    Edit: Never mind, I found this thread: http://androidforums.com/nexus-7-all-things-root/603875-exfat-1tb-external-drive.html about ntfs kernals that have a link to what you have above for motley.


    Edit 2: Worked like a charm, benchmarks seem good, not the top, but not overclocked so would expect normal(ish) results, which they are. i/o doesn't seem a lot better.
  5. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter

    Glad it's working good for you. I just restored my friend's n7 to stock and did this for him... from 515 miles away :D:D Remote-Desktop+ADB FTW
  6. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter


    Fixed the following lines in S90zRAMandSpeedTweaks:

    echo 0 > /sys/class/misc/fsynccontrol/fsync_enabled
    echo $((100*1024*512)) > /sys/block/zram0/disksize

    Script should work as intended, now. Please update your script.
  7. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter

    OP UPDATED (again)

    Someone pointed out that only 50MB of swap was being initialized. The following line has been modified to actually initialize 512mb. Please modify your script accordingly and reboot.

    echo $((1024*1024*512)) > /sys/block/zram0/disksize
  8. rootbrain

    rootbrain Android Enthusiast

    Jay, not seeing a "disksize" file which should have been created with the echo command, correct? Or should I have made the file first?

    Also seem to be having issues with SD cards. When inserted via dongle and flash drive adapter, they will mount to /usbstorage/sda, but none of the files will display. Just think it's blank. And when I copy anything on the N7 to that location, it shows the files but I don't think it's correct because I can remove the drive and still access the files.

    Any ideas?
  9. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter

    The file /sys/block/zram0/disksize is created by the kernel you flashed. If it's not there, chances are the kernel flash didn't take for some reason.

    If you put files in /storage/sdcard0/usbstorage/sda, then mount will not be able to mount it. You should remove all files and folders from /storage/sdcard0/usbstorage and let stickmount auto-manage it's contents.

    I'd like to check a couple of things. From terminal emulator or adb (as root), please do the following:


    And paste the results for me.

    Thanks :)
  10. rootbrain

    rootbrain Android Enthusiast

    Ok on the first item, I reflashed both kernels and now the disksize file exists. Just FYI, I cleared cache and Dalvik after flash, then rebooted. It came up saying upgrading Android. Took awhile, but everything came back clean. When I ran S90 command from terminal as su, I saw that I had mismatched ")" in the file, fixed that and ran the command again. It created an entry for 1gb in the disksize file (setting up swapspace version 1, size = 1073737728 bytes). However, when I reboot the entry in disksize is back to 0. Something in the S90 file I guess. It is executable, made the mode 777 so I could edit. I had also to change permissions on system/etc/init.d to 777 as well, will leave those until I know I'm done editing. I also chmod the disksize file to 777. Still showing value "0" in the file after reboot.

    Here's my S90 file.


    #remount /data for faster I/o
    mount -o remount,noauto_da_alloc /data /data

    #disable fsync
    echo 0 > /sys/class/misc/fsynccontrol/fsync_enabled

    #set zRAM size 512k or 1gb
    # echo $((1024*1024*512)) > /sys/block/zram0/disksize
    echo $((1024*1024*1024)) > /sys/block/zram0/disksize

    #use busybox to creat and activate zram0
    /system/bin/busybox mkswap /dev/block/zram0
    /system/bin/busybox swapon /dev/block/zram0

    I made sure I left at least one extra line at the end.
  11. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter

    Perms on init.d should be 0755 and the script should be 0777 (though, as you're editing them manually as root, 0755 will work for that, too).

    It sounds to me like the kernel isn't initializing init.d like it should be. What recovery and which SuperUser package are you using (superuser or supersu)?

    Lots of people have had issues getting this to work when using TWRP and/or SuperSU. CWM6.0.0.6 or higher and SuperUser (by CHAINSDD) are what I recommend.

    Also, even after changing my friend's n7 over from TWRP and SuperSU to the above, we ended up having to do a complete factory reflash before init.d would stick..
  12. rootbrain

    rootbrain Android Enthusiast

    Using CWM 6.xxx (latest touch but it's 6 something) and SuperSU. SuperSU will let me "clean up" for a different superuser so I'll look at that. Before that, going to look at a couple of kernals that have init.d and unsecure ramdisk and ntfs support just to see how they work. can always go back.

    Appreciate your help, always good to have a SME around when ya need one. :D
  13. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter

    A what?

    These tweaks should work with any kernel that has init.d, fsync control, and under voting control, BTW :)
  14. rootbrain

    rootbrain Android Enthusiast

    SME = Subject Matter Expert
  15. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter


    I'm a moron.

    So, I got a 16GB n7 from wally-world last night, and gave my brother my 8gb. While setting them up, I realized my script wasn't working, and set out to figure out why.

    APPARENTLY, I somehow managed to leave out the ! in the first line of the script, which causes it to not execute. Please refer to the OP and change your scripts, accordingly.

  16. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter


    Someone pointed out to me that zRam is a new implementation of compcache, and doesn't write to storage, at all. IN FACT, the whole point of it is to minimize writing to storage. What it does is compress an actual block of RAM to use as swap.

    That being said, the OP has been modified to suggest a max value of 128MB of zRam. Please update your script, accordingly :)
  17. ephensteve

    ephensteve Lurker

    8) Tap the CPU option and tap Boot Settings. For CPU and SD, set the method to init.d

    OK I must have drove off track... this would be the re-apply SD tweak and CPU settings correct? if so the only two options i have are disabled/on boot completed.

    kinda new to the app, so my apologies for misunderstanding.
  18. dbaogues

    dbaogues Lurker

    Out of curiosity, Jay, have you run into the issues with the 16GB N7 regarding the lag once you get past around 10 GB of storage space used? I've been devastated by this in the past few weeks and it appears to be more of a hardware issue that anything. If there's any softmod way around it, I'm all ears, but I've yet to hear of anyone tweaking the software and having better results.

    Check google issue 37258 is you haven't heard about it yet:
    Issue 37258 - android - Nexus 7 Poor Write Speeds After Using Almost All Storage Capacity - Android - An Open Handset Alliance Project - Google Project Hosting
  19. Jay Aristide

    Jay Aristide Well-Known Member
    Thread Starter

    As a matter of fact, I've been spending a great deal of time on XDA trying to track down and nail the issue with several other people. It appears the update to 4.1.2 fixes the issue by enabling TRIM via the discard option on /data and /cache

    I'll be updating the OP sometime in the next 24-48 hours with new files and new instructions that coincide with an upgrade to 4.1.2 - which everyone with a nexus7 should do.
  20. dchamilton

    dchamilton Member

    I just bought my N7 this week. Is there an update to this guide for 4.2.2?
  21. KLBrey

    KLBrey Lurker

    I've just applied this Buttery Smoothness to my 4.2.2 CM10.1.2-grouper. Instead of applying the 1.1.1 kernel as listed in the OP I used the latest, listed kernel for 4.2.2. At the time it was:

    build #249 for Jellybean 4.2.2 - WiFi and 3G 2013-02-24

    Other than that slight change, I followed the remainder of the OP and everything works as advertised. Good luck.
Similar Threads - GUIDE Jay's Recipe
  1. Happy App Lab
  2. decosoftapp
  3. DecosoftApps
  4. App Update
  5. Paozi
  6. App Update
  7. kisame010588
  8. kisame010588
  9. App Update
  10. App Update

Share This Page