yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi 4C] Finners:
Tried using that maddog configuration and a thermal config on CM12.1 yesterday. Was getting great battery drain using the phone but went to bed last night and lost 12% overnight!

Loads of wake locks and looking at stats the highest 2 are

Qpnp_fg_memaccess

Qpnp_fg_update_sram

From my unsuccessful googling the fg seems to mean fuel gauge.

Any ideas what's causing this?
[Xiaomi Mi 4C] leledumbo:
That's what happened when you try to access the CPU while it's being shut by the system.
[Xiaomi Mi 4C] Talha7866:
How was the performance ? I mean to say that how's the scrolling does it lags while scrolling in browser Facebook app Instagram and all?
[Xiaomi Mi 4C] MatschBirne:
Did'nt feel any lag using CM Browser. Not using facebook or instagram so can't say if they're smooth.
[Xiaomi Mi 4C] chickentuna:
I also have that kernel wakelock on xiaomi.eu MIUI dev rom. From what I've googled so far, it seems like it's some sort of driver for the battery gauge(?). Were you able to figure out what's causing the wakelocks?
[Xiaomi Mi 4C] Finners:
Not really narrowed it down yet, it's reduced a lot by removing the battery icon from the status bar. Need to test more to figure out if that's just coincidental or not.
[Xiaomi Mi 4C] tuanhung303:
glad that you like maddog configuration :D

the battery drain is something that we need to observe very closely but sure it was not caused by maddog script. Which type of data activities you were using? Since there are still many issues about Connectivity exist in CM, I suggest you turn off Wifi scanning and Network Notification in wifi section.

also, your battery is not proper calibrated, maybe you should try battery calibration app on playstore ;)
[Xiaomi Mi 4C] Finners:
like you say I'm just going to have to keep an eye on it for a while and try to monitor usage, I'm on Wi-fi pretty much all day. Home/work I have wifi at both just have poor phone reception at home which doesn't help battery life.

One thing I have noticed running this maddog config, after a day or so the 2 big cores seem to be listed as stopped in CPU-z. They come back online when gaming/benchmarking but open up CPU-z again when idle and they are both "stopped". I'm not sure whats causing this because a few hours after reboot they are still online just sat at their lowest frequency, Not sure what finally causes them to stop after a day or so.
[Xiaomi Mi 4C] solis_f:
Try L Speed app in Google play! I use it now and very good deep sleeps and battery life
[Xiaomi Mi 4C] tuanhung303:
hmm. I am not sure if you are on the loop. but cowithgun changed his script a little bit since some of values revert back after reboot.

try the below script, rename it to userinit.sh, then place it on data/local/, set permission to rw-r-r and you are good to go. :cowboy:

after every reboot, the script will wait for two minutes then execute automatically.
[Xiaomi Mi 4C] tuanhung303:
I am having massive battery drain (about 3 4% per hours). the main causes should be bluedroid and *alarm*. I am using cm13 with my miband.

in about 6 or 7 hours. you can see the amount of wakelock.
[Xiaomi Mi 4C] cowithgun:
if the 2 big cores behave strangely, it's most likely because of "perfd" process. the process automatically adjust the "/sys/devices/system/cpu/cpu4/core_ctl/min_cpus" automatically, turn the big cores "on" and "off". if my script executed correctly, the "perfd" should already stopped. however, there is a bug in previous script that if used as "/data/local/userinit.sh", the script executed too early. Subsequently, "init.qcom.post_boot.sh" will run and started the "perfd". So, the new script will delay 2 minutes to let the phone boot up properly before tuning the interactive governor and stopping "perfd".

there is no problem if you executed the script manually after phone boot up.

alternatively, you can disable the big cores manually:

echo 0 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus

to renable it back, just use

echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus
[Xiaomi Mi 4C] Suxter:
I'm using stock miui and this script no effect for me. Still getting same SOT 3h
[Xiaomi Mi 4C] j49:
According to cowithgun's message, there's no need for changing permission.

What do you reckon guys ?
[Xiaomi Mi 4C] Talha7866:
Can I use it these commands in terminal emulator?
[Xiaomi Mi 4C] j49:
I put userinit.sh in data/local/ , rebooted the phone and waited more than 2 minutes.

