yashsingh1/xdaforums huggingface dataset:
[Redmi Note 2 Android Development] jajk:
[MENTION=5761138]everdeath66[/MENTION] Skinny_Pro_MIUI8_6721-16_boot.img posted. You should freshly install SuperSu via TWRP and update Busybox as well as installing the boot.img.

You will also need to create an init.d script to optimize everything.

The supplied build.prop is obviously from an MR ROM. It has some crap stuff in it that should be deleted as follows:

delete all these lines:

persist.sys.klo=on
persist.sys.whetstone.level=2
# Generated by BARS
ro.translation.build=BARS
persist.sys.timezone=Europe/Moscow
ro.build.originalname=deodexed_miui_HMNote2_6.7.21_f6bdfeaeb0_5.0
ro.build.jenkins=nojenkins
wifi.supplicant_scan_interval=180
ro.ril.disable.power.collapse=0
pm.sleep_mode=1
debug.performance.tuning=1
video.accelerate.hw=1
windowsmgr.max_events_per_sec=150
ro.ril.hsxpa=3
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
ro.media.enc.jpeg.quality=100
debug.sf.hw=1
ro.lge.proximity.delay=25
mot.proximity.delay=25
dalvik.vm.dex2oat-thread_count=4
dalvik.vm.dex2oat-filter=everything
dalvik.vm.image-dex2oat-filter=everything
ro.product.locale=ru-RU
ro.custom.build.version=6.6.2

Change lines to these values:

dalvik.vm.heapgrowthlimit=128m
dalvik.vm.heapmaxfree=8m
dalvik.vm.heapminfree=512k
dalvik.vm.heapsize=256m
dalvik.vm.heapstartsize=8m
dalvik.vm.heaptargetutilization=0.75

Let me know how this version goes for you. It can be used on all MIUI8 releases so far.
[Redmi Note 2 Android Development] everdeath66:
Thank you for your work and a modified boot for me and for all ho use last miui8 BUT:

After testing found that mutations both in comparison with the original Boot no.

Maybe this feature miui8 (

But after 3 hours of tests in the games and various benchmarks antutu difference with the original, no!

If you can - test your Boot on your phone with the latest miui8.

p.s

I did everything you indicate in buid.prop

Install busybox

And flash your boot.ini (Skinny_Pro_MIUI8_6721-16_boot.img)
[Redmi Note 2 Android Development] everdeath66:
Performance mode works in general in miui8 ?

Because in this mode miui7 with custom Boot (miui speed mod v1.19)

Phone worked much better .

here is that your boot that with the stock just the same (
[Redmi Note 2 Android Development] everdeath66:
miui7 vs miui8

Is poor performance from bacup miui7 global 7.2.2.0 and miui speed mod ( is is the name of custom boot)

And work better read from sd card

And here a miui8 6.7.21 with your boot.img

Very slow sd card speed and bad performance(
[Redmi Note 2 Android Development] jajk:
[MENTION=5761138]everdeath66[/MENTION] Do not be so judgemental without an understanding of what you are dealing with:mad:

If you want good benchmarks, freeze your phone and/or apply a mod that is overly willing to turn on all your cpus at max frequency and ignore thermal policy. I know exactly why some mods achieve 55k in Antutu and it is not being clever at all.

Skinny does nothing to improve synthetic benchmarks by itself since it keeps the Interactive governor, cpu Hotplugging and thermal policy the same as stock. It does however provide init.d support so you could emulate what Speedmod does if you really have to.

I will look into the apparently slow sdcard performance - maybe SpeedMod ups the readahead to some insane value?

I will install MIUI8 when it is released:cool:
[Redmi Note 2 Android Development] everdeath66:
Is released ))

---------- Post added at 07:37 AM ---------- Previous post was at 07:37 AM ----------

And thank your for a work!
[Redmi Note 2 Android Development] jajk:
[MENTION=5761138]everdeath66[/MENTION] MIUI8 for RN2 is still in beta testing phase and is not released as a final product yet.
[Redmi Note 2 Android Development] jajk:
In MIUI8 or 75xx versions, it should be possible to limit the number of cpu cores by a different method to what has been done in past init.d script examples.

In init.mt6795.rc you will see these lines:

# update foreground cpuset now that processors are up
write /dev/cpuset/foreground/cpus 0-7
write /dev/cpuset/background/cpus 0

This is setting 8 cores max to foreground tasks and 1 core max to background tasks.

So we should be able to set core limits in init.d script as follows:

echo "0-3" > /dev/cpuset/foreground/cpus
echo "0-1" > /dev/cpuset/background/cpus

This being an example to set 4 cores to foreground tasks and 2 cores to background tasks. I do not know if we need more than 1 core for background tasks but the option is there to experiment with.

For better heat distribution in the chip, it may be better to set different cores for foreground and background e.g. 0-6 foreground, 7 background.

Edit: Settings do not stick if core numbers don't start at 0
[Redmi Note 2 Android Development] jajk:
Skinny_Pro_MIUI_714-final_boot.img and Skinny_Pro_MIUI7_7510-final_boot.img uploaded.

714 based image is suitable for 7.1.0 up to 7.3.20 and 7510 is suitable for 7.5.10 up to 7.5.30.

Both disable everything that can be disabled while still having a fully functional phone. This clears the way to getting fantastic battery and performance as long as you follow through with some smart init.d scripts and app choices. Famous quote: "Install crap and your phone will become crap" and.............

Everything will not work in the hands of a noob:laugh:
[Redmi Note 2 Android Development] Dr Grato:
well, roughly i get through this forum, im very eager to try. going to backup my phone now, and try your stuff. :)
[Redmi Note 2 Android Development] Dr Grato:
will this things conflict with your stuff? and also, Lspeed app.
[Redmi Note 2 Android Development] intruder16:
Fantastic thread. Even though i don't own a RN2, i just read all 35 pages of this thread!

