yashsingh1/xdaforums huggingface dataset:
[Sony Xperia M2] SpectreXM8:
Yup, same results here.

First i used the phone without any tweak, in 24Hours i went from 100% to 40% with 4.5 Hours On Screen Time. Woke up this morning and started playing around.

Swappiness set to 60% and for the last hours IO waits have been between 5-15%, and it seems to drain battery around the same pace it did on KK. With Zram disabled, multitasking is at the same level as KK, a couple of heavy RAM apps and the last 4th or 3rd starts refreshing when switching to it.

Out of curiosity, did you also disable the low_ram config in the build prop? I think they are related as far as i recall from the Android Dev Documentation. Did you try leaving the stock build.prop but swapiness to say 60% ?

As far as it being a Linux thing and not a Sony issue, some phones have had it on since KitKat ( CM even has a setting for it if i remember correctly) so somebody made it work properly apparently.
[Sony Xperia M2] linuxct:
In case it's useful, I have stock build.prop too :)
[Sony Xperia M2] Miche1asso:
No, the CPU governors have little to do with this. Apart from io_is_busy=1 on the ondemand governor (which is the one used by both 4.4.4 and 5.1.1). Setting it to 0 reduces the high frequency, but at cost of potential lagging when the I/O is real (the CPU frequency/number of cores stay low).

Still.. Good news! It seems I've fixed it!! :D

At least now it does work fine on my phone. Look:

bash-4.1# cat /proc/swaps; vmstat -d 2 -n 5
Filename	Type	Size	Used	Priority
/dev/block/zram0 partition	458748	166212	-1
/sd-ext/swapfile.0 file	1048572	0	-2
procs memory system cpu
r b free mapped anon slab in cs flt us ni sy id wa ir
1 0 136488 105496 351244 47100 678 1803 0 3 0 5 99 1 0
0 0 136132 105496 351696 47100 702 1786 49 6 0 4 99 0 0
0 0 136092 105500 351744 47100 1040 2189 0 5 2 12 99 1 0
1 0 135908 105508 351944 47100 629 1730 8 5 1 6 99 0 0
3 0 135864 105508 351980 47100 606 1672 0 2 0 6 99 0 0

The "wa" column is the iowait, while "id" is the idle time. Never seen a zero with the zram/swap enabled!! And now I tested it with both. :cool:

How did I do it? I added the following two commands in our /etc/init.d script (the same you use to set the swappiness, whichever it is):

echo 1 > /proc/sys/vm/laptop_mode
sync; echo 3 > /proc/sys/vm/drop_caches

and rebooted. It takes few minutes after boot, but eventually the I/O wait goes down to zero and there it stays unless it is really doing something. I tested it 5 or 6 times, the I/O wait always dropped.

Oh, that swap file is one I made for testing. If you're interested I can show you how to enable it. ;)

PS: default (stock) build.prop file. I've seen the question only now.

PPS: Yes, it is much more reasonable now! See attachment. Previously I had the 1190MHz frequency at 98-99%.
[Sony Xperia M2] Andrej732:
Do we still need the line for setting swappiness value?
[Sony Xperia M2] aidy.lucas:
I've not used it don't need it, mine seems to have settled down nicely.

D2303 5.1 lollipop customised NCB rooted de-bloated LB t2u nut dual recovery bravia engine 2+x-reality+supervivid
[Sony Xperia M2] Miche1asso:
Just put it in there, it doesn't hurt. Actually I've got the feeling that it isn't really a matter of the particular values, it's more that when updating them the kernel somehow moves out of the iowait stasis condition (each time a parameter gets changed the kernel gets notified and executes the relative subroutine. That may shake things around).

Yes, have the swappiness set before the drop_caches. Since it isn't immediate (it takes about 10 minutes after boot) it's a nightmare to test. But it has been 100% consistent. And it lasts. Without touching the swappiness and/or setting it back to 100 the I/O wait was still there.

Well, lucky you. :D
[Sony Xperia M2] Andrej732:
It's working fine!