This is what I've got:

C:\Program Files (x86)\Minimal ADB and Fastboot>adb shell cat /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
82 460800:69 600000:80 672000:76 787200:81 864000:81 960000:69 1248000:78 1440000:87

C:\Program Files (x86)\Minimal ADB and Fastboot>adb shell cat /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads
82 480000:68 633600:74 768000:80 864000:81 960000:69 1248000:83 1344000:84 1440000:84 1536000:84 1632000:86 1689600:83 1824000:87

C:\Program Files (x86)\Minimal ADB and Fastboot>adb shell cat /sys/module/cpu_boost/parameters/input_boost_freq
0:0 1:0 2:0 3:0 4:0 5:0

It is not working, is it? :(
[Xiaomi Mi 4C] tuanhung303:
huh? seem like it worked. :rolleyes:
[Xiaomi Mi 4C] j49:
Referring to this and this, shouldn't cat /sys/module/cpu_boost/parameters/input_boost_freq (to say the least) output's look like

0:600000 1:0 2:0 3:0 4:0 5:0

instead of

0:0 1:0 2:0 3:0 4:0 5:0

?
[Xiaomi Mi 4C] cowithgun:
No need but no harm. :D

Yes.

Yes, its working.

He is using the maddog config by [MENTION=5017708]tuanhung303[/MENTION], so that's is correct.
[Xiaomi Mi 4C] j49:
@ cowithgun

Thanks for clearing things up :)
[Xiaomi Mi 4C] muniek66:
Hi Everyone,

If scripts mentioned in this thread works on CM 12.1 ROM?

Thanks for reply.

Best regards,

Pawel
[Xiaomi Mi 4C] tuanhung303:
yes it works :)
[Xiaomi Mi 4C] mac.daferriera:
I have The same on latest xiaomi.eu. Anyone other? Possible cause? Can't believe it's The battery indicator!
[Xiaomi Mi 4C] Finners:
Still havent narrowed down what is causing it, but your right its not the battery indicator after more testing.
[Xiaomi Mi 4C] tuanhung303:
I did not buy the BBS so can't check but I am using Amplify, all I can tell is I am receiving lots of wakelock via *alarm* service :rolleyes:
[Xiaomi Mi 4C] adamuadamu:
guys, I have lots of wakelocks caused by wifi while using latest CM12.1 by TS, as soon as I turn off wifi, "android system" process is not causing more wakelocks neither more packets sent/received - any solution to have offscreen wifi on? does it happen on CM13?
[Xiaomi Mi 4C] tuanhung303:
it does not happen in CM13. I think CM13 is more "stable" than CM12.1

I also found that bluedroid_timer causes lots of wake lock for who use bluetooth or smart wears. Use Amplify to limit them to 240 secs per wakelock may help
[Xiaomi Mi 4C] chickentuna:
Well when I've turned mobile data and wifi off overnight for testing, the wakelock has significantly been reduced. Not totally gone but IIRC, it was down to 5mins instead of the usual 1hr+ for me. Maybe it has something to do with the network? Not really sure as I have zero knowledge when it comes to networks/connectivity
[Xiaomi Mi 4C] legacyofthevoid:
I experience exactly the same issue. Don't know what's causing it though.

qpnp_fg appears to be something related to battery, more specifically Qualcomm's QPNP PMIC Fuel Gauge Device.

I am sure that BBS itself is not the cause of it. I also have significantly reduced wakelocks from qpnp_fg when I enable airplane mode.

Let us put down some info of our phones so that we can see if there is anything common among them.

Mi 4C

OS: TS CM13

System modification: Xposed, Gravity Box, cowithgun's script

Battery-related apps: Amplify, Greenify, BBS

Potentially battery-consuming apps: Facebook, Facebook messenger, Whatsapp, Wechat, Instagram
[Xiaomi Mi 4C] tuanhung303:
cannot find that wakelock in my Amplify app :confused:
[Xiaomi Mi 4C] legacyofthevoid:
I don't see them in Amplify either. I guess Amplify is mostly for partial wakelock, not kernal wakelock.