Can you make it for Mi3W?
[Redmi Note 2 Android Development] Dr Grato:
Well, im using this for 4hours now. Bit laggy sometimes when typing. But other thing, yep superb. Fast boot. Fast response. Smooth. Good work. But still wondering about the laggy part. Im using LSpeed, and GovTuner. Both things not conflicting each other. Yours not too. Confirmed it by asking the dev himself.
[Redmi Note 2 Android Development] DarthJabba9:
Works fine here (with 7.5.10), thanks.
[Redmi Note 2 Android Development] jajk:
[MENTION=5338267]intruder16[/MENTION] I can't make it for a phone I do not have but if you are capable of unpacking and repacking a boot.img, you can create your own to some degree. In my images, most of the edits are self-evident so you can cherry pick the more obvious things.

[MENTION=6264717]Dr Grato[/MENTION] What ROM version? LSpeed and GovTuner can upset things depending on what settings you activate. Lags can be due to background apps hogging cpu time or bad settings for the governor, LMK etc. Have you cut out all the Xiaomi bloatware? The only time I noticed a strange lag was when I first installed 7510 and it was downloading 100MB in the background (without my knowledge) to update Android/Gapps related stuff. Once it had finished, lags went away.

[MENTION=5850987]DarthJabba9[/MENTION] Have you tried the alternative core limiting technique? I don't know how to directly check if it works but I guess a benchmark would prove if cores are indeed limited.
[Redmi Note 2 Android Development] intruder16:
That's what i thought at first. Can you do me a favor and send me a unmodified & modified version of the same boot.img? Thanks!
[Redmi Note 2 Android Development] jajk:
[MENTION=5338267]intruder16[/MENTION] Post your current boot.img and I will give you a headstart with the obvious edits. You can fine tune from there.
[Redmi Note 2 Android Development] DarthJabba9:
I haven't tried it yet. I will do so later. The app I use to check the number of cpus running (and several other things too) is "System Info for Android", by "ElectricSheep".
[Redmi Note 2 Android Development] intruder16:
Attached.
[Redmi Note 2 Android Development] Dr Grato:
Well, ur stuff is kernel stuff right? So LSpeed and GovTuner will not affected. Anyhow, im interested with the bloatwarw u talked about. After using ur kernel, i can simply uninstall all the bloatware? Delete it by using apps or by go throught ita folder in system/apps ? Thanks for the response ?
[Redmi Note 2 Android Development] DarthJabba9:
It works, because you can see the impact on the multi-core results of the Geekbench 3 benchmarks. The other methods of checking do not exactly show how many cores are disabled.
[Redmi Note 2 Android Development] Dr Grato:
Well, i suffer lagging using this. Maybe i got no luck to use it(noob).
[Redmi Note 2 Android Development] jajk:
[MENTION=5338267]intruder16[/MENTION] Your boot.img is much better configured (being a qualcom based device). Instead of loading a long list of drivers haphazardly to eventually get the required ones loaded, it conditionally processes so only the desired drivers get loaded in the first place. Example:

