yashsingh1/xdaforums huggingface dataset:
[Sony Xperia M2] Miche1asso:
RAISE ALL MAX VOLUMES (it needs root):

Many complains that in Lollipop 5.1.1 the volumes went lower. There seems to be a solution for it. As suggested by [MENTION=5459289]Ciptraandoni[/MENTION] in the files

/etc/mixer_paths.xml
/etc/mixer_paths_VY55.xml
/etc/mixer_paths_VY58.xml

Look for the lines:

<ctl name="RX1 Digital Volume" value="84" />
<ctl name="RX2 Digital Volume" value="84" />
<ctl name="RX3 Digital Volume" value="84" />
<ctl name="RX4 Digital Volume" value="84" />

Raising the value 84 by a little bit in

all

files improves the max volumes. I personally tested it. With the value 88 it was fine, then raised them to the value 91 I have got some distortion. So do it at your own risk.

Also always remember to backup your system files first!!

TRIM YOUR NAND (it needs root):

Since Android 4.3 Google introduced the Trim (see link) in the kernel, which should restore the performances on SSD/NAND after a long use. It should be executed regularly by Android (not sure when), still after manually trimming my ext4 partition in the SD card it reported more than 9 GB cleaned. To execute it yourself first check if fstrim is available on your busybox. As root type in the terminal:

busybox fstrim

If present you'll get the list of options, otherwise an error. If fstrim is available type ("-v" is the verbose option):

busybox fstrim -v /system
busybox fstrim -v /data
busybox fstrim -v /cache

then, as usual, you can put the last three lines in a /etc/init.d script (they don't take very long. less if recently trimmed).

ONE SHOT KITKAT ROOTING:

[MENTION=4787101]linuxct[/MENTION] made a modified rootkit script which exploits one of the latest KK vulnerabilities, allowing to root KK without the need to downgrade the kernel. With my help he also modified the script to disable the RIC in one shot. ;)

You can find the instructions in here.

This isn't directly Lollipop related, but since we need to go through a rooted KK to have a rooted Lollipop i thought to add it here.

IMPROVE THE APPEARANCE OF YOUR ROM

Click on the Google Play button on my signature and download one of my themes. Most are free! Also don't forget to rate them 5 stars. :D
[Sony Xperia M2] linuxct:
Great! I thought it was my router problem (WRT160NL + DDwrt), but I'll disable that wifi option. Thanks!
[Sony Xperia M2] Miche1asso:
You're very welcome, amigo. :D

Also you may want to try to mess up with the router's QoS settings. But if working (I can't test it myself) that will fix it only for your router. The solution above is much more general. Not sure what are the downsides, but in case, on a weak signal, just manually disable the WiFi yourself and use 3G/4G (the radio?).
[Sony Xperia M2] linuxct:
I have QoS disabled, but I noticed that in both routers I have (160NL and Archer C20i), the exclamation mark only appears when I'm far from them, in another room for example. So it's because of the poor signal, even though some times it shows all bars (max. signal) and the warning. :silly:

I'm going to stay with the setting on 0, and if it still shows the exclamation mark, then I'll try configuring my routers. Grazie :D
[Sony Xperia M2] Miche1asso:
Just out of curiosity, when showing the exclamation mark does it switch to 3G/4G? In my case it just drops all connections, and to add insult to injury it happens even few cm from the "router" (which is actually the internet shared via MacBook since the WiFi fried in my router).
[Sony Xperia M2] linuxct:
It drops all connections. I noticed once, because Whatsapp web stopped working. Then I check the phone and the exclamation mark is there. Turn it off and on and it works again.

And yes, I was very near my router, let's say 50cm?
[Sony Xperia M2] Miche1asso:
Ok, same experience then. So it's better staying off and good riddance!!
[Sony Xperia M2] aidy.lucas:
Not had any WiFi problems all I know is I have min 50mps home broadband with 5ghz and 2.5ghz networks my data connection is running fine on 4G/3.5G battery is definitely worse but I was running amplify, greenify with a de-bloated ftf and getting 6hrs plus sot regularly it's gonna take me a while to get used to normal battery life again

