[Q] Miscellaneous battery usage in 5.0.2 - Nexus 5 Q&A, Help & Troubleshooting

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I made a home made build of omni ROM. And I'm getting "Miscellaneous" in Battery stats. It's eating up hell lot of battery. Any idea on how to fix this inside the code ?

You can hide it changing from userdebug to user in the buildprop

Read below.
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
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.
Click to expand...
Click to collapse

Related

News: Battery Booster will coming Next week

After a long time research and development. We are going to lunch our new product especially for android smartphones named "Battery Booster". This is our website http://www.downloadandroid.info (Not sure if post this link is ok? If not, please inform me.) Our site includes a lot of information for android phones, such as: our own apps for health, utility and lifestyle. Our blog supply android informations such as news and updates, free app&theme resources, and app reviews for android user can take a whole review of android apps.
I will post later about the features of our new product BatteryBooster. Hope you like.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hi see the features of our new product "Battery Booster":
Features:
* Real-time battery status (capacity, temperature, voltage, and charging status, etc) monitor and battery usage tracking
* Homescreen widget support (Add to homescreen with Menu -> Add -> Widgets -> Battery Booster)
* Shortcuts to WiFi/Bluetooth/Screen Brightness/Screen Timeout settings
* Battery Calibration Notification to maximize your battery life span
* Settings to turn off WiFi/Bluetooth when device is locked. (The status of WiFi/Bluetooth will be saved and restored after your device is unlocked.)
* Settings to turn off WiFi/Bluetooth when your battery is low.
* Settings to enable beep and select beep tone when your battery is low.
* Save more battery with built-in smart task manager (Based on Memory Booster – Android RAM Optimizer)
Screenshots:
Battery Booster-Boost Your Battery’s Running Time and Max Battery Life, It's free just try it and give us your suggestion. Thanks
For mobile users, you can directly download from our mobile site: http://mobi.downloadandroid.info/battery-booster.php
Well, thanks for this - I love the concept and detail of the app! Looks great!
Davidandroid said:
After a long time research and development. We are going to lunch
Click to expand...
Click to collapse
lol might want to fix that
Looks good though
MacaronyMax said:
lol might want to fix that
Looks good though
Click to expand...
Click to collapse
Wow, I was having lunch when Battery Booster launched Thanks anyway....
Can Battery Booster wins anymore awsome
Has anyone tried it yet?
I will give a try and post later,
Not big on the ads down on the bottom. Havent noticed much change from another battery app I use. Nice look to it and icons are noce.
Read the comments on the martket and i am sure l will try it.
This app is absoloutely fantastic increased my battery life from 6 hours to 20 hours+
I love the widget
Problem is it is stopping my alarm going off each morning. Does any one know how to make your alarm still work with it installed.
Update
Battery Booster (Free) just update to Version 1.7. Please read more information about this update Here
great app. would be willing to pay for it if you could remove the adds at bottom of screen !!! JUST A THOUGHT !~!
Davidandroid said:
Hi see the features of our new product "Battery Plus":
Features:
* Real-time battery status (capacity, temperature, voltage, and charging status, etc) monitor and battery usage tracking
* Homescreen widget support (Add to homescreen with Menu -> Add -> Widgets -> Battery Booster)
* Shortcuts to WiFi/Bluetooth/Screen Brightness/Screen Timeout settings
* Battery Calibration Notification to maximize your battery life span
* Settings to turn off WiFi/Bluetooth when device is locked. (The status of WiFi/Bluetooth will be saved and restored after your device is unlocked.)
* Settings to turn off WiFi/Bluetooth when your battery is low.
* Settings to enable beep and select beep tone when your battery is low.
* Save more battery with built-in smart task manager (Based on Memory Booster – Android RAM Optimizer)
Screenshots:
Battery Booster-Boost Your Battery’s Running Time and Max Battery Life, It's free just try it and give us your suggestion. Thanks
Click to expand...
Click to collapse
Suggestion:
Display the percent remaining as well as an estimated time left on the widget
Questions:
Could you go into more detail about the task manager...Does the task manager function similar to autokiller which allows the user to set thresholds as to when the memory manager starts cleaning up various apps.
What is battery calibration?
Will any conflicts occur if you are using other battery tweak programs such as collin_ph's battery tweak for example
acke2008 said:
This app is absoloutely fantastic increased my battery life from 6 hours to 20 hours+
I love the widget
Problem is it is stopping my alarm going off each morning. Does any one know how to make your alarm still work with it installed.
Click to expand...
Click to collapse
I'm gonna call BS on that. It *might* be able to increase battery by a small amount (unlikely, as the very act of monitoring the battery so closely WILL drain more power), but 14+ hours? Absolute BS.
Yeah stuff like this dont do magic lol.
dsMA said:
Suggestion:
Display the percent remaining as well as an estimated time left on the widget
Questions:
Could you go into more detail about the task manager...Does the task manager function similar to autokiller which allows the user to set thresholds as to when the memory manager starts cleaning up various apps.
What is battery calibration?
Will any conflicts occur if you are using other battery tweak programs such as collin_ph's battery tweak for example
Click to expand...
Click to collapse
First thanks for your suggestion.
As for your question:
1. Smart Task Manager: Save more battery by smartly killing idle processes running in the background (Based on Memory Booster - Android RAM Optimizer).
2.A battery calibration means ‘Give your Android a full charge, then let the battery run out. Then recharge it to full'. A complete cycle is counted as a calibration. This is goog for your battery and maximum battery life
3. I don't use battery tweek, so I am not sure. But I will test about this question and post later
Probably need to see some stats. I've tried lots of battery optimisers (ultimate juice etc) and in the end I've removed them all as I get best battery life by doing the standard stuff like turning screen brightness down, setting wifi to turn off after 15 mins inactivity and running an undervolted kernel. I'd love to be proved wrong, but I'm sceptical.
landwomble said:
Probably need to see some stats. I've tried lots of battery optimisers (ultimate juice etc) and in the end I've removed them all as I get best battery life by doing the standard stuff like turning screen brightness down, setting wifi to turn off after 15 mins inactivity and running an undervolted kernel. I'd love to be proved wrong, but I'm sceptical.
Click to expand...
Click to collapse
You can have a try of Battery Booster, It's totally free. Please leave your questions or suggestions, we will improve it for better use. Thanks
Works pretty good. Notice my phone is running faster. Would be better if the icon displayed the battery level.