case "$platform" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
case "$soc_hwplatform" in
"FFA" | "SVLTE_FFA")
# linking to surf_keypad_qwerty.kcm.bin instead of surf_keypad_numeric.kcm.bin so that
# the UI keyboard works fine.
ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin
;;
"Fluid")
setprop ro.sf.lcd_density 240
setprop qcom.bt.dev_power_class 2
;;
*)
ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin
;;
esac

There is far less requirement to skinnify but if you still want a boot.img with init.d support, let me know.
[Redmi Note 2 Android Development] intruder16:
Init.d support is not necessary. I was looking to disable xiaomi init or any other unnecessary services. Can you tell me which init scripts to edit? Thanks.
[Redmi Note 2 Android Development] jajk:
[MENTION=5850987]DarthJabba9[/MENTION] Thanks for the confirmation.

[MENTION=6264717]Dr Grato[/MENTION] Too many variables that are under your control and not mine. By using other tweaking software, you are inviting failure.

My mods are to the files contained in the ramdisk, not the kernel. A boot.image consists of both a kernel and a ramdisk containing configuration files

i.e. boot.img = kernel + ramdisk

Nobody has made a custom kernel for our phone since the source code needed to compile one has never been released. This does not stop people offering up so-called "custom kernels" for the gullible noob market to feed on.
[Redmi Note 2 Android Development] jajk:
[MENTION=5338267]intruder16[/MENTION] Sure, I will post the edited files for you. Have you the tools to unpack / repack the image already? AndroidMasterChef_3.02 by Iceman is capable if you have not yet found some software.
[Redmi Note 2 Android Development] jajk:
[MENTION=5338267]intruder16[/MENTION] See attached ramdisk. Edited lines start with ###. It is a pretty clean boot.img to start with compared to Xiaomi MTK devices.
[Redmi Note 2 Android Development] intruder16:
I am using Android Image Kitchen by osm0sis. I'll give AndroidMasterChef a try too.

I'll look into it right now. Thanks for all the help. :good:

EDIT : It seems like you uploaded the original ramdisk by accident.
[Redmi Note 2 Android Development] jajk:
[MENTION=5338267]intruder16[/MENTION] Let's try that again....
[Redmi Note 2 Android Development] intruder16:
Got it! Thanks!

Also, i know i said no to init.d before but to add it this guide should work right?
[Redmi Note 2 Android Development] jajk:
[MENTION=5338267]intruder16[/MENTION] That will work but.....

3 problems:

1. Scripts will be run at an indeterminate stage of the boot therefore settings may get overwritten later on in the boot process.

2. The run-parts command is a bit flakey and sometimes does not process scripts beyond the first one or may stop part way through a script.

3. This does not automatically create the init.d folder with correct permissions if it does not exist.

To get around these problems, add the following to init.rc

#Add init.d support
service sysinit_d /sbin/sysinit
class main
user root
disabled
oneshot

on property:sys.boot_completed=1
start sysinit_d

Then create a file called sysinit in /sbin folder with contents as follows:

#!/system/bin/sh