I only see those qpnp_fg wakelocks in BBS. They are also contributing to the "Awake (Screen off)" time shown in BBS.
[Xiaomi Mi 4C] adamuadamu:
actually, I did a clean flash o cm13 hoping for much better battery life, but still getting more or less the same - still android system is reported to send/receive huge amount of packets and after 17h from disconnecting and about 50min SOT I've got 55% battery left, using governor script, greenify donation and amplify donate version to block nearly everything I could; BBS shows:

deep sleep:15h55m

awake(screen off):49m25

screen on 51m40s

which I consider is a disaster; I was getting better battery life with cm12.1

I also think of get rid of google account and gapps to see if it's the culprit - also, whenever I enter my google account settings, some of the options I surely unchecked become active again
[Xiaomi Mi 4C] legacyofthevoid:
I have the same frustration too. But since some people are able to get 6-7hr SOT with the same ROM, I guess the ROM itself may not be the culprit. It just takes a lot of effort to figure out what is wrong.
[Xiaomi Mi 4C] adamuadamu:
I just reflashed cm12.1 (clean install) to check everything again from the scratch, but I start to recall my battery life started to deteriorate more or less at the time I enabled smart lock, so for the time being I decided to keep my device unprotected just to see how much it would influence those unmanageable wakelocks.

I'll observe and let you all know here in the forums if smart lock has any influence on that
[Xiaomi Mi 4C] legacyofthevoid:
I have found out two more things which are NOT the causes of qpnp_fg wakelocks:

1. Internet activity indicator (provided by Gravity Box)

2. Push Notification Fixer
[Xiaomi Mi 4C] adamuadamu:
my little update:

removing smart lock did not help at all, even with clean flash, so restored a previous backup from 21.02 - at first there were saved statistics showing that "android system" kept CPU awake for 0 (null) seconds and after I used it today, the numbers began to grow - for me looked like a new version of Google Drain Services appeared in the meantime and it's causing massive drain (no drain till 21.02, recovered today, gpservices updated themselves -> drain)

as I was in hurry, I decided not to try clean flash again and again - flashed latest CM12.1, some different gapps and recovered my data - that seemed to help a lot, there is some CPU consumption by android system process, but the numbers are kept at reasonable level until now - 5h after disconnecting the phone, 1h30 SOT, 2 or 3 reboots, as I played with some xposed modules and still 71%, mostly on wifi, LTE signal, no BT toys and quite aggressive killing with greenify, amplify and DS Battery Saver to disable unneccessary modules while screen off; I have also revoked permissions to wake and keep awake for gpservices, gp framework and google play - quite a standard set of things advised here in the forums

in the meantime I googled for the cause and seems that mobile radio drain is major standby drainer with LP and MM, on par with GPServices

things seem strange - a clean flash didn't help but halfway dirty flash works. I still think of differences between the apps I used when I had the drain and the ones I use now - for sure, there were: Kernel Audiutor (but nothing set on boot), L Speed Tweak to disable logcat; and no screen lock for now

and - for me none of the scripts tweaking battery worked with userinit - everytime I put it into /data/local/userinit.sh something went wrong- ie. sometimes only small core settings were tweaked, sometimes nothing, isn't the 120s delay too short?
[Xiaomi Mi 4C] Suxter:
Changing network type 3G to 2G, noticed significant battery save for me. If I use 2g more often I can get 4.5/ 5h SOT easily and using 3g get only 3h SOT

That script mentioned in the thread not work for me (stock miui) only way to get 5h SOT is changing network type to 2g
[Xiaomi Mi 4C] samwheat:
Lol 2g ? Better use smoke signals
[Xiaomi Mi 4C] Logic_:
It makes sense when you're at home on wifi though.

For those familiar with tasker, you probably already know this script. For those unfamiliar, this might be one of the reasons to look at tasker:

http://xdaforums.com/u/tasker-tips-tricks/guide-switch-to-2g-connected-to-wifi-t3330876