Okey, now it's working as it should be. IO waits is now always like 0.1% to 0.5%. Thank you so much. :)
[Sony Xperia M2] Miche1asso:
I told ya! :D

BTW did you check how long it takes to go back to normal values? With how many apps installed?
[Sony Xperia M2] Andrej732:
Nah, I haven't installed any apps, only 3-4 apps and it takes 2-5 minutes to back to normal values.

---------- Post added at 02:03 PM ---------- Previous post was at 01:37 PM ----------

But I've also noticed that Core0 and Core1 were working all the time. Now Core1 is active only when it needs it which gives a battery improvement. Yes, I've noticed a lot of battery improvement this hour. I've been surfing on wifi for a 25min and battery goes down for only 2% from 68% to 66%. Nicely done, Miche1asso really good job.
[Sony Xperia M2] Miche1asso:
Yes, the two cores are due to the fact that the CPU load counting the I/O Wait is (was) always at at least 50%. That seems to be enough to make mpdecision enabling two cores at 787MHz. Then just some little CPU activity and the frequency jumps to 1190MHz and/or enables the two extra cores. A total waste of CPU time and battery (not to mention of my time) doing nothing.
[Sony Xperia M2] semil:
I would like to see that swap file instructions :)
[Sony Xperia M2] Miche1asso:
Unfortunately I couldn't make the swap file on the vfat partition of the external SD card. I am using a partitioned SD card, with a second primary ext4 partition (Link2SD ready if that helps). On ext4 format it works, on vfat "mkswap" gets a SE Linux error. I don't know if it is the busybox (I've seen that there are some busybox patches for it) but even so to find the right binary is a mess. Anyway, supposing it works the process is easy. Always as root do

dd if=/dev/zero of=/sdcard1/swapfile.0 bs=1 count=1 seek=1073741823
mkswap /sdcard1/swapfile.0

That creates the swap file (one can use any name). "1073741823" is the size (1GB)-1, again one can chose any size multiple of 1024 (not too small, though. Let's say at least 100MB). Then just add in a /etc/init.d script

swapon /sdcard1/swapfile.0

Still it was just for testing. As expected it may lag quite heavily. Probably it is a matter of tuning the "minfree" parameter, but as soon as I changed that I've got into other weird results (like it was changing by itself to very low values long after boot). Total lag.

There was indeed a "minfree bug" in Lollipop 5.0/CM12 for Moto G. As long as we don't touch it at boot in 5.1.1 for M2 the values seem fine (quite high, though. That's how we see 300MB of "free" RAM). But I don't dare to modify it. I did it on my previous GB phone and with wrong values Whatsapp was notifying the messages after hours. I'll never understand in full how to tune that minfree thing, I hate it. It seems to me a matter of trial and error.
[Sony Xperia M2] ~Patryk:
I turned off Wi-fi and uncheck "scanning always available" but Wi-fi is still working. How fix that ?
[Sony Xperia M2] Miche1asso:
I have got it all wrong. The captive_portal_detection_enabled isn't about the weak signals, but about the.. Captive Networks indeed. The Captive Networks are the "free" hot spots that after connecting require an authentication via Web. Also called (I think) Fon Free Networks. Vodafone supports them for example and I have one indeed near my home. One should just need to disable the check for open/public networks and the WiFi should stop breaking up. I am testing it, it seems to work now (after enabling the captive networks back).

I updated the guide accordingly, along with adding the hint about multi user and improving other little things.
[Sony Xperia M2] psichokillah:
Quick question: Is it possible to completely disable any icons on the lockscreen including the clock? :confused:
[Sony Xperia M2] ~Patryk:
Is it normal over 1GB in background ? :eek:
[Sony Xperia M2] Matze6989:
No i have this.
[Sony Xperia M2] Th3 Ant:
Do you have an option for notifying immediately for every mail active? It could be checking if there are any new mails after every X mins. Or it could download pictures in mails to make it load faster. Try using Inbox or just restrict background data for Gmail.
[Sony Xperia M2] ~Patryk:
I set:

-Images: ask before showing,

-Sync frequency: Every 15 minutes.

I uncheck "auto download attachment to recent messages via WiFi".

Should I something change ?
[Sony Xperia M2] Th3 Ant:
Check if something changes. If not, try using another email app. If another app will show other stats than Gmail, that means the problem is within Gmail app and not in the phone itself.
[Sony Xperia M2] SpectreXM8:
Where do you have the sync frequency settings? GMail by default uses IMAP push to send you your mail, and that`s the way it should be. Or are you using an Yahoo/ Outlook account in the GMail app.
[Sony Xperia M2] ~Patryk:
Gmail->Settings->"My account"->Sync frequency ;)
[Sony Xperia M2] SpectreXM8:
Is this for an Gmail account, or for an Yahoo/Outlook/Exchange one? Because for Gmail accounts, there is no sync frequency, because, as i said, GMail uses IMAP PUSH to deliver new messages. That means the Google IMAP server sends you the notification that a new email has arrived, the Gmail app itself never queries the server at specific intervals . Lower data usage and battery drain.

But for Yahoo/Outlook/Exchange, maybe push isn`t implemented, can`t remember . See if there is a "immediately" option in that setting, instead of "10-15-30 minutes" etc. That should be the PUSH option.

EDIT : No , apparently , the Gmail app only supports sync at X time for Yahoo , it does not support IMAP IDLE (not PUSH, don`t know why i keep calling it that way but it`s incorrect). So try to set it to an interval of 1 hour and see if it`s the culprit for the high background data usage. Also, try the Yahoo Email app on the PlayStore, that supports push notifications for Yahoo mail.
[Sony Xperia M2] Miche1asso:
Added tip to fix the GPS.
[Sony Xperia M2] linuxct:
I don't see necessary to touch the NTP server. Europe is fine, but still a good tip. Thanks!
[Sony Xperia M2] ~Patryk:
I have one Gmail account and three IMAP accounts. There isn't "immediately" option.
[Sony Xperia M2] Miche1asso:
Well, the latency is quite different. Although I am not sure what it is used for (I mean, why does it need to synch the time and how often).

Anyway, did anyone test it? Because it was working fine but then I checked it again hours later and it started to reset after few seconds again. Although I must say that to test the GPS from inside while it is raining probably isn't the best idea. :)

Now it's working again. Mah.
[Sony Xperia M2] linuxct:
NTP is the Time Synchronization service. It's a standard, main OSes use it (Windows, Mac). In your Mac for example it uses the Euro Apple server, which is time.euro.apple.com, and in Windows I use the time.windows.com server. I think it'd be funny having the Apple or the Windows NTP server in our M2 hah :D

It's used to sync the time and date when battery is unplugged. In our case it's not useful at all... But in my old Xperia Tipo, I used it a lot.
[Sony Xperia M2] Miche1asso:
I know what NTP is, thank you. :p I just wonder why the GPS needs it. Are you sure it's used only when unplugging the phone? then what used it? The GPS or the phone itself?

Anyway that tip is crap. Now it is working with the stock gps.conf file. Unless it is the app itself to check the GPS to mess things up. But it was just fine in KK.
[Sony Xperia M2] Matze6989:
Have anyone a download link from this kernel? I think this is the best solution to save energy.

http://4pda.ru/forum/index.php?showtopic=577504&st=4080#entry43462471
[Sony Xperia M2] Yperion:
I did the battery tricks from this post and my battery is better than with KK. 37% after 8hours of screen time w/ wifi and 3g.

Has anyone try to install xposed? I really need it..
[Sony Xperia M2] aidy.lucas:
Get the feeling xposed will never work on 5.1, deodexing via joeldroid doesn't seem to be working either not having any joy with either to be honest

D2303 5.1lollipop customised NCB rooted LB t2u nut dual recovery bravia engine+x-reality debloated
[Sony Xperia M2] linuxct:
I'm trying with SVADeodexerForArt, I will post a link to a flashable ZIP with everything properly deodexed.

Probabilty Xposed works: High, since there's no Service.dex in there.

I'll be back.

Didn't worked. It boolooped the exact same way when I flash Xposed ZIP. GG.
[Sony Xperia M2] krule031:
What firmware are you using atm? :good:
[Sony Xperia M2] Yperion:
Customized GR 1281-1556 18.6.Α.0.175 R2C

Rooted, de-bloated w/ this at init.d:

sysctl -w vm.swappiness=40

echo 1 > /sys/block/zram0/reset

echo 1 /proc/sys/vm/laptop_mode

sync; echo 3 > /proc/sys/vm/drop_caches
[Sony Xperia M2] roxetak:
why I must repaire a mistake of another developer? Why? I must made a work of sony developers? When they made a **** firmware?
[Sony Xperia M2] mantazzo:
umm, not sure if I'll be helpful or not, but that services.odex should be in system/framework, right? I can only find services.jar in my phone.

uhh nevermind, the odex is in system/framework/arm folder. I guess I'll just try deodexing thorugh Lucky Patcher?..

Never mind, I'm just being dumb.
[Sony Xperia M2] gabivarzan:
After adding the lines above in /etc/init.d/00stop_ric did you notice a significant improvement of battery life?
[Sony Xperia M2] linuxct:
No, that's not safe (IMO), and will probably give you a bootloop as a result. Be careful if you try it :p
[Sony Xperia M2] mantazzo:
Tried that, nothing happened (huzzah). Also, it only said system/app and priv-app... I'm sooooo dumb. (facepalm)

EDIT: Nah, I'm done. Master of dumb.

EDIT 2: This will sound REALLY dumb but can't we just use another device's services.odex file? For example Z1...
[Sony Xperia M2] aidy.lucas:
I think we're screwed with this services.odex file with the invalid embedded .dex. Xposed dev can't fix it so unless Sony do(highly unlikely) t2u has the same problem so that device is out

D2303 5.1lollipop customised NCB rooted LB t2u nut dual recovery bravia engine+x-reality debloated
[Sony Xperia M2] CZNexus:
any solutions for battery drain on non rooted user?
[Sony Xperia M2] krule031:
I just wanna say that I had huge battery drain while on T-Mobile HR Croatia firmware, I came from school and I would have like less than 50% of battery.

Then I flashed CE1 firmware and I must say there is not battery drain at all, battery lasts just like on KK, maybe even more.

So I guess there is some difference between some firmwares.
[Sony Xperia M2] semil:
I use these tweaks and a tweaked kernel and ondemand, i must confirm a better battery life then on kk.
[Sony Xperia M2] Yperion:
Yeap, more than 40%
[Sony Xperia M2] Matze6989:
What for a tweaked kernel?
[Sony Xperia M2] semil:
Sadly not a custom kernel.. :-/ I only added a few more lines to the stop ric for battery saving. https://drive.google.com/file/d/0B-Xa-_p162OIZzBqTkFaSE03a0U/view?usp=docslist_api..
[Sony Xperia M2] Matze6989:
That's really good.

Through your ric are my battery levels become really good

Thank you.
[Sony Xperia M2] LilBlinx:
Have you checked the script if it's working properly? Because here it's just useless lines
[Sony Xperia M2] semil:
Works on my phone.
[Sony Xperia M2] Matze6989:
The Script works fine for me.
[Sony Xperia M2] Mikxx:
is there any way to get the user picture in the statusbar i love that on lollipop and the signal icon takes space of 2 icons any way to fix that?
[Sony Xperia M2] Matze6989:
I have a good kernel found. You can to download here. The description and the download can be found at the link.

The kernel resolves the zram, GPS and battery problem at once.

http://4pda.ru/forum/index.php?showtopic=577504&st=4220#entry43743970
[Sony Xperia M2] gabivarzan:
Did you try it? Or anyone else?

Is it working ok?

Any feedback would be appreciated
[Sony Xperia M2] Matze6989:
I have it installed yesterday. There running perfectly.
[Sony Xperia M2] dawpuc:
Could you upload it?

Wysłane z mojego D2303 przy użyciu Tapatalka
[Sony Xperia M2] Matze6989:
You find the download link in the 4pda thread. I have post the link.
[Sony Xperia M2] xazakasrizava:
[MENTION=4590098]Miche1asso[/MENTION], great thread. I appreciate you taking the time to write this guide, it was very helpful!
[Sony Xperia M2] Matze6989:
So after I have the kernel a day on it, I must say it is much more economical and the GPS running perfectly. I think with the OnDemand runs even smoother than the stock kernel. There are also 2 apps with installed where you can sound kernel and make settings.So you can again adjust the volume, the time has come again as KitKat

I highly recommend him.And you have to order again the ultra stamina mode
[Sony Xperia M2] Miche1asso:
I made a mess with the file permissions (bloody new "umask 0077" in Lollipop). The gps does seem to work changing the /etc/gps.conf file with the one from KK 4.4.4. I updated the guide accordingly,
[Sony Xperia M2] krule031:
Guys one question.

Sometimes when I enable stamina mode, when waking up the phone I get that exclamation mark on the wifi signal, and I have no internet until i re enable the wifi.

So, should I disable that captive networks thing from the guide or it wont help? :confused:
[Sony Xperia M2] gabivarzan:
I flashed the kernel, but the phone won't boot.

Had to flash the original kernel with flashtools.

Is it possible that I'm not able to flash the custom kernel because I have locked bootloader?
[Sony Xperia M2] Matze6989:
I don't now. My bootloader is open. Have you are root?
[Sony Xperia M2] gabivarzan:
Yes, I'm rooted.

But I think I red somewhere that you can't flash custom roms and custom kernels on locked bootloaders.

I gave it a try anyway... Unfortunately, it doesn't work, as I said before, the phone doesn't start, and I had to flash the original kernel.

After flashing the original kernel, my phone started, but the WI-FI is won't start. Lucky me I had a backup of my rom...

So, I'm pretty sure now that the locked bootloader is why I can't flash custom kernel.
[Sony Xperia M2] Th3 Ant:
Yup, locked bootloader is the problem. You need to unlock it to make any custom kernel or rom work. Unless rom is made for locked bootloader. But if you did not touch bootloader, it is better to stick with stock :)