# Mount partitions rw to apply tweaks and settings
mount -o remount,rw /;
mount -o remount,rw /system
sleep 1
#Make init.d folder if it doesn't exist
mkdir /system/etc/init.d
sleep 1
chown -R root:root /system/etc/init.d
chmod -R 0755 /system/etc/init.d
sleep 1
#run scripts in init.d folder
for FILE in /system/etc/init.d/*; do
sleep 1
sh $FILE >/dev/null
done;

# remount partitions ro once finished
mount -o remount,ro /;
mount -o remount,ro /system
[Redmi Note 2 Android Development] intruder16:
Will try this. I'm gonna stop saying thanks now.
[Redmi Note 2 Android Development] jajk:
Skinny_Pro_MIUI7_7510-final-6729kernel_boot.img posted.

This is Skinny_Pro_MIUI7_7510-final with the kernel from 6729. This is the first change to the kernel since 7510 and MIUI8 betas arrived so it must be for good reason - right:confused:

Skinny_Pro_MIUI7_7510-final already has the newer healthd file from 6729

I have been running this for 2 days without issue.
[Redmi Note 2 Android Development] jajk:
[MENTION=5338267]intruder16[/MENTION] With mcd services disabled, you can set up your own zram if you are tight on free memory. Remember to also set some rational values for lowmemorykiller. These 2 settings will largely determine how well apps will stay in memory.
[Redmi Note 2 Android Development] intruder16:
I have not used zram yet. I'll read about it and set it up asap. For LMK i use this values usually :1024,2048,4096,8192,12288,16384.
[Redmi Note 2 Android Development] jajk:
[MENTION=5338267]intruder16[/MENTION] On a phone with 1920x1080 display, the values need to bumped up a bit since every app consumes a lot more memory. I use 6144,9216,12288,16384,24576,32768.

If your phone has the same display, bump up the values a bit more.
[Redmi Note 2 Android Development] jajk:
deleted double post
[Redmi Note 2 Android Development] intruder16:
Yes it has same FHD display and 2 GB ram. I'll experiment with your values then.
[Redmi Note 2 Android Development] jajk:
Skinny_Pro_MIUI7_7510-final-6729kernel_boot-experimental.img uploaded.

Changes are as follows:

init.rc: Add these lines:

### From Mi3 init.rc - this is useful - RN2 stock sets these to 1 in the absence of these lines

# disable icmp redirects

write /proc/sys/net/ipv4/conf/all/accept_redirects 0

write /proc/sys/net/ipv6/conf/all/accept_redirects 0

### From Mi3 init.rc - add the missing lines for system-background cpu settings to work

mkdir /dev/cpuset/system-background

write /dev/cpuset/system-background/cpus 0

write /dev/cpuset/system-background/mems 0

init.mt6795.rc - re-enable the already existing line. Possibly change value to 0-1

write /dev/cpuset/system-background/cpus 0-3

I noticed that the system-background part of the settings was not complete and would never work so disabled the corresponding line in init.mt6795.rc in previous versions.

While looking through [MENTION=5338267]intruder16[/MENTION] supplied Mi3 boot.img, I saw it had the complete syntax to enable this so I have. Hard to say what sort of impact this will have and how to test it, but it is there for the adventurous to play with.

The disable icmp redirects enhances network security.

Edit: I don't think that any services are using system-background because there are no PIDs being written to /dev/cpuset/system-background/tasks

No harm in these lines being there but of no benefit in our phone.
[Redmi Note 2 Android Development] jajk:
Revisiting the init.d scripts operating under the MIUI8 and MIUI7.5 environment:

It appears that we can significantly rework the Interactive Governor settings to increase responsiveness (maybe this is the cause of lagginess some MIUI8 users complain about?)

I am now running the following timings without problem:

# Tweak CPU Governor
echo 806000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 95 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 99 1950000:99> /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 16000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 8000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 8000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo 24000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack

Do not use Kernel Aduitor to check cpu states as the app itself creates too much background activity which affects the outcome. CPU-Z works fine as may others.

Obviously change the 1950000 to 2158000 if you have the fancy version:)

The result depends on how much background activity your phone has which is related to how many apps are running in the background. If you cannot get a stable 403MHz idle, increase timer_rate value until you can or delete/freeze/change some apps.
[Redmi Note 2 Android Development] jajk:
Found an interesting file called cpufreq_power_dump There is also one for the gpu gpufreq_power_dump of less interest. The figures will be different on every phone as these are real measurements taken at different times.

Copied the figures into a spreadsheet (attached). This should make it easy to see the impact of limiting cores and/or frequency without relying on hearsay or myth.

Axis are vertical power consumption in milliwatt and horizontal number of cores (too lazy to put labels on everything)

Enjoy;)
[Redmi Note 2 Android Development] DarthJabba9:
Where is it located? Thanks.
[Redmi Note 2 Android Development] jajk:
I have uploaded my own personal use version of skinny boot.img which is all out skinnied : Skinny_Pro_MIUI7_7510-stripped_boot.img

All unneeded entries are deleted, not commented out, plus there are changes beyond previous offerings. Full functionality is maintained.

[MENTION=5850987]DarthJabba9[/MENTION] Your filemanager not have search:laugh: Try looking in /proc/cpufreq and /proc/gpufreq.
[Redmi Note 2 Android Development] DarthJabba9:
Found! Thanks.

PS: easier to ask than to search :p
[Redmi Note 2 Android Development] IshtaNoob:
I've been tinkering with the init.d scripts as you suggest, and used SD Maid to freeze some apps and remove boot permissions from some other. I did it on sMIUI 6.7.28 developer (based on xiaomi.eu's ROM). Result: whereas on stock xiaomi.eu's ROM I got 2h20m SoT, on the tweaked sMIUI I'm getting 3h!

And I just realized I misspelled some of the commands on the script, lol

On your last posts you say you uploaded Skinny_Pro_MIUI7_7510-final-6729kernel_boot-experimental.img and Skinny_Pro_MIUI7_7510-stripped_boot.img; which should I use?

Edit: none of them goes past the boot screen...
[Redmi Note 2 Android Development] algida79:
[MENTION=6988990]aghr11[/MENTION]

What are your screen brightness settings? Our phone's Tianma LCD panel is notorious for consuming extra energy compared to others. Maybe try to lower the brightness a bit and avoid using auto brightness when possible?
[Redmi Note 2 Android Development] aghr11:
Hey [MENTION=4255601]algida79[/MENTION],

I have never used the auto brightness feature, most of the time the brightness is less than 25%...
[Redmi Note 2 Android Development] algida79:
Well, you 're frugal then, so this wouldn't be the cause. Sorry for butting in! :)
[Redmi Note 2 Android Development] aghr11:
Nope dude, am just thankful for your attempt to help..

Am really sick from this battery-draining-for-nothing...
[Redmi Note 2 Android Development] DarthJabba9:
Yes, it's a real nuisance. However, the culprits are mainly the Xiaomi junk; the battle to remove the removables among them continues. If you have developer options enabled, you might want to disable "Use NuPlayer". I have also disabled "Turn on MIUI optimization" (I use "RecentTask" in its place, but I think all these memory optimisation apps are just for placebo effect). Finally, I have limited the cpu speed to 1625000 mhz, which is perfectly fine - no lags, etc. It was also perfectly fine when I limited it to 1469000 mhz (which I may well return to, as I haven't seen any benefit of a high speed other than for boasting about dubious benchmarks).
[Redmi Note 2 Android Development] jajk:
[MENTION=6988990]aghr11[/MENTION] Battery drain problems are relatively easy to diagnose and fix.

1. Know which apps are running and what does not need to be running

2. Know how your cpu is behaving and why.

Step 1 needs something like SD Maid or Titanium Backup to see what apps are running and to have the ability to freeze or disable autoruns (receivers)

Step 2 needs an app like Kernel Aduitor or CPU-Z to see what's happening with the cpu.

Throwing so called tweaks at the problem will only make things worse - everything must have a demonstrated beneficial outcome. Less is more in this phones case.

Come back with a list of what apps are running, what ROM you have and what frequency the cpu is sitting on if you just stare at the phone doing nothing.

From there, there are options you can take - this phone can get seriously good battery time if you do things right.

sMIUI comes with a bunch of tweaks embedded last time I looked. If you flash the skinny pro boot image afterward, most of the tweaks will disappear - check you don't have other files sitting in init.d folder. They will very likely conflict.
[Redmi Note 2 Android Development] aghr11:
[MENTION=5952980]jajk[/MENTION], [MENTION=5850987]DarthJabba9[/MENTION] Thank you so much guys, that really did help!

Although I reduced the CPU frequency once and it didn't help, this time I can notice a huge difference!

I used "Redmi Note 2 Tool" and "SD Maid" (and kernel auditor to check how is the CPU doing), I reduced the CPU frequency to 1482 mhz and limited it to 4 cores, and used the quick ramp profile. Also disabled most of the apps autoruns with SD Maid and frozen some, and Imma likely going to freeze some system apps.

I'm expecting some lags because of what I have done to the CPU ofcourse, but I do not use the phone that heavily, just some WhatsApp and Chrome and Inbox stuff, and mostly watching movies or anime...

Thank you so much, am really so thankful and grateful for you guys :D

---------- Post added at 12:54 PM ---------- Previous post was at 12:48 PM ----------

By the way [MENTION=5952980]jajk[/MENTION], I understand that I should not flash your boot.img while using sMiui?
[Redmi Note 2 Android Development] DarthJabba9:
Is it just me, or is Windows explorer now seeing double (directory names being repeated) when the internal sdcard is mounted in Windows?
[Redmi Note 2 Android Development] Dnxss:
Find my device app is showing me force close. What can I do?
[Redmi Note 2 Android Development] insestito:
Work on CM ?

Thanks!
[Redmi Note 2 Android Development] jajk:
[MENTION=5850987]DarthJabba9[/MENTION] You are right - I will look into it.

[MENTION=6988990]aghr11[/MENTION] If you are using Redmi Note 2 Tool and sMIUI then you should not use my boot.img because you are mixing conflicting tweaks.

[MENTION=5669707]Dnxss[/MENTION] That will be the case because some communications back to Xiaomi are severed. If you want all functionality with Xiaomi, don't use this boot.img.

[MENTION=1928598]insestito[/MENTION] Generic AOSP version should work on Cyanogen - try it. It is easy to reflash the original boot.img back if it is not to your liking.