[TEST]Battery Tests on Stock Galaxy S

First of all full credit goes out to sapiensbryan for giving me permission to post this from his blog.
I'm putting up here for everyone's information because I think this could be of use to us. There was only one link to one of the battery test videos on YouTube that I saw on XDA but not the complete test results or graph I am posting here, if I'm wrong I'm sure somebody will let me know.
I think a lot of us have forgotten or never knew how our phones battery reacted under these situations when it was running completely stock. I never had all this info and basically only knew how long my phone lasted on a charge.
Now we have a reference point as to how our modded ROM's are compared to stock.
Thanks again bryan for the work on this
___________________________________________________________________
A few friends, blog readers and twitter followers asked me about the battery life of Samsung Galaxy S in the past few days. Me too was interested to know what is the battery performance under extreme usage. Besides, I’m sure potential customers would like to see some statistics so that they can stop wondering about the battery performance of Samsung Galaxy S.
Therefore, I performed 4 battery tests 5 battery tests in the past 30+ hours 40+ hours and finally we have some answers to the battery related questions. Below are the objectives of all 4 battery tests I did :-
* Test 1: Find out how long will the battery last (from 100% battery level to 0%) when connecting to an active Wifi Connection
* Test 2: Find out how long will the battery last (from 100% battery level to 0%) when connecting to an active 3G Data Connection
* Test 3: Find out how long will the battery last under continuous movie playing
* Test 4: Find out how long we need to fully charge the battery after it’s completely flat (0% battery level)
* Just added 1 more Music Playing (Test 5).
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Samsung Galaxy S Battery Test Final Battery Test Results (now with Music Playing result)
General settings for all 4 tests
* Lowest brightness level
* Medium speaker volumn
* The screen is always lit throughout the tests
* Not running any screen saver
Test 1: Active Wifi Connection
* 1. Connect to an online radio via Wifi connection
* 2. Let it run until the phone switches off when the battery is depleted
Result: The phone was running for 9 hours 57 minutes before switching off itself.
Test 2: Active 3G Data Connection
* 1. Connect to an online radio via 3G Data connection
* 2. Let it run until the phone switches off when the battery is depleted
Result: The phone was running for 4 hours 47 minutes before switching off itself.
Test 3: Continuous Movie Playing
* 1. Continuously play some movies using the default movie player
* 2. Let it run until the battery level reaches 10%
Result: The phone was running for 6 hours 29 minutes before the battery level reached 10%. Movie player will stop running when the battery level falls to 10%. 6 hours 29 minutes of continuous playing time is more than enough to play 3 sets of movies at normal length.
Test 4: Charging Time
* 1. Fully charge the phone using original Samsung Travel Charger after the battery was completely depleted
Result: The phone needs 3 hours 47 minutes to get fully charged after the battery was completely depleted.
Below is the video documenting all the 4 battery tests :-
YouTube Video of First Four Tests
Test 5: Continuous Music Playing
* 1. Continuously play some songs via earphone using the default music player
Result: The phone was running for 13 hours 9 minutes and we still have 39% battery level. That’s about playing 263 songs of 3 minutes long each
Below is the video documenting the Music Playing test :-
YouTube Video of Music Test
I hope the results of the above battery tests are useful and help to clear doubts regarding Samsung Galaxy S battery performance. Now at least we have an idea how will the battery perform under extreme usage. As for normal usage, the phone should be able to last for the whole day under occasional Internet surfing, email checking, photo & video shooting, viewing video and listening to songs.
Not too bad, considering the screen never turned off.
ryude said:
Not too bad, considering the screen never turned off.
Click to expand...
Click to collapse
+1 it may not be a big deal to most but I thought this had some good info like the simple charging of the battery from dead to full. I don't even recall actually. And Whoah what a difference from wifi to using 3g.
Not bad...