I'm glad now I bought tasker like 6 years ago and can still get good use out of it :)
[Xiaomi Mi 4C] tuanhung303:
I will use Smart Network, much simplier :D
[Xiaomi Mi 4C] Nielsvdk:
Since I'm running the pac man rom and cowithgun's script automatically at start up I'm getting about 5h SoT easy during a full day use. I finish usually just below 10% bettery live. That's with browsing, social media apps and boom beach every few hours a time.
[Xiaomi Mi 4C] j49:
cm-13.0-20160305, no gapps, adaptive brightness, cowithgun's script, minimal use ...
[Xiaomi Mi 4C] Nielsvdk:
Sorry for the dutch screenshots but here is today, have been installing some stuff as I recently got the phone but not to bad. Will last login longer if I just use it. I didn't have good battery life with CM13...
[Xiaomi Mi 4C] Nielsvdk:
http://imgur.com/a/nh382
[Xiaomi Mi 4C] j49:
Well, I suppose changing your display settings to begin with would lead to better results.
[Xiaomi Mi 4C] Nielsvdk:
This works for me, it takes me till I go to sleep and I can rad the screen :)
[Xiaomi Mi 4C] almmpt:
Strange drain issue

First of all sorry for post images in portuguese.

I have a big issue with my mi4c 3GB 32GB, my battery drains much more in simple 2G/3G/4G phone calls with screen off then in web browsing with the screen on.

See screens attached is incrdible.

I allready flash cyanogenmod 13 and is the same issue, anybody can help me?
[Xiaomi Mi 4C] mendocino_610:
xiaomi.eu latest stable build 7.2.3.0
[Xiaomi Mi 4C] Ümit:
I think it's not a big issue. 2 sim card's, Bluetooth on, data on, 41 min calling... Maybe you use brighter screen?

Okay, it's not so fine but also not so huge issue.
[Xiaomi Mi 4C] Ümit:
With stock settings?
[Xiaomi Mi 4C] mendocino_610:
yes everthings stock. Only delete miui analytics and micloud apks from system folder, because no need.
[Xiaomi Mi 4C] almmpt:
THANKS Ümit for your answer.

But drain 25% with screen on in 1h43m35s and drain 21% in phone calls in 41m34s with screen off is NORMAL?

I don't think so, i have 100% sure that this is not NORMAL.

My screen is allways at 50% in automatic.

In your mi4c this happens?
[Xiaomi Mi 4C] legacyofthevoid:
I moved to sMiUI from CM13 to try to get rid of the qpnp_fg wakelock issue. Unfortunately, the same issue persists. The qpnp_fg wakelocks are keeping my phone awake for almost 2 hours every 24 hours.

For every full charge, I get: 4 hours SOT + 2 hours Awake (Screen Off) + 18 hours Deep Sleep.

The figures are similar on both sMiUI and CM13. I am starting to think that it is some of the apps that cause the kernal wakelocks.
[Xiaomi Mi 4C] tuanhung303:
hmm the first apps I think about is Google play service and framework :D

try the AppOppsXposed, it might help you

http://xdaforums.com/showpost.php?p=62612489&postcount=5
[Xiaomi Mi 4C] Ümit:
I also had the same with miui stable. Now I flashed sMiui. Its very wel (see OP).
[Xiaomi Mi 4C] almmpt:
Can you post here some snapshots of the drain phone calls and drain of SOT please?

If SMUI fix it I flash it right now because i allready flash CM13 and lots of xiaomi.eu and the issue is the same, allways super drain in phone calls in 2G, 3G or 4G.

Thanks in advance.
[Xiaomi Mi 4C] Ümit:
Here
[Xiaomi Mi 4C] almmpt:
You forgot to put the time in minutes that you have spend in phone calls.

Please attach a general battery drain, a phone call and a screen on time please.

Trully THANKS.
[Xiaomi Mi 4C] SkubiDoo:
Could you please switch to English when you make a screen shots?

From Xiaomi Mi4c Prime sent by Tapatalk
[Xiaomi Mi 4C] almmpt:
I put the screen shots in portuguese an he puts in turkish...

Can you put some in english for we understand why mi4c drains the double of battery in phone calls compared with screen on time?

I try CM13 and lots of xiaomi.eu roms and the drain is exactly the same.
[Xiaomi Mi 4C] mendocino_610:
what does mather? english turkish portuguese same screen

## mi4c ~ Tapatalk ##
[Xiaomi Mi 4C] Ümit:
0% called :)

My advice is for u, use your phone 2 days minimal.

What is the minimal usage:

have one sim card

don't use data (2g/3g)