D2303 5.1 lollipop customised NCB rooted de-bloated LB t2u nut dual recovery x-reality+supervivid
[Sony Xperia M2] Niklaus89:
Hello

I have also this wifi problem but i don't understand how to fix it.

I tried, as it's written, to write the command in a terminal app, but it said that i don't have the permission to execute it.

My phone is rooted and i tried also somehow to have the sudo but it didn't work either.

Someone could explain to me what should i do ?

Thank you.
[Sony Xperia M2] Miche1asso:
Well, you probably remember that I was complaining about KK battery life. Now staying with WiFi and applying the tweaks above, in about 17h I had a drop of 24%. about 70min usage. In other words it was less than 1.5%!!

I'll test it in 4G, but my signal is crap, so I don't expect much . Still the Stamina mode (completely enabled, with the usual apps in white list, like Whatsapp) seems to do a great job, finally.

That's weird. I just doubled checked and it works with both the user and root accounts. i mean, there is little to explain, you just have to type this command:

settings put global captive_portal_detection_enabled 0

I am not sure either what you mean with "i tried also somehow to have the sudo ". To "sudo" in a rooted android you just type "su". "su -c <command>" to run a command (like "su -c id". That should report user 0 and group 0).
[Sony Xperia M2] Niklaus89:
Okay thank you, finaly i did it.

I still couldn't do it without typing "su". Thank you.
[Sony Xperia M2] dark90:
I dont know if its ok this, but i Just use my celphone today on facebook and whatsapp and a hour of videos on YouTube, without you tip (i Just used with wifi)
[Sony Xperia M2] aidy.lucas:
I got roughly 5.5hrs screen on time yesterday with no changes to settings. Still not sure about how fast the battery drains though

D2303 5.1 lollipop customised NCB rooted de-bloated LB t2u nut dual recovery x-reality+supervivid
[Sony Xperia M2] ~Patryk:
Is there appreciable difference in performance between zram on and off ? Antutu Benchmark shows 19421 points for ON zram and 19889 points for OFF :D
[Sony Xperia M2] Miche1asso:
Pantalla is screen? And you have got 9+ hours? You're more than fine then. Indeed I am not sure if that iowait thing is a general problem. Can anyone with the zram on and possibly busysbox installed, check the iowait average values using the command

busybox iostat

I wonder if it is anything wrong with my installatiom, but I had the issue even just after wiping the data.

Yeah, I can't manage to make a real battery evaluation myself. I am still connected many times with adb and that charges the phone, ruining all battery statistics.

Well, technically on small jobs the zram does reduce slightly the performances. You see the benefits when you open a previous application, it should have the app screen as you left it more often than when it is turned off.

BTW any chance you can do the test mentioned above? The one about iostat. :D
[Sony Xperia M2] linuxct:
Average of 14%. Bouncing from 13.3% to 14.5% in my case.

Oh, BTW, yes, CE1 has zRAM, but Algerian FTF was working worse than this one.