Wysłano z D2303 za pomocą Tapatalk
[Sony Xperia M2] aidy.lucas:
That was the Xperia sp you could do that with if I remember right, there were custom roms you could use with locked bootloader devices not seen it since though on Xperia devices

D2303 5.1 customised NCB LB t2u nut dual recovery rooted de-bloated bravia engine 2+x-reality
[Sony Xperia M2] Miche1asso:
Yes, if you get the exclamation mark that usually fixes it. You don't need root either. And it stays after reboot. Just remember to reapply it if you wipe the data/reset the phone. I have it enabled myself.
[Sony Xperia M2] krule031:
Thanks mate. Will do it asap.

Great thread btw?
[Sony Xperia M2] Miche1asso:
Added tip about trimming the NAND partitions.
[Sony Xperia M2] pradhana:
[MENTION=4590098]Miche1asso[/MENTION]

How did you trim your ext4 partition in the SDcard?
[Sony Xperia M2] Miche1asso:
My second ext4 partition in the SD card is mounted in /sd-ext. So I just executed

busybox fstrim /sd-ext

If you're using Link2SD I think it's mounted in /data/sdext2 So you execute

busybox fstrim /data/sdext2
[Sony Xperia M2] Mikxx:
hey anyone knows something about xposed framework for 5.1.1 and a fix for the signal gap ?
[Sony Xperia M2] krule031:
[MENTION=5545281]Mikxx[/MENTION]