Bluetooth and GPS off

Set the brightness 30%

Don't use double tab to screen on

...

If you get 4h+ SOT, than it's normal. I think so.
[Xiaomi Mi 4C] Logic_:
Hmmm, is it confirmed that double tap to wake is an actual battery drain still?

I've not really noticed anything to suggest that. I've become pretty dependent on it, I'd hate to see it go.
[Xiaomi Mi 4C] kar5ten:
I used trouble tab even on the old version of moto e. That phone doesn't support this feature naturally and the battery drain doesn't change.

So I don't think it is a noticeable drainer.

You shouldn't worry about.

Or just test it. Don't use it for some days and see nothing
[Xiaomi Mi 4C] Logic_:
Yeah I've gone without it before and to me it wasn't a notable difference either. Thanks for confirming.
[Xiaomi Mi 4C] legacyofthevoid:
Some more things that do not help reduce qpnp_fg wakelocks:

1. Disabling wakelocks of Google Play Services and Google Service Framework

2. Using Titanium Backup to freeze Facebook, Instagram and WeChat

3. Changing preferred network mode from LTE to 2G
[Xiaomi Mi 4C] samwheat:
People ... In wich era are you live ???

Come with advices for this times not for year 1900 ... Lol

Phones this days are made for comunicate with people, chat, internet, emails. Etc ... Why not keep the phone closed better .

.. Be more realistic and keep the thread clean . come with tech tips and tricks to reduce consume.. Please think about it before posting
[Xiaomi Mi 4C] Ümit:
You are 100% right, but my advice was to test if everything is OK with the phone of [MENTION=247243]almmpt[/MENTION]. He thinks his phone is not OK.
[Xiaomi Mi 4C] yorikkk:
sMiui 6.3.24 with deleted Xiaomi services...
[Xiaomi Mi 4C] tuanhung303:
wao, that's great. I bet I can achieve nearly of this (5 or 4.5 hours sot) with TS CM13 rom.
[Xiaomi Mi 4C] chasemyass:
Can you plase what exactly miui services have you deleted? Or like a link where we can see what we should delete/keep for not to have like FC everytime we try use phone? :)
[Xiaomi Mi 4C] yorikkk:
install that and post SS of the programs it gives you - https://play.google.com/store/apps/details?id=com.jumobile.manager.systemapp&hl=en
[Xiaomi Mi 4C] Micha21:
Today I finaly finish to install TS CM 13.

For the moment I'm not convinced by the battery life. Tell me what for you ? Sometimes I lose 2% intant, wtf?:eek:

Some crash has arrived for exemple "clock" and "play store" process.
[Xiaomi Mi 4C] johnHooke:
2% drop in battery is a cm bug
[Xiaomi Mi 4C] Micha21:
A way to fix it ?
[Xiaomi Mi 4C] johnHooke:
nop
[Xiaomi Mi 4C] bankov:
I got the 2 % bug also on every MM rom. If i flash sMIUI is ot going to have the same bug ? Or should i revert to stock rom?
[Xiaomi Mi 4C] Ümit:
What is 2% bug?
[Xiaomi Mi 4C] legacyofthevoid:
The battery percentage drops by 2% (sometime 3%) each time, as opposed to 1% by 1%.
[Xiaomi Mi 4C] Talha7866:
Flash latest build 7.3 stable or dev 6.5.15 I'm not having this bug now
[Xiaomi Mi 4C] johnHooke:
All cm roms have the 2% battery bug. This is only an updating stat issue ...the battery life is as it should... it doesn't bother me as i prefer cm to miui
[Xiaomi Mi 4C] pavlos77:
I think that my mi4c drains a lot of battery when it's idle.15-17 % at a night.Is this normal?I use greenify and titanium backup to freeze system apps.I have stock MIUI 7.0.4.0 stable and i have disabled the most options that drains battery.
[Xiaomi Mi 4C] nosteres:
I had the same problem. So i install TeamSuperluminal cm13 rom. It is a little better but for me its still disappointing :(
[Xiaomi Mi 4C] panhansx:
I only get 2-3h SOT, too.

I just use G+ and some messaging apps mostly over data connection. I installed greenify with root to freeze most of non used services, but it's not really satisfying...
[Xiaomi Mi 4C] Ümit:
For me max 5% at a night and 4h+ SOT. I'm on sMiui currently.

I recommend to you don't use 3e part app to get more battery.
[Xiaomi Mi 4C] martinrais:
I get no less than 4hs SOT, up to 6hs depending on the use. Always WI-FI+Bluetooth+LTE on+Location on. I even have the crappiest most battery consuming app in the market: Facebook.

Stuff to install/use:

1) TS CM13. The ONLY possitive thing about MIUI is camera. If you can live with a slightly worse camera (still not bad), then TS CM13 is your choice.

