Miscellaneous battery drain

Search This thread

Enri1196

Senior Member
Apr 18, 2013
94
19
Just upgraded my Nexus 5 to CM12, now i'm getting huge battery drain by a process called "Miscellaneous" and it's becoming very annoying... What is this process?? What information do we have here on XDA??? Anyone else is having this issue????
 

MrObvious

Senior Member
Mar 1, 2008
2,292
330
Wichita KS
Just upgraded my Nexus 5 to CM12, now i'm getting huge battery drain by a process called "Miscellaneous" and it's becoming very annoying... What is this process?? What information do we have here on XDA??? Anyone else is having this issue????

Working as intended. There has been much discussion on this but someone correct me if I'm wrong it's Lollipop estimating what your battery usage is going to be for X then it ends up being Y so X+/-Y = Miscellaneous..
 

danarama

Senior Member
Aug 22, 2010
31,283
18,814
Oxenhope, West Yorkshire, UK
There is no "Misc bug" or "WiFi Bug" related to misc

Its really simple and basic and is in no way "drain".* All your battery stats are guessed calculations. They're never accurate. They never have been and never will be.

Basic version


Here's how battery stats work.*

In android, there is a file. It lists "power consumption" for certain things.*

For example (and these numbers are made up for simplicity)

WiFi disconnected = 4mA
WiFi connected = 10mA

So if your phone has been connected to WiFi for 10 hours, it calculates that 10 hours @ 10mA = x% of battery used.*

However, what if you're in your bedroom for 10 hours? The router is in your living room. Actually your WiFi is using 20mA because of the weal signal. Well, this magic file cannot account for that. There is no "WiFi connected but user is in bedroom = 20mA" entry in the file.*

Battery stats actually have no link to actual battery usage. Its just a guess. Battery stats knows how much battery has been used and using its magic file, makes an educated guess at how much % battery has been used by each thing.*

So your battery has depleted by 50%. 25% is WiFi connected at 10mA. But your WiFi was actually using 20mA because of distance. Battery stats cannot know this. So you actually have 25% missing in battery stats. That's what miscellaneous was created for. To show that there was a difference between battery stats guess and actual battery use from the battery.*

Its the same for screen brightness, cell signal, CPU usage etc. The file knows very little. Battery stats is very inaccurate

Google actually removed miscellaneous from stock ROMs due to people who don't understand, calling it a WiFi bug. However it still exists in aosp.*



Advanced version

How battery stats work

The Battery stats UI shows the percentage of battery that device elements are responsible for using, which is based on a couple of things.

1./data/system/batterystats.bin
2./system/frameworks/frameworks-res.apk/res/xml/power_profile.xml

These things contribute in the following way:

1.From the moment Android detects that a close-to-full charge has completed, batterystats.bin records how long the device elements are running
3.This xml file is where the information about how much power, each device element “uses”

The battery stats UI looks at batterystats.bin to see how long each element has been running (and in what state) since the last charge, applies the value (in mV) for each element stored in power_profiles.xml and comes up with a calculation of the % of battery each element is using.

It simply knows the total mV used by adding up all the element values and the time in state to work out the percentages.

Here is a really basic example…

power_profile.xml from the SNexus 5
Code:
*<item name="none">0</item> <item name="screen.on">82.75</item> <item name="screen.full">201.16</item> <item name="bluetooth.active">51.55</item> <item name="bluetooth.on">0.79</item> <item name="wifi.on">3.5</item> <item name="wifi.active">73.24</item> <item name="wifi.scan">75.48</item> <item name="dsp.audio">0.1</item> <item name="dsp.video">0.1</item> <item name="gps.on">76.23</item> <item name="radio.active">185.19</item> <item name="radio.scanning">99.2</item>

batterystats.bin
Code:
*** screen.on = 2 h
*** bluetooth.active = 3 h
*** bluetooth.on = 7 h
*** wifi.on = 6 h
*** wifi.active = 4 h

So, if….
Code:
*** screen.on = 165.5
*** bluetooth.active = 154.65
*** bluetooth.on = 5.53
*** wifi.on = 21
*** wifi.active = 292.96
*** Total = 639.64

Then…*
Code:
*** screen.on = 26%
*** bluetooth.active = 24%
*** bluetooth.on = 1%
*** wifi.on = 3%
*** wifi.active = 46%
*** Total = 100%