How to Edit Frequencies in Exynos4412?

I've built a custom kernel for my Galaxy Tab 10.1 The link is in my signature. When I wanted to add custom frequencies to it, there was a very informative post that told me how to edit the frequency table to make the new clock speeds on tegra2 come out right and also how to edit the voltage tables. At least on the tegra2 it involved editing tegra2_clocks.c where you had to change the pll_x frequency table, change the pll_x max speed, virtual cpu max speed, sku max speed, and add an additional frequency table for your new clock speeds. The voltage was done in tegra2_dvfs.c where you added changed the min/max voltages accordingly and added in your new frequencies there.
I have looked all over the internet for a similar guide for my I9300. The cpufreq-4x12 looks nothing like the tegra one. It appears that every frequency has an entry in clkdiv_cpu0_4412 (for the S3 at least) with dividers for cryptic values like "divcore" "divcorem0". I've tried doing a grep search in the kernel source and couldn't find those names mentioned anywhere. There also appears to be another clkdiv_cpu1_4412 with even more cryptic values which don't appear in grep either. Then of course, there's yet another cryptic table that each frequency seems to go to called "apll_pms". It appears as the voltages go to the asv tables but how you accommodate new frequencies is beyond me. The L0,L1.. etc labels don't appear to follow the conventions stated earlier where 1800MHz is labelled L0 at the top but L-2 later.
I realize that many experienced developers probably take this information for granted and I wouldn't be asking for this if it was available somewhere else. The documentation folder in the kernel doesn't provide any information either.
Please help a startup enthusiast As a beginner, I've typically answered similar how to questions on my own thread in the beginning, when other people were interested in how to get their hands dirty with modifications. (Although now, people just seem to be interested in the final product which is fine too.)
Each divider value represents the real divider minus 1. So a value of 7 divides by 8. Populate the divider talbes with new entries like that. The registers have a limit so see the register maps in /mach/regs-clock.h. The dividers divide the final CPU clock. What values you give the dividers is up to you to decide.
The CPU clock is decided by the PLL as you saw. PMS decides the PLL frequency. The source quartz runs at 24MHz. The frequency is calculated by (P * Xtal) / (M << S).
Example 500MHz: ((125<<16)|(3<<8)|(0x1)), the format is ((P<<16)|(M<<8)|(S)).
(P * Xtal) = 125*24 MHz = 3000MHz
(M << S) = 3 << 1 = 6
End result is 3000MHz / 6 = 500MHz.
That's all you need to know. Alternatively, just copy what other devs have already done. Be careful with the Lx levels when you add new ones, you need shift all the existing ones throughout the file.
AndreiLux said:
Each divider value represents the real divider minus 1. So a value of 7 divides by 8. Populate the divider talbes with new entries like that. The registers have a limit so see the register maps in /mach/regs-clock.h. The dividers divide the final CPU clock. What values you give the dividers is up to you to decide.
The CPU clock is decided by the PLL as you saw. PMS decides the PLL frequency. The source quartz runs at 24MHz. The frequency is calculated by (P * Xtal) / (M << S).
Example 500MHz: ((125<<16)|(3<<8)|(0x1)), the format is ((P<<16)|(M<<8)|(S)).
(P * Xtal) = 125*24 MHz = 3000MHz
(M << S) = 3 << 1 = 6
End result is 3000MHz / 6 = 500MHz.
That's all you need to know. Alternatively, just copy what other devs have already done. Be careful with the Lx levels when you add new ones, you need shift all the existing ones throughout the file.
Click to expand...
Click to collapse
I'm a bit confused by what M << S means. From lookig at the example it looks like the formula is: P * 24 / ( M * 2^s)? Also, I'm assuming the voltage tables don't have to be touched. Thanks so much for the information. And... what fun would it be if you did a straight up copy and paste? :cyclops:
Ummm that's a bit-wise left-shift operation. And yes you also need to add entries in the voltage table.
AndreiLux said:
Be careful with the Lx levels when you add new ones, you need shift all the existing ones throughout the file.
Click to expand...
Click to collapse
And in any other files that reference levels... Namely any that contains a level-based DVFS lock.
I think much of Samsung's newer code does frequency-based locks with a frequency-to-level lookup, but in older 4210 kernels, there were lots of locks that called out specific levels. Some of these locks were in throttling code. Levels go from high freq to low freq.
So if L2 was originally 800 MHz, and L2 is now 1000 MHz, and thermal throttling code locks to a minimum level (maximum frequency) of L2... Whoops, now the thermal throttling is broken.
Hi again,
For some reason, the exynos4 sources seem to be much more fussy than the galaxy tab 10.1 tegra2 sources I messed with in the summer. Right of the bat (with no modifications), it refuses to compile giving me issues in the file arch/arm/mvp/mvpkm/mvpkm_main.o. I haven't touched anything or made any changes yet. I downlaoded the latest sources from Samsung. I tried switching toolchains and I get 1 of 2 errors. With an older toolchain I get
/tmp/ccC3yZT8.s:4865: Error: unknown pseudo-op: `.arch_extension'.
With a newer toolchain I get an error about making a pointer to int conversion without a cast. Wow, truly unbelievable!!!??? I just want to make a baseline run, haven't touched a character of code and it refuses. I tried compiling CM10.1's kernel (also with no modifications) but for some reasons the graphics are Pentium 1 slow. ADB shell with logcat keeps saying hwcompser can't do vsync and it attempts to fake it.
I don't remember it being this hard on my galaxy tab 10.1. Am I missing something obvious?
---------------------added-----------------
I got cm sources compiling correctly. I think i forgot to undo previous experiments
AndreiLux said:
Each divider value represents the real divider minus 1. So a value of 7 divides by 8. Populate the divider talbes with new entries like that. The registers have a limit so see the register maps in /mach/regs-clock.h. The dividers divide the final CPU clock. What values you give the dividers is up to you to decide.
The CPU clock is decided by the PLL as you saw. PMS decides the PLL frequency. The source quartz runs at 24MHz. The frequency is calculated by (P * Xtal) / (M << S).
Example 500MHz: ((125<<16)|(3<<8)|(0x1)), the format is ((P<<16)|(M<<8)|(S)).
(P * Xtal) = 125*24 MHz = 3000MHz
(M << S) = 3 << 1 = 6
End result is 3000MHz / 6 = 500MHz.
That's all you need to know. Alternatively, just copy what other devs have already done. Be careful with the Lx levels when you add new ones, you need shift all the existing ones throughout the file.
Click to expand...
Click to collapse
I have been meaning to thank you for this, I have not seen this information elsewhere. Could you please briefly explain how to set the values in cpufreq_clkdiv? I have noticed different kernels have different values for the same frequency, and I don't know which one is correct for me.
Example:
/*
* Clock divider value for following
* { DIVCORE, DIVCOREM0, DIVCOREM1, DIVPERIPH,
* DIVATB, DIVPCLK_DBG, DIVAPLL, DIVCORE2 }
*/
Samsung source (I believe)
/* ARM L0: 1600Mhz */
{ 0, 3, 7, 0, 6, 1, 2, 0 },
Perseus:
/* ARM L0: 1600Mhz */
{ 0, 4, 7, 0, 6, 1, 7, 0 },​
ffolkes said:
I have been meaning to thank you for this, I have not seen this information elsewhere. Could you please briefly explain how to set the values in cpufreq_clkdiv? I have noticed different kernels have different values for the same frequency, and I don't know which one is correct for me.
Example:
/*
* Clock divider value for following
* { DIVCORE, DIVCOREM0, DIVCOREM1, DIVPERIPH,
* DIVATB, DIVPCLK_DBG, DIVAPLL, DIVCORE2 }
*/
Samsung source (I believe)
/* ARM L0: 1600Mhz */
{ 0, 3, 7, 0, 6, 1, 2, 0 },
Perseus:
/* ARM L0: 1600Mhz */
{ 0, 4, 7, 0, 6, 1, 7, 0 },​
Click to expand...
Click to collapse
I don't have any exact technical explanation behind the physical CPU blocks that those auxiliary dividers are clocking.
Personally I just fired up Excel and adjusted them in to what seemed to me a reasonable curve with the rest of the frequency clocks which Samsung provided. These are the values I put in Perseus.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
You could probably adjust M0 again beyond 1800 MHz to be somewhat lower.

Battery life low since I root+flashed

Hello, I rooted and flashed CM and now AOKP. Under both, my battery life is low compared to when I had stock.
I have not flashed my radio or kernel, maybe that's it? I noticed my network signal is kind of low, too.
Here's a shot of my battery life:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
And here's my BBS log: https://dl.dropboxusercontent.com/u/92536272/BetterBatteryStats-2013-10-16_002712036.txt
I'm always on wifi, always was and never had problems with that. Didn't install any new apps I didn't have before root apart from UCCW and the holo glass theme with an icon pack, everything else (which is not much, maybe a few more apps along with gapps) was there before.
I am at your mercy , android gods.
Posklapenzi said:
Hello, I rooted and flashed CM and now AOKP. Under both, my battery life is low compared to when I had stock.
I have not flashed my radio or kernel, maybe that's it? I noticed my network signal is kind of low, too.
Here's a shot of my battery life:
And here's my BBS log: https://dl.dropboxusercontent.com/u/92536272/BetterBatteryStats-2013-10-16_002712036.txt
I'm always on wifi, always was and never had problems with that. Didn't install any new apps I didn't have before root apart from UCCW and the holo glass theme with an icon pack, everything else (which is not much, maybe a few more apps along with gapps) was there before.
I am at your mercy , android gods.
Click to expand...
Click to collapse
I read your log. These are the major consumers of your battery:
Wifi On (): 8 h 37 m 18 s (31038 s) Ratio: 100.0%
Wifi Running (): 8 h 37 m 18 s (31038 s) Ratio: 100.0%
No Data Connection (): 8 h 37 m 18 s (31038 s) Ratio: 100.0%
No or Unknown Signal (): 8 h 37 m 18 s (31038 s) Ratio: 100.0%
Since you already know that wifi is not an issue, then the other would have been the cause.
Low network signal is one of the causes of low battery life. When the network signal is low, your cellphone increases its transmitting power incrementally until it gets a signal of a preset threshold (set by the radio). It will keep on transmitting at frequent intervals to establish a link with the cellular base station, and this is where the battery consumption lies. When a cellphone transmits, it uses as much as 15 time more power than when it is just on receive mode. You could try the following steps to narrow down to where the problem lies.
1. If you have always been in the same location before and after flashing the new ROM, then it could be the network provider's problem because the cellular base station may not be working properly, hence the low signal. Ask around someone else around you who is on the same network and see it he also have this low signal problem. If others have the same problem, then call the network provider to complain.
2. If you have changed location since flashing, then you might be in a location that has low signal levels. Again, you can also check with others if they encounter the similar problems. Same as above, call the network provider to complain.
3. If others around you do not have network signal issues and you are the only one, then it is probably the ROM. If you can, revert to the OEM and compare. If, after reverting to OEM and the problem still exist, then you can try to upgrade the radio ROM.
4. If after upgrading your radio ROM and the problem is still there, then it is probably your phone hardware. I will advise to send to OEM for an evaluation and repair if necessary.
Hope this helps.
chan.sk said:
I read your log. These are the major consumers of your battery:
Wifi On (): 8 h 37 m 18 s (31038 s) Ratio: 100.0%
Wifi Running (): 8 h 37 m 18 s (31038 s) Ratio: 100.0%
No Data Connection (): 8 h 37 m 18 s (31038 s) Ratio: 100.0%
No or Unknown Signal (): 8 h 37 m 18 s (31038 s) Ratio: 100.0%
Since you already know that wifi is not an issue, then the other would have been the cause.
Low network signal is one of the causes of low battery life. When the network signal is low, your cellphone increases its transmitting power incrementally until it gets a signal of a preset threshold (set by the radio). It will keep on transmitting at frequent intervals to establish a link with the cellular base station, and this is where the battery consumption lies. When a cellphone transmits, it uses as much as 15 time more power than when it is just on receive mode. You could try the following steps to narrow down to where the problem lies.
1. If you have always been in the same location before and after flashing the new ROM, then it could be the network provider's problem because the cellular base station may not be working properly, hence the low signal. Ask around someone else around you who is on the same network and see it he also have this low signal problem. If others have the same problem, then call the network provider to complain.
2. If you have changed location since flashing, then you might be in a location that has low signal levels. Again, you can also check with others if they encounter the similar problems. Same as above, call the network provider to complain.
3. If others around you do not have network signal issues and you are the only one, then it is probably the ROM. If you can, revert to the OEM and compare. If, after reverting to OEM and the problem still exist, then you can try to upgrade the radio ROM.
4. If after upgrading your radio ROM and the problem is still there, then it is probably your phone hardware. I will advise to send to OEM for an evaluation and repair if necessary.
Hope this helps.
Click to expand...
Click to collapse
Thank you very much for your help kind sir I have not changed location. I agree that revering and comparing might be a good place to strat, although I am partial to skipping that step and just flashing a new radio in the hopes of that fixing it

[Q] Can someone explain battery stats.

Can someone please explain to me why don't the percentage add up to 100% or even the used battery.
Like if I use 50% of my battery the percentage all together should be 50%, it doesnt even reach 30%
Im talking about this percentages here, in kitkat It was closer to reality, I always assumed there was a small error window but this is way too much.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
fleen said:
Can someone please explain to me why don't the percentage add up to 100% or even the used battery.
Like if I use 50% of my battery the percentage all together should be 50%, it doesnt even reach 30%
Im talking about this percentages here, in kitkat It was closer to reality, I always assumed there was a small error window but this is way too much.
Click to expand...
Click to collapse
They changed how it works in L. In KK, they called it 100% of your used battery. That was a little confusing. It meant that everything had to add up to 100, so it was easy to proportion it out.
Now in L the percentage matches what was used. So now if you have used 50% then your stats add up to 50%. Previously on KK it would have been 100% of 50%
So now you think your stats should match up with used battery. They were never accurate, not even in kk. But in L its more obvious.
That's why they created miscellaneous in L but everyone moaned that it was a "WiFi" bug so they removed it from stock ROMs..
Hopefully this helps...
rootSU said:
Its really simple and basic and is in no way "drain". If the big wall of text in the screenshot doesn't clarify what it is, then I will elaborate further.
All your battery stats are guessed calculations. They're never accurate. Never have been and never will be.
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 because i can't be bothered to look in the code)
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.
I hope think clarifies for people
Click to expand...
Click to collapse
rootSU said:
They changed how it works in L. In KK, they called it 100% of your used battery. That was a little confusing. It meant that everything had to add up to 100, so it was easy to proportion it out.
Now in L the percentage matches what was used. So now if you have used 50% then your stats add up to 50%. Previously on KK it would have been 100% of 50%
So now you think your stats should match up with used battery. They were never accurate, not even in kk. But in L its more obvious.
That's why they created miscellaneous in L but everyone moaned that it was a "WiFi" bug so they removed it from stock ROMs..
Hopefully this helps...
Click to expand...
Click to collapse
Thank you so much, this as been anoying me since forever.

Categories

Resources