About Xposed, it is not working because of some services.odex I think, the system bootlops continously after installing it.

So the system needs to be deodexed for Xposed to work, but atm there is no deodexing tools working on M2, yet.
[Sony Xperia M2] aidy.lucas:
The only thing I'm really missing now xposed, not holding my breath for a fix anytime soon.

D2303 5.1 customised NCB LB t2u nut dual recovery rooted de-bloated bravia engine 2+x-reality
[Sony Xperia M2] Mikxx:
okay and is there any way to enable the user icon on the lockscreen
[Sony Xperia M2] mantazzo:
You know, it's just a thought, but could it be that the needed services.odex file might be "odexed" differently than usual? So that way we get the corrupted message...
[Sony Xperia M2] gabivarzan:
So after 2 weeks with 5.1.1. here are my conclusions, comparing to 4.4.4:

- the battery life has decreased with at least 30%;

- the GPS is not working properly;

- some minor problems with the wifi;

- there is no way to install xposed framework;

- camera quality is very poor (somewhere next to a vga camera);

I know that for the first 3 there are fixes and workarounds, but still... I think Sony should've taken more seriously this major update. I also think that they should've released a fix for all the problems by now.

Anyway, for me, these issues made me go back to KK, despite the fact that I waited so much for the Lollipop update.