2) XPOSED (because of the apps of 3).

3) Greenify Root + Amplify (default settings, just for Location services) + Power Nap (excluding both Greenify and Amplify).
[Xiaomi Mi 4C] Karly Johnston:
I am always on 3G at 80% brightness. 6hrs SoT over 24hrs and 4.5-5hrs over 48hrs.
[Xiaomi Mi 4C] philipnzw:
Just got my mi4c a couple days ago,

Glad to know I'm not the only one with weak battery life.

Battery life was quite bad on miui and also other custom roms. Around 3-4 hours SOT with minimal usage , and mostly on powersaver mode(mostly web browsing with wifi,3g and LTE ).

Currently running TScm13.1 160523, battery life is about the same as miui , however doze mode helps ALOT when I'm not using the phone.

Anyway, how do I properly install the initd scripts so that they don't go away after reboot?

My apologies for asking a noob question, just getting into the custom ROM scene and don't dare to do anything crazy~ ;)

Edit: got the script working ;) have 5hours sot with 24 charge left
[Xiaomi Mi 4C] patt_co:
I also find that the life of the battery is poor

Envoyé de mon Mi-4c en utilisant Tapatalk
[Xiaomi Mi 4C] Ümit:
Witch ROM do you use?
[Xiaomi Mi 4C] philipnzw:
Seems like it worked
[Xiaomi Mi 4C] panhansx:
What is "it"? ;)
[Xiaomi Mi 4C] alexvv:
I'm on Smiui 6.4.14 developer, i usually charge my phone from 20% to 90% and between these two rates I get around 3 hours (sometimes less) SOT. I don't have any suspicious wakelocks, with google play services being the worst at times, I'm on interactive governor and have greenified everything and restricted many apps in the miui battery saver setting and the usage is mixed, browsing usually on wifi, sometimes 4g (i switch to 2g when i don't need it), facebook (not with the official app), mail, instagram, viber etc a couple of short phone calls and half an hour of gaming. I also restart it every 2-3 days and I lose around 5% overnight (not really fine). Not a bad battery life but certainly not good, especially when you think than 3000mah drive a 5" full-hd smartphone with a relatively not power hugry processor.
[Xiaomi Mi 4C] Danny94:
Yeah same for me. My old THL 5000 keeps more then a week. With this phone not more then 1 - max 2 days. Even if i don´t use it (SOT ~1 hour for call or something like that). I noticed some fcs and while playing it got really hot no matter wich game. With NFS No Limits i got some "slow mo" freezes, fps drop after 10-20 mins. Onliest solution is to cool it down.

Im on smiui 7.2. Miui 8 could have a better battery performance.
[T-Mobile LG V10 Q&A, Help & Troubleshooting] AKNOTTS66:
Amazing job on th cm12.1! I hope my question isnt too dumb or if its been answered I apologize but will we ever see the stock lg camera app work on this? Sorry if this is known I'm new to the lgv10. My last phone was a galaxy s4(my first smartphone) on verizon and we never had an unlocked bootloader just Safestrap instead of TWRP.
[T-Mobile LG V10 Q&A, Help & Troubleshooting] TonyStark R.I.P.:
Your question is better aske here in Q&A rather then in the development thread.
[T-Mobile LG V10 Q&A, Help & Troubleshooting] AKNOTTS66:
thanks! sorry!
[T-Mobile LG V10 Q&A, Help & Troubleshooting] genesixxbf3:
we can't cause it requiere lg framework but [MENTION=3208754]codeworkx[/MENTION] adapted the CAF camera for the g4 and we will use it for cm13 asap as it is stable :D