That was a basic example of how the Battery Stats UI makes it’s calculations.* Notice how the total is 100%? Well in KK and earlier this was the case.* The Battery Stats UI calculated to 100%.* So even if you had only used 50% of your battery, it would show that device elements had used 100% of your 50% used battery.

This meant that as it always had to add up to 100%, it didn't have to be particularly accurate.* It takes the values and calculations it knows about and works the portion of that 100% each known value has taken.* It knows that 639.64 is 100% therefore wifi at 292.96 must be 46%....

Since Lollipop, it has changed and makes it more difficult for battery stats UI to be so blase about its accuracy.* Now it attempts to show you what "actual" percentage of battery has been used.* For example, if 50% of your battery has been used, the total of percentage used by device elements will also show as 50%.* However, now that the total % of elements might not match the total % of battery used, it is much harder to hide how inaccurate battery stats actually are.

So to elaborate on that further, lets say that your Nexus 5 battery is 4720 mV in capacity.* The actual battery % in status bar is calculated by reading the actual current battery reading from the battery itself and working out the %, so in the example above, 14% battery has been used (639.64 is 14% of 4720 - or more accurately 13.55%)

So...*

Code:
*** screen.on = 3.6%
*** bluetooth.active = 3.4%
*** bluetooth.on = 0.05%
*** wifi.on = 0.5%
*** wifi.active = 6%
*** Total = 13.55%

Why are they never accurate?

So battery % in status* bar takes a reading from the actual battery, but battery stats just add up what they recorded multiplied by the Power_profile.xml values.

Looking at the power_profile.xml file, you'll see for example, wifi - there is an "on" value and an "active" value.* There are just 2 states.* However, what if your router is in your living room and you are in the bedroom?* WiFi Active may not be 76.23 at all.* Due to weak signal, it may be 150....* But battery stats is not aware that it may be using 150....* So it calculates using 76.23

This is where it gets a little more complicated.* Lets go back to these calculations, but factor in the new 150 value for bedroom wifi active

batterystats.bin
Code:
*** screen.on = 2 h
*** bluetooth.active = 3 h
*** bluetooth.on = 7 h
*** wifi.on = 6 h
*** wifi.active = 2 h
wifi.active.InBedroom = 2 h

So, if….
Code:
*** screen.on = 165.5
*** bluetooth.active = 154.65
*** bluetooth.on = 5.53
*** wifi.on = 21
*** wifi.active = 152.46
wifi.active.InBedroom = 300
*** Total = 799.14

So that is what ACTUALLY happened.* But Battery Stats doesn't know.. because the power_profile.xml does not really have the InBedroom entry at all.* So battery stats shows that a total 639.64 of battery has been used, however the physical battery reports that 799.14 has been used.* So the battery % in the status bar is 100% - 17%, = 83%....* 17% has been used but our earlier stats (that don't show the fake inbedroom value) show the total used is only 13.55% - there is a discrepancy here...

Well, since lollipop, that discrepancy has to be accounted for to make the battery stats appear more accurate, so the 159.50 difference that is unaccounted for (The Wifi InBedroom), now will appear as "Miscellaneous".* This makes battery stats show that 17% total battery has been used, to match the status bar and not 13.55% as per the total added up from Power_profile.xml...*

THis is not just the case with WiFI, but with everything from Screen brightness, to bluetooth to cell reception.

Why does misc show on some roms and not others

You may remember a while back that people were reporting the WiFi bug to google..* Well, simply - they probably got fed up and hid misc in Stock ROMS.* No stock roms on the Nexus 5 show misc anymore.* They just have calculations that no longer add up in total to the amount of % used of your battery

Some people have accused google of "hiding" the bug.* What we're saying is that there is NO BUG and they hid misc, which is what caused people to think there was a bug in the first place.

The Misc battery report is still in AOSP code, however some roms have also decided to hide it, such as SlimRoms for example.

You can see their changes here:

From Google: https://github.com/SlimRoms/packages_apps_Settings/commit/e6793771cedb47aed72f1c64f870b70357746938
Custom ROM feature: https://github.com/SimpleAOSP-Lolli...mmit/d025994f90722139dfcf236f275e05236ec47491