EDIT: Now it went up to 25.04%. Well, sh*t. The values I took before were after a reboot, so, when the device is fresh, just restarted, it only uses a 14~15%, but after opening apps it goes up :D
[Sony Xperia M2] Miche1asso:
Indeed. Mine is stuck at 30-40%. Even higher as you can see from the "top" output in the first post (but that's for a single moment). This is what I get now with zram disabled about one night after reboot :

avg-cpu: %user %nice %system %iowait %steal %idle
14.00 1.79 10.87 4.13 0.00 69.21

And now I reboot the phone not touching the zram. here now just after boot:

avg-cpu: %user %nice %system %iowait %steal %idle
24.30 3.89 31.94 14.59 0.00 25.29

Which would be ok, but it is raising. Indeed now, just after few minutes..

avg-cpu: %user %nice %system %iowait %steal %idle
13.67 2.82 17.22 31.39 0.00 34.91

31.39% and it keeps raising. Nope, disabled it stays.

Just to be clear, since a picture it worth 100 words, this is the effect of having an high iowait:

[IMG="CPU status"]https://dl.dropboxusercontent.com/u/34455199/2015-10-05%2011.40.41.png[/IMG]

The CPU stays most of the time at full frequency. Often just for doing nothing but waiting for kswapd0 trying to access the RAM.
[Sony Xperia M2] linuxct:
Clear enough. Just added swapoff to my 00stopric. Now let's see how multitasking goes ;)
[Sony Xperia M2] swnny:
su
swapoff /dev/block/zram0

fails for me... Central Europe prerooted, flashed with twrp. My %iowait is around 23% and counting...

Edit: After an restart, it executed the command just fine, and my idle time is normal.

But now there is another problem - I cannot open 00stop_ric as a text, to add the command... tried both es explorer and total commander... any idea?
[Sony Xperia M2] krule031:
After updating to newest firmware, those io lines dont work for me any more.

Even with swappiness=90 the io stays at 50%

Anyone knows why?
[Sony Xperia M2] Miche1asso:
Depending on the number of applications installed you have to wait up to 10 minutes, sometime even more (mine starts to go down after 11-12 minutes). Also be sure that you have set the vm.laptop value, it is the one doing the trick.

Then if everything is in place and after 15 minutes the IO Wait never goes down to 0-5% you may have an app behaving badly. Still the best way to monitor is to check the time in states (what CPU frequencies are used the most). You may download this app, it's pretty neat: https://play.google.com/store/apps/details?id=com.dsmartapps.root.kerneltweaker&hl=en

then leave the phone charging (to avoid the deep sleep) for an hour or more and check the frequencies. The 787Mhz frequency should be at least on par with the 1190Mhz (the IO wait make the freq going higher): Attached is a screenshot of mine, you see how the 787MHz is used most of the time.
[Sony Xperia M2] krule031:
It is now second day as I booted the phone, and the situation is the same.

Check screenshots here:

I wrote swappiness=80 when testing, but results are the sam with 90 or 60.

And I will check the app and post the results after testing.
[Sony Xperia M2] rezalmfao:
How lag problem be resolved? :(

Help Me! :(
[Sony Xperia M2] Miche1asso:
I told you how: repair the phone with PC Companion. As written in the main post this is not a thread for generic help anyhow. It's about the tips listed.

[MENTION=4888288]junk031[/MENTION] Lower the swappiness, higher the chances of IO wait going down (but lower the number of apps in "multitasking"). Also the IO Wait still goes to 50% no matter what. So you should look at that screen for a few minutes and see if it ever goes down. Still the best thing is to use the app I mentioned.

Then I see gms (Google Play Services) is running. In my case cleaning the data of it and Google Play (from Settings/Applications) apparently solved a lag issue I had (and allowed me to finally install FaceBook - don't ask, I do need it :D). It's a medicine suggested in many instances, and often it works. Maybe you could give it a try.
[Sony Xperia M2] krule031:
[MENTION=4590098]Miche1asso[/MENTION]

Ok I will test it and then post the results.

I changed swappiness to 70 and cleaned the Gms data. :good:

EDIT: I am such an idiot.

I wrote "swappines" instead of "swappiness".

But the situation with IO is the same, lol.
[Sony Xperia M2] Miche1asso:
Nah. I'm sure it's working now. Nice finding, though! :D
[Sony Xperia M2] krule031:
Here:

After one night on charger.

Oh and it is the same in the terminal most of the time its cca. 50:50%
[Sony Xperia M2] Miche1asso:
Well, it does go to 787MHz. Not much, though. Still this started because you misspelled a command. It would be a coincidence if it still won't work after having fixed it. And Dr. House doesn't believe in coincidences. :D

Anyway, try to past in here the output of this command:

sysctl -a | grep vm\.

and let's see if the values are as they should.
[Sony Xperia M2] krule031:
I should paste that command to init.d script or in the terminal?

Why is laptop mode=0?

I must have misspelled something wrog again.

Edit: I deleted all lines and wrote them again with a few reboots, everything works now.

Big thanks for help!
[Sony Xperia M2] Miche1asso:
[MENTION=4888288]junk031[/MENTION]

Misspelled again. As I thought. Dr. House is always right!! :D
[Sony Xperia M2] krule031:
Firstly I copy-paste those lines so something got bugged I suppose.

After typing them manually everything worked.

Dr. House ftw! Ahahah
[Sony Xperia M2] Billys20:
I still face the gps problem even after updating to .182.No gps signal at all...
[Sony Xperia M2] Miche1asso:
Hmm. Nope. I'm afraid no signal has never been an issue before. Have you tried checking with an app Like GPS Status? Here: https://play.google.com/store/apps/details?id=com.eclipsim.gpsstatus2&hl=en

Also sorry for stating the obvious but it's better if you are outside while checking. From a window would do.
[Sony Xperia M2] krule031:
Hey.

I just wanted to ask is this normal?

Something keeps my phone awake idk, and like at the night, it goes down few %, but before it was like I left it before sleep.
[Sony Xperia M2] Miche1asso:
You must check the kernel wakelocks. Those are from the apps.
[Sony Xperia M2] aidy.lucas:
You want better battery stats app aswell as it'll tell you what's keeping your phone awake it also tells you how many times each app/service has woken up your device it's in the xda community apps section and it's free on playstore you have to pay for it. Set minimum frequency to 300Mhz in build prop file aswell Mine seems to deep sleep much better like this.
[Sony Xperia M2] krule031:
Oh please no.

Because of that app I somehow got bootlop and had to do the rooting procedure all over again.

So, no thanks lol.

Here, kernel wakelocks:
[Sony Xperia M2] Miche1asso:
I had many issues with BBS as well. Reboots and stuff. I first froze it to see if it was the culprit (and it was), so I uninstalled it. That was few months ago (still the beta of the new major release, I think), not sure if he fixed it.

Nah, it seems quite normal to me. Before I misread the chart, I thought it was 15h of wakelocks. I get up to 24% wakelock time quite often (right now I am at 20%). Although just two days ago my battery usage was 1.7% per hour, with 1h of screen. Which was great. After nearly a day I was at 66%. Obviously after charging and rebooting the phone it's back to

my typical 2.5%/h.

Actually I see now your wakelock time is 11% on the second image. Nothing to worry about.
[Sony Xperia M2] krule031:
God damn BBS.

Then I will not worry, thanks for explaining.

Some of the wakelocks was a ConnectivityService, which was woken alot, but that solved after rebooting now.
[Sony Xperia M2] aidy.lucas:
Never once had issues with bbs it's a superb app for finding out what is draining and how often.
[Sony Xperia M2] krule031:
I installed it as a system app and restarted, then uninstalled it and got bootloop lol.
[Sony Xperia M2] aidy.lucas:
Did you use the uninstaller zip provided to remove it as there's two apps installed once it's made a system app for some reason. Never once got bootloop from using it on KK or lollipop
[Sony Xperia M2] Miche1asso:
Maybe it's because I have another battery monitoring app installed in /system (just the piece needed by root). I don't know, maybe they conflict. Still personally I prefer Wakelock Detector. I like the fact that it doesn't need to run in background and if there is an issue it gives out enough info to identify what's keeping the phone alive. Not that I had many wakelock issues with the Xperia M2 anyway. Apart from the typical PowerManagerService and gpio_keys_wakelock, they are always causing most of the wakelocks, whatever they do.
[Sony Xperia M2] artur1131:
Even after using the solution from first post, gps still doesnt work. What i could do wrong? I uncomented the Europe hash, im on .175 (is there any way to update to .182 without losing everything? Im on z5 experience).. I really need gps for driving :(

On GPS Test there are "25 In view" and "0 in Use".. I can post screen when ill be back from office.
[Sony Xperia M2] krule031:
You can flash the .182 ftf but you will lose root and all system tweaks you made previously.

But your apps will stay untouched.
[Sony Xperia M2] Miche1asso:
Did you use the KK gps.conf file? It's the fastest workaround. And it worked fine for me.

Regarding updating.. You should ask the Z5 Experience developer to update it using the .182 FTFs. :)

Otherwise it is as Junky (what a nickname!! :p) said.
[Sony Xperia M2] krule031:
The origin of that name is that "Junk" was my graffiti tag when I used to write that stuff everywhere lol.
[Sony Xperia M2] Miche1asso:
Just an update about the WiFi. I bought a new router (a cheap TP-Link but it does the job) so I did some testing. In 18.6.A.0.182 as soon as I enable the Global Captive Support I get the exclamation mark. It doesn't drop the connection anymore but it is quite annoying. But I do have a Vodafone hot spot in my area. Which is good, because I am actually using it via the new router with my brother in law account. Free Internet, I can't complain much. :D
[Sony Xperia M2] krule031:
About that lag when brightness is higher than 25%, I must say that is true.

Both me and my friend looked really carefully and there is somewhat of lag.

It is kind of stuttering in sliding between screens, and pulling the notification bar.

I just really dont know what causes this.

I'll try to capture this with another phone and upload a video.
[Sony Xperia M2] :
A question, do you guys experience screen dimming when the screen shows certain colours?

If you go into display settings, and tap brightness the screen will light up while the brightness slider is there. Not related to adaptive brightness or backlight control, when viewing pictures the screen might violently dim or brighten based on the colour.
[Sony Xperia M2] krule031:
Hey guys

I was wondering, why doesn't my script doesn't even show in the etc/init.d folder? Even if I run RICkiller it doesn't show at all :/

If I make the file myself, it dissapears when I leave the folder lol
[Sony Xperia M2] Th3 Ant:
Have you tried changing the name of the file and adding .txt at the end?

Also there is a fix for NFC icon not showing as some people are complaining about that.

Change the line ro.nfc.icon.enable from false to true. I just tested it and it works.
[Sony Xperia M2] swnny:
Didn't work.

I had to switch of ES File Explorer's "New Layout" option, and then it opened it without any problems. Dunno new layout has to do with all this.
[Sony Xperia M2] ~Patryk:
Flash this
[Sony Xperia M2] Andrej732:
Does anyone notice sometimes that phone can lag a bit. I mean it's like lagging for about 15 seconds and then it backs to normal.
[Sony Xperia M2] Miche1asso:
Does it happen when running root applications? I've seen since KK that su sometimes gets some delays (it spam requests for authentications slowing down the whole system). It just happened to me now with a new app I just installed. I hoped that issue had gone.
[Sony Xperia M2] pradhana:
Well, my phone suddenly lag a lot.

Still can't find what causing lag, but later will try to do fresh install
[Sony Xperia M2] Andrej732:
I haven't root my phone yet. I don't what might cause that lag, maybe it is zRam?
[Sony Xperia M2] Miche1asso:
Well, technically it is a possibility. With the iowait going up to 50% and i've seen it even above it you get half of the CPU wasted doing nothing.
[Sony Xperia M2] semil:
I think that the problem with zram is, that in the sysctl/ Vm the swappiness is set to 100 by default. I set mine to 45 and the iowait got better. Can someone with root try this to confirm?

Here is my iostat: https://drive.google.com/file/d/0B-Xa-_p162OIZEdDRVpnQkEwWlU/view?usp=docslist_api
[Sony Xperia M2] linuxct:
Ooh, that'd interesting too. What file did you modify?
[Sony Xperia M2] semil:
I used device tuner, it has a builtin option to tweak the sysctl/vm setup.:)
[Sony Xperia M2] Andrej732:
Or maybe this cause the lag?
[Sony Xperia M2] linuxct:
Okay, thanks :D

I'll try tomorrow all day with 50% and give my impressions. Let's see how it goes.
[Sony Xperia M2] harold3211:
There is no 00stop_ric script in my phone. My phone is rooted and i tried downloading the zip file attached in page 3 and tried to copy it to the path but im having error saying permission denied.
[Sony Xperia M2] harold3211:
And also how to install the busybox? i can't find the busybox installer with the said path though i have the busybox on sytem/xbin path.

Another question? How to execute the command? is it via cmd? i tried copying and pasting it but it said " swapoff is not recgnized as an external blah blah blah. please help.

Update: it seems that es file explorer didn't worked as it should instead i used mixplorer and i am able to execute the command plus added the command on th 00stop_ric. It worked for me and my phone is now running with only one core with 787mhz in standby. Big thanks!
[Sony Xperia M2] Miche1asso:
Personally I tried to modify all possible vm parameters. I didn't see a single change. Then it may also depend on the number of downloaded apps installed (I have about 140-150 of them, themes not showing in the Home browsers included). I've set swappiness even to zero. But your results are cool.

One thing, though. It shouldn't really affect the performances a lot. I've seen that when some CPU intensive tasks are running iowait goes down. But it should suck some battery. I usually have at least two cores active at 1190Mhz. Thanks God the Stamina mode is great in Lollipop.

Then it also happened that when iowait is down to zero kswapd0 CPU usage is 30-40%. Sometime together with its brother ksmd. Both deal with virtual memory pages.
[Sony Xperia M2] linuxct:
So after a full day with swappiness at 60%, I must say I'm very impressed. The IO waits reduced a bunch, and stayed in between of 5 to 10%. Also, I can use the multitasking as good as before, with 100%...

I think disabling zRAM is not the solution since every single app will reload if you open another after them. And having the zRAM helped me having a chrome session, spotify, my SW2 controller apps and Whatsapp opened. It's a handy feature but badly implemented by Sony.

Also, no need to use any app or whatsoever, you can add the following commands at the end of the 00stop_ric:

sysctl -w vm.swappiness=60
echo '1' > /sys/block/zram0/reset

I was very impressed with it :D
[Sony Xperia M2] Miche1asso:
bash-4.1# echo '1' > /sys/block/zram0/reset
bash: echo: write error: Device or resource busy

The reset can be used after disabling the zram, though. That allows to redefine its space. For example like in this:

bash-4.1# swapoff /dev/block/zram0
bash-4.1# echo '1' > /sys/block/zram0/reset
bash-4.1# echo 350M > /sys/block/zram0/disksize
bash-4.1# cat /sys/block/zram0/disksize
367001600
bash-4.1# mkswap /dev/block/zram0
Setting up swapspace version 1, size = 366997504 bytes
UUID=6f104b70-58f7-410c-8da2-a7c08d17f6d5
bash-4.1# swapon /dev/block/zram0

"bash-4.1#" is obviously my shell prompt. Still, no luck on my side. iowait stuck at 45-49% unless there is noticeable CPU activity (in which case it goes down). And I noticed it as soon as I flashed Lollipop, vanilla with the data wiped. I wouldn't blame just Sony for this, though. This is a Linux thing. Looking in Google kswapd/iowait issues drove more than few Linux users mad. I've never seen any crap like that in OS X/AIX/Solaris/HP-UX just name them.
[Sony Xperia M2] semil:
I actually played around with the interactive cpu governor settings too. Kitkat was using ondemand i thinkk. It might be that all those apps wake up the cpu and then the governor keeps it up because interactive is waiting for another activity. You coud try to shorten min_sample_time to 10000..
[Sony Xperia M2] Andrej732:
Changing swappiness value didn't work for me. IO waits is always like from 48% to 50% .. I've tried both values 40 and 60.