Hopefully, our xperia M2 will get a fix very soon.
[Sony Xperia M2] Pedja96CG:
Camera quality

Hi guys, i have a fix for camera quality. It's just for temporaly use until sony release the update with the fixes. Download Camera Fv-5(I downloaded full version on apptoide) and in setrings you have to control sharpness, i set it to 0 and now the pictures that i take with this camera are the same quality as it was on kitkat, I have comprared few identical pictures on my phone that i shoted on kitkat and lollipop, there is no difference, and also you can comprare the pictures that you take with stock camera and camera fv-5 with 0 sharpness in settings, and see the difference. I am glad if I helped someone :) sorry for bad english...
[Sony Xperia M2] krule031:
Does anyone know why my battery doesnt charge to 100%?

Actually it shows 100% but when I unplug it it imediatly falls to like 98%

I read somewhere that this is for security reasons, but anyway this bugs me sometimes.
[Sony Xperia M2] molnartibor:
same here, mine goes immediately to 97%. not related to lollipop, i had the same since i bought the phone with jelly bean
[Sony Xperia M2] aidy.lucas:
Leave it charging for another 15mins after it reaches 100%

D2303 5.1 customised NCB LB t2u nut dual recovery rooted de-bloated bravia engine 2+x-reality
[Sony Xperia M2] krule031:
It charges overnight, from like 00:00 to 6:00.