Here is an example on SlimLP with the option turned on and off

14d7395f053db82ae9d08abc11b1dcf7.jpg


dd97f110d80aea2e4c9899f9c78a3e23.jpg


a0771c6db526da148f9c7989ba6613c5.jpg




Summary

There is no such thing as a "misc bug" or "WiFi bug".* Android tries to calculate the amount of battery used by each device element, based on a very finite list of values.* Since the values are pre-determined in a file, it is not an accurate refelection of reality.* When these values in reality are higher than the file, it makes the Battery Stats show a lower % than reality being used by the elements (most easily seen in wifi).* To make the elements total match the actual % used from the battery, Misc was created to fill in that discrepancy - However, since people thought it was a bug due to lack of understanding, it has since been hidden.* But it is not a bug.

 

Enri1196

Senior Member
Apr 18, 2013
94
19
But what do you do to get decent battery life?? maybe my battery is broken??? i don't know what to think
 

opssemnik

Senior Member
Jun 10, 2013
1,558
1,040
Porto Alegre,Rio Grande Do Sul,Brasil
But what do you do to get decent battery life?? maybe my battery is broken??? i don't know what to think
the miscelanius aint the problem, something else is. if you use an app or something to change your build prop and edit the ro.build.type to user (ro.build.type=user) the miscelanius will go away. use some app to indentify if you dont have wakelocks or something like that
 

erik.paliza

Member
Dec 8, 2016
15
1
although long time since anybody have been here, might as well ask right...

I ahve huge problem with my battery life --- I loose about 60% over night with no use.
I bought new battery and tried few different roms and kernels including stock with no luck of improvement.

I have tried to turn the wifi off and battery saver on ... Tried with no apps installed or in safe mode .... still same battery drain ...

Getting kinda desperate here.

Nexus 5 Hammerhead, Euclidean OS, ElemantalX kernel.
6371301335168814850


https://plus.google.com/photos/1097...738&ssid=41667ddc-02c5-4271-a7a3-e9b0fe1dda58

https://plus.google.com/photos/1097...738&ssid=41667ddc-02c5-4271-a7a3-e9b0fe1dda58
 

AlbertoDR

Member
Jul 6, 2014
13
8
although long time since anybody have been here, might as well ask right...

I ahve huge problem with my battery life --- I loose about 60% over night with no use.
I bought new battery and tried few different roms and kernels including stock with no luck of improvement.

I have tried to turn the wifi off and battery saver on ... Tried with no apps installed or in safe mode .... still same battery drain ...

Getting kinda desperate here.

Nexus 5 Hammerhead, Euclidean OS, ElemantalX kernel.
6371301335168814850


https://plus.google.com/photos/1097...738&ssid=41667ddc-02c5-4271-a7a3-e9b0fe1dda58

https://plus.google.com/photos/1097...738&ssid=41667ddc-02c5-4271-a7a3-e9b0fe1dda58


Just try this and let us know :)
https://forum.xda-developers.com/android/general/guide-extreme-battery-life-t3095884
 

erik.paliza

Member
Dec 8, 2016
15
1

I have been led to belive I can not use xposed because I am on android 7.1., at least I have not found proper zip file to flash. So no use for me. But now i have found out it does not have to do anything with my apps.

In safe mode the battery drain is fine ... over night about 5%, wich is fine.

Lastly, i have flashed the latest euclidean os from 10.1.2017 or so ... Kept the phone as it was, no further apps ... still huge battery drain. Instaled betterbatterystats and now I know it is due to wakelocks.

i have been monitoring just a while now but for now most wakes are:

AudioMix
EntriesRefresh_wakelock
ULR-BarometerReading_wakelock
NIpCollectorWakelock
And BBS_Wakelock

I will google those later ... But mi biggest issue is the fact that the phone worked fine, but now it is terrible, with no new apps or anything ... Even without anything installed from my part the batery drain is enormous. I am constantly chargign the phone.

Thanks for your reply, though. I will when i am able to download xposed.

---------- Post added at 02:20 PM ---------- Previous post was at 01:42 PM ----------

But what do you do to get decent battery life?? maybe my battery is broken??? i don't know what to think

Did you ever figure it out?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    There is no "Misc bug" or "WiFi Bug" related to misc

    Its really simple and basic and is in no way "drain".* All your battery stats are guessed calculations. They're never accurate. They never have been and never will be.

    Basic version


    Here's how battery stats work.*

    In android, there is a file. It lists "power consumption" for certain things.*

    For example (and these numbers are made up for simplicity)

    WiFi disconnected = 4mA
    WiFi connected = 10mA

    So if your phone has been connected to WiFi for 10 hours, it calculates that 10 hours @ 10mA = x% of battery used.*

    However, what if you're in your bedroom for 10 hours? The router is in your living room. Actually your WiFi is using 20mA because of the weal signal. Well, this magic file cannot account for that. There is no "WiFi connected but user is in bedroom = 20mA" entry in the file.*

    Battery stats actually have no link to actual battery usage. Its just a guess. Battery stats knows how much battery has been used and using its magic file, makes an educated guess at how much % battery has been used by each thing.*

    So your battery has depleted by 50%. 25% is WiFi connected at 10mA. But your WiFi was actually using 20mA because of distance. Battery stats cannot know this. So you actually have 25% missing in battery stats. That's what miscellaneous was created for. To show that there was a difference between battery stats guess and actual battery use from the battery.*

    Its the same for screen brightness, cell signal, CPU usage etc. The file knows very little. Battery stats is very inaccurate

    Google actually removed miscellaneous from stock ROMs due to people who don't understand, calling it a WiFi bug. However it still exists in aosp.*



    Advanced version

    How battery stats work

    The Battery stats UI shows the percentage of battery that device elements are responsible for using, which is based on a couple of things.

    1./data/system/batterystats.bin
    2./system/frameworks/frameworks-res.apk/res/xml/power_profile.xml

    These things contribute in the following way:

    1.From the moment Android detects that a close-to-full charge has completed, batterystats.bin records how long the device elements are running
    3.This xml file is where the information about how much power, each device element “uses”

    The battery stats UI looks at batterystats.bin to see how long each element has been running (and in what state) since the last charge, applies the value (in mV) for each element stored in power_profiles.xml and comes up with a calculation of the % of battery each element is using.

    It simply knows the total mV used by adding up all the element values and the time in state to work out the percentages.

    Here is a really basic example…

    power_profile.xml from the SNexus 5
    Code:
    *<item name="none">0</item> <item name="screen.on">82.75</item> <item name="screen.full">201.16</item> <item name="bluetooth.active">51.55</item> <item name="bluetooth.on">0.79</item> <item name="wifi.on">3.5</item> <item name="wifi.active">73.24</item> <item name="wifi.scan">75.48</item> <item name="dsp.audio">0.1</item> <item name="dsp.video">0.1</item> <item name="gps.on">76.23</item> <item name="radio.active">185.19</item> <item name="radio.scanning">99.2</item>

    batterystats.bin
    Code:
    *** screen.on = 2 h
    *** bluetooth.active = 3 h
    *** bluetooth.on = 7 h
    *** wifi.on = 6 h
    *** wifi.active = 4 h

    So, if….
    Code:
    *** screen.on = 165.5
    *** bluetooth.active = 154.65
    *** bluetooth.on = 5.53
    *** wifi.on = 21
    *** wifi.active = 292.96
    *** Total = 639.64

    Then…*
    Code:
    *** screen.on = 26%
    *** bluetooth.active = 24%
    *** bluetooth.on = 1%
    *** wifi.on = 3%
    *** wifi.active = 46%
    *** Total = 100%


    That was a basic example of how the Battery Stats UI makes it’s calculations.* Notice how the total is 100%? Well in KK and earlier this was the case.* The Battery Stats UI calculated to 100%.* So even if you had only used 50% of your battery, it would show that device elements had used 100% of your 50% used battery.

    This meant that as it always had to add up to 100%, it didn't have to be particularly accurate.* It takes the values and calculations it knows about and works the portion of that 100% each known value has taken.* It knows that 639.64 is 100% therefore wifi at 292.96 must be 46%....

    Since Lollipop, it has changed and makes it more difficult for battery stats UI to be so blase about its accuracy.* Now it attempts to show you what "actual" percentage of battery has been used.* For example, if 50% of your battery has been used, the total of percentage used by device elements will also show as 50%.* However, now that the total % of elements might not match the total % of battery used, it is much harder to hide how inaccurate battery stats actually are.

    So to elaborate on that further, lets say that your Nexus 5 battery is 4720 mV in capacity.* The actual battery % in status bar is calculated by reading the actual current battery reading from the battery itself and working out the %, so in the example above, 14% battery has been used (639.64 is 14% of 4720 - or more accurately 13.55%)

    So...*

    Code:
    *** screen.on = 3.6%
    *** bluetooth.active = 3.4%
    *** bluetooth.on = 0.05%
    *** wifi.on = 0.5%
    *** wifi.active = 6%
    *** Total = 13.55%

    Why are they never accurate?

    So battery % in status* bar takes a reading from the actual battery, but battery stats just add up what they recorded multiplied by the Power_profile.xml values.

    Looking at the power_profile.xml file, you'll see for example, wifi - there is an "on" value and an "active" value.* There are just 2 states.* However, what if your router is in your living room and you are in the bedroom?* WiFi Active may not be 76.23 at all.* Due to weak signal, it may be 150....* But battery stats is not aware that it may be using 150....* So it calculates using 76.23

    This is where it gets a little more complicated.* Lets go back to these calculations, but factor in the new 150 value for bedroom wifi active

    batterystats.bin
    Code:
    *** screen.on = 2 h
    *** bluetooth.active = 3 h
    *** bluetooth.on = 7 h
    *** wifi.on = 6 h
    *** wifi.active = 2 h
    wifi.active.InBedroom = 2 h

    So, if….
    Code:
    *** screen.on = 165.5
    *** bluetooth.active = 154.65
    *** bluetooth.on = 5.53
    *** wifi.on = 21
    *** wifi.active = 152.46
    wifi.active.InBedroom = 300
    *** Total = 799.14

    So that is what ACTUALLY happened.* But Battery Stats doesn't know.. because the power_profile.xml does not really have the InBedroom entry at all.* So battery stats shows that a total 639.64 of battery has been used, however the physical battery reports that 799.14 has been used.* So the battery % in the status bar is 100% - 17%, = 83%....* 17% has been used but our earlier stats (that don't show the fake inbedroom value) show the total used is only 13.55% - there is a discrepancy here...

    Well, since lollipop, that discrepancy has to be accounted for to make the battery stats appear more accurate, so the 159.50 difference that is unaccounted for (The Wifi InBedroom), now will appear as "Miscellaneous".* This makes battery stats show that 17% total battery has been used, to match the status bar and not 13.55% as per the total added up from Power_profile.xml...*

    THis is not just the case with WiFI, but with everything from Screen brightness, to bluetooth to cell reception.

    Why does misc show on some roms and not others

    You may remember a while back that people were reporting the WiFi bug to google..* Well, simply - they probably got fed up and hid misc in Stock ROMS.* No stock roms on the Nexus 5 show misc anymore.* They just have calculations that no longer add up in total to the amount of % used of your battery

    Some people have accused google of "hiding" the bug.* What we're saying is that there is NO BUG and they hid misc, which is what caused people to think there was a bug in the first place.

    The Misc battery report is still in AOSP code, however some roms have also decided to hide it, such as SlimRoms for example.

    You can see their changes here:

    From Google: https://github.com/SlimRoms/packages_apps_Settings/commit/e6793771cedb47aed72f1c64f870b70357746938
    Custom ROM feature: https://github.com/SimpleAOSP-Lolli...mmit/d025994f90722139dfcf236f275e05236ec47491

    Here is an example on SlimLP with the option turned on and off

    14d7395f053db82ae9d08abc11b1dcf7.jpg


    dd97f110d80aea2e4c9899f9c78a3e23.jpg


    a0771c6db526da148f9c7989ba6613c5.jpg




    Summary

    There is no such thing as a "misc bug" or "WiFi bug".* Android tries to calculate the amount of battery used by each device element, based on a very finite list of values.* Since the values are pre-determined in a file, it is not an accurate refelection of reality.* When these values in reality are higher than the file, it makes the Battery Stats show a lower % than reality being used by the elements (most easily seen in wifi).* To make the elements total match the actual % used from the battery, Misc was created to fill in that discrepancy - However, since people thought it was a bug due to lack of understanding, it has since been hidden.* But it is not a bug.