I think it should charge very well for that time.
[Sony Xperia M2] aidy.lucas:
That was the way round it on kk, I charge mine similar sort of time every night and it's usually on a 100% in the morning

D2303 5.1 customised NCB LB t2u nut dual recovery rooted de-bloated bravia engine 2+x-reality
[Sony Xperia M2] krule031:
Well it charges to 100% for me too, but when I wake up I unplug it, go to bathroom, and when I come back it is like 98%.
[Sony Xperia M2] Miche1asso:
That's because after reaching 100% it stops charging the battery. So basically after being fully charged it's running on the battery and not on the charger and it keeps showing 100%. Once you disconnect the visible battery monitor starts again and it drops fast to the real value. So at least it was on kernel 2.6.x.

I know, it sounds dumb, but maybe it's right because some people would worry because their phone still being "charging" (it isn't) is draining the battery. Oh, and the phone can't keep charging the battery after 100%, I think it could explode or something that nasty anyway.
[Sony Xperia M2] krule031:
And that is really great explained.

Thanks for the info?
[Sony Xperia M2] Mr.Sqbika:
I'm having a problem with the WiFi thingy. It's getting constantly knocked off the network, resulting in loosing the Internet connetion, while the phone is still connected to the WiFi....

I tried the WiFi solution that in this thread, but I'm getting a security error: http://i.imgur.com/UCmRiwU.png
[Sony Xperia M2] krule031:
It didnt work for me too using Terminal Emulator, so just go to your pc and do that on it.

Worked like a charm for me.
[Sony Xperia M2] Mr.Sqbika:
Thanks for the advice :D I'll try it when I'll be back home.
[Sony Xperia M2] krule031:
Just execute the same command from here in adb and everything will work fine. ?
[Sony Xperia M2] Dzepar:
You need to type

su - grant permission

Enter -

"settings get global captive_portal_detection_enabled" - or enable disable line.

You won't have that java error. ;)

Sent from my D2303