yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] mag01:
So I tried 1.15RC2 installed as system app at Nexus 5 (Android 4.4_r1) and have somewhat strange results

Other - only Deep Sleep stats are shown

Kernel Wakelock - seems fine

Partial Wakelocks - nothing at all

Alarms - these behave quite strangely, upon reboot I get warning "Boot event was not registered yet, it will at next reboot ()", however if I plug/unplug the USB cable, it starts to display some stats.

Network - seems fine

CPU States - seems fine

Process - nothing at all

Before that I was trying 1.15B5 and it worked quite well given the Android 4.4_r1 limitations.

Besides that, there's one minor glitch: sometimes when I plug/unplug the USB cable and the reference points are updated it ends up in some strange display state where the "to" reference point is empty so I have to manually chose the "Current" one, or refresh the display several times which may also fix things.

EDIT: Uninstalled as system app (selecting "Installed as system app" button resulted in "Failed" message, however the app seemed to uninstall as it crashed in a while and disappeared from the phone, so I rebooted phone, reinstalled it, enabled root features and restarted again).

Now the Other doesn't show anything at all too, Partial Wakelocks, Alarms, Process still don't work, and additionally Network doesn't seem to work too.

Now went to 1.15RC1 and it seems to be working quite well (except for the reference point refresh glitch described above, and well - Alarms still behave like I described above which may be just how it is in any case).
[BetterBatteryStats] ramrastus:
This is ma BBS stats Rc1 in last night.. android version is 4.1.2, this stats was correct? Or i have change anything bro?
[BetterBatteryStats] planetf1:
Thanks for BBS - super app.

Any tips on dealing with wlan_rx_wake

(Full images at https://plus.google.com/+NigelJones/posts/Shaq2fUkzEZ )

My understanding is this is the device being awoken by packets being received. Some of these will be directed at apps, so there may be a case for understanding those apps better and reconfiguring/changing the ones with the worst impact, others will be unsolicited broadcasts

So far my plan is

* Take a packet trace to identify wlan traffic (doesn't help with app assocation) - note not rooted, but using a tool that doesn't need it

* Trying the device on a dedicated subnet (this breaks sonos controller.... !)

* research/ask more ...

Note in those images it's clear google services's usage is down to network location. I currently have google now/history etc enabled. I know that but quite like the function so going to stick with it for now.

APologies if this is the wrong place to ask -- BBS has got me this far but perhaps I need to go elsewhere now? feel free to recommend!
[BetterBatteryStats] chamonix:
Please repeat and send a logcat. You have granted BBS root right?
[BetterBatteryStats] chamonix:
You are at the right place to discuss that don't worry. You analysis is right except for one point : the traffic is not directed to any app, not even to your device as it is multicultural traffic. It is most probably caused by upnp or some other discovery or announcement protocol.

If you suffer from that wakelock only at your place it is worth giving it a try and isolate your device. As you noticed this will prevent you from talking to devices on other subnets though.

Using a packet analyser and find the device responsible is your best chance IMHO, or turn off Wi-Fi when you are not using it (eg using better Wi-Fi on/off).
[BetterBatteryStats] Karpfenhai:
This is a good place to ask :D

Two easy measures:

- set up a vlan for your note only

- write a tiny script (userinit.sh) which disables multicast receiver on wlan0

Should work without root afaik, has to be executed every time wlan goes up.

Note, apps are waiting for traffic are not the problem, it's the network shouting broadcast.

Sniffing and disabling those noisy devices can also lead to success.

Damned, Sven was faster...:cool:

Regards.

Tapatalked from my Galaxy SII
[BetterBatteryStats] Peanuts.:
Yep, root access granted.

Went through the same steps.

Uninstall & reinstall bbs

Granted root access

Got a Fail dialog.

Converted to system app via Titanium Backup.

Granted root access again

Fail dialog again

Please let me know if I've attached the log correctly.

Thanks for taking a look
[BetterBatteryStats] planetf1:
Thanks. I had a quick read and it seems on some devices at least multicast reception is disabled when the phone's screen is off -- that config would work for me fine. Sadly I need to be in the same subnet & allow uPNP etc to have sonos working properly (and the phone as controller). WHen the screen is on that's fine... (S4, I9505, 4.3 stock kernel)

I'll check the wlan settings tonight and run some traces....

thanks
[BetterBatteryStats] saleemakbani:
Can someone have a look at my bbs https://db.tt/DVsh2yGK

Running 4.4 stock official image rooted nexus 4. The battery is draining like crazy.
[BetterBatteryStats] chamonix:
The phone has been charged during this sample. Please read the OP and post an idle dump
[BetterBatteryStats] mag01:
Update to the above.

I performed some more tests and when I clean install 1.15RC2 then it works pretty well until I decide to install it as system app. After installing as system app and restarting, things start to behave as I already described. The only way to get it back to work is to uninstall it completely, reboot, reinstall as normal user app, setup properly etc...

However after several attempts I go it it to work as system app and it seems it could be perhaps related to issues accessing its application data in this mode, because it worked only until I cleared the application data. If I cleared that data, rebooted, reconfigured the BBS from scratch, (also with root features + regranted it in SuperSU), then it broke again. So currently it seems to work only under certain conditions.

Google Nexus 5, stock Android 4.4_r1 rooted with SuperSU 1.69
[BetterBatteryStats] chamonix:
That's a good hint. I will look into where the data is located a well as into the user ID as we may have a permission problem
[BetterBatteryStats] Serotheo:
Hi I'm using a Note 3 and have been trying to self-troubleshoot my battery life for the past few days.

Slowly but surely I've been growing envious of how people get obscene 5-8 hour SOTs.

Anyhow, I've been getting roughly 3 hour SOTs, 4 (rounded up..) if I'm lucky.

Configurations are WiFi, GPS, Auto-sync Always On.

WiFi-Sleep Policy: Never, Always on WiFi Scanning: Never.

Play Services Location Settings for Reporting and History: OFF.

Google Now: OFF (Doesn't seem to really help either way.)

Access to my Location: ON

GPS Satellites: ON

Wireless Location Settings: OFF

Also: According to Wakelock Detector..

3 h 55 m uptime:

23 m Deep Sleep

3 h 32 m Total awake time (SOT + Awake)

1 h 33 m Screen-on time

1 h 58 m Awake

Any help would be appreciated, please. :)

EDIT: I am not rooted - so I can't use all of BBS :(
[BetterBatteryStats] planetf1:
I see that at least when the screen is active my wlan0 is enabled with multicast

What incantation is used to disable multicast on android (I tried ifconfig wlan0 -multicast but this didn't work)

Any thoughts on how to check if any app is enabling multicast? (since I'd thought default was off when screen blanked)

Any suggestions on how to automate running the required script when the appropriate events occur -- tasker or similar I guess?

I see there is an explicit permission needed for an app to change multicast state "CHANGE_WIFI_MULTICAST_STATE" and on my S4 the following apps have permission to change this

- AllShare ControlShare Service - cannot be disabled, not actively using

- AllShare FileShare Service - cannot be disabled, not actively using

- BandService - no idea

- Camera - needed, presumaly only when sharing

- HP Print Service Plugin - best I could do was disable samsung print service?

- Mobile Print - ditto

- MobilePrintSvc_CUPS - ditto

- MobilePrintSvc_CUPS_Backend - ditto

- Nearby Devices - cannot be disabled, not actively using

- Nearby Service - cannot be disabled, not actively using

- Samsung Link - no idea what this is

- Samsung WatchON - cannot be disabled, not actively using

- ShareSHOTService - no idea

- TMServerApp - no idea, cannot be disabled

- WFDS Print Service Plugin - no idea, hopefully print service being disabled helps

- Wi-Fi Direct Share - dsiabled wifi direct

I also uninstalled CanonEPP (relating to printing) & Cloud Print - just in case

Any well behaved app would only acquire multicast lock for the time period needed.. but perhaps one of these is bad.

Have removed, will reboot and monitor. Packet tracing later.

Any thoughts on how to find out which app (if any) has multicast locks acquired?
[BetterBatteryStats] sshafranko:
Anyone have any hints for me on how to curb this wakelock? All location reporting is turned off in google settings and system settings. Thanks

N900T
[BetterBatteryStats] mag01:
It points to the Google Play Services group of components, and GCM is Google Cloud Messaging in particular which is used as standard push notifications facility at Android.

In order to get rid of it use tool like Autostarts and disable Google Play Services for During Startup, After Startup and Connectivity changed events. Note that if you disable GCM components you will most likely lose the background push notifications/messages functionality for most applications (because they mostly use GCM for that purpose). Thus for example I had to reenable this particular one: com.google.android.gms.gcm.ServiceAutoStarter to restore this functionality back (so I've got disabled them all except for this one).

It causes some overhead, but it's quite minimal so I don't bother with that much.

However if you don't need this functionality at all, simply disable it and these wakeups will disappear.
[BetterBatteryStats] A4ko:
I wish to know that to. On nexus 4 /KitKat it causes partial wakelock too, big time.
[BetterBatteryStats] testrider:
are you saying that even though Greenify can hibernate system app but hibernating Google Play won't work until we convert it to user app first?

Thanks.
[BetterBatteryStats] itsLYNDZ:
Anything for mine? I know poor signal is eating my battery right now, but is there anything else? I am having issues Greenify-ing Google Service Framework and am afraid that might be a problem. Im running Android 4.3 and cant make that into a user app in Titanium backup. It just wont let me. Greenify donation always shows it as "pending" and never automatically hibernates it. I have certain GSF items in Autostarts set as not to run on startup. Are there any others I should disable on startup? Thanks!

In the Greenify donation app on Android 4.3 it no longer shows Google Service Framework. Even tho it is a system app. It shows other Google processes tho..I dont know why this is...
[BetterBatteryStats] xdp:
How are you seeing wakelocks on a Nexus 5? Since BBS doesn't work on KitKat.
[BetterBatteryStats] mag01:
As for AudioMix wakelock, have a look here http://xdaforums.com/showthread.php?t=2520406 - some people report success with disabling all sorts of unnecessary sounds, if that doesn't help it may be also related to the voice search feature called Hotword Detection. I've got them all disabled and this wakelock is very low at my list, often not even noticeable.

As for BBS at KitKat, it's been extensively discussed here, 1.15 betas do work, however you need a rooted device.
[BetterBatteryStats] A4ko:
Yep, 1.15RC2 works fine. Hotword Detection already disabled in Google Settings-Search-Voice.
[BetterBatteryStats] chamonix:
Unfortunately the logcat does not show the installation process as a system app. Could you please repeat and check logcat for "SystemAppInstaller"?
[BetterBatteryStats] chamonix:
I you have converted BBS to a system app with Titanium I strongly recommend that you revert it back and use the procedure from BBS (on previosu versions system apps were in /system/app and since kitkat in /system/priv-app and I don't know where Titanium copies the APKs)

The logfile shows:

11-18 20:04:14.858 I/SystemAppInstaller(19819): Command returned /system/priv-app/com.asksven.betterbatterystats*: No such file or directory
11-18 20:04:14.858 I/SystemAppInstaller(19819): Checking if system is mounted rw
11-18 20:04:15.038 I/SystemAppInstaller(19819): Remount system rw
11-18 20:04:15.118 I/SystemAppInstaller(19819): Checking if system is mounted rw
11-18 20:04:15.168 I/SystemAppInstaller(19819): Mount status: su-mksh: <stdin>[260]: awk: not found
11-18 20:04:15.168 I/SystemAppInstaller(19819): Checking if system is mounted rw
11-18 20:04:15.238 I/SystemAppInstaller(19819): Mount status: su-mksh: <stdin>[308]: awk: not found
11-18 20:04:15.238 I/SystemAppInstaller(19819): Status: An error occured mounting system rw. Aborted
11-18 20:04:15.238 I/SystemAppInstaller(19819): Checking if com.asksven.betterbatterystats is a system app
11-18 20:04:15.288 I/SystemAppInstaller(19819): Command returned /system/priv-app/com.asksven.betterbatterystats*: No such file or directory
11-18 20:04:15.298 I/SystemAppInstaller(19819): Checking if com.asksven.betterbatterystats is a system app
11-18 20:04:15.348 I/SystemAppInstaller(19819): Command returned /system/priv-app/com.asksven.betterbatterystats*:

So the problem is I should not assume that busybox is installed. I will change the procedure to get rid of that dependency.

I still have some research to do based on other reports but will post an update with a fix.
[BetterBatteryStats] alexkno:
One question: I have rc1 installed as user app on KitKat and it works like a charm. I'm on an N4 running slimrom (aosp based). With rc2 you mention that it needs to be a system app on KitKat to work. What is the drawback when running with root on as user app on KitKat?

Or does it only work as the kernel is still partially build on 4.3 until 4.4 kernel source is published? At least selinux state is reported as strict and older BBS versions couldn't start services
[BetterBatteryStats] Peanuts.:
I've now manually moved BBS into system/priv-app.

Restarted device

Granted root access

It is now recognised as a system app. But still shows the "Failed" dialogue when I select the button. (Not sure if it makes a difference as it's now recognised as a system app)

Please see the screen shot and logcat below.
[BetterBatteryStats] chamonix:
Those logs shows nowting wrong and the APK was deleted properly from system/priv-app. If have added some more logging to RC3 and it will up in a few.

The problem that I have right now is that at reboot android sees two identical APKs in /system/priv-app and /data/app and deletes the second. I don't want that because if you then uninstall the system app (withoug having an update in between) BBS is gone.
[BetterBatteryStats] mag01:
Yes that's right. Alright so now waiting for RC3, then will provide new logs.
[BetterBatteryStats] xReptar:
Can anyone help me figure out whats draining my battery? or at least point me in the right direction?

Heres a log file
[BetterBatteryStats] brunek:
I would say nothing,you had 2 hours screen on time.. Maybe poor wifi drained it a bit more,but all in all stats look good..

posl'o ja to s mob'tela
[BetterBatteryStats] skridovaste:
I'm gonna run an idle log tonight, what should I do? Aeroplane mode on? Pretty noobish question, I know, sorry. Thanks!
[BetterBatteryStats] RovG:
[MENTION=1330150]chamonix[/MENTION], if you have a requirement for busybox, it would be great if you could include a custom busybox within BBS similar to what Titanium Backup does. Rather than depend on the user to install one, which because of compatibility, may cause issues.
[BetterBatteryStats] mag01:
I've done few simple experiments and it seems that it stores its data (or at least part of the data) somewhere else if root features are enabled when compared to standard user mode. Because when I:

- enable root features, connect/disconnect cable to let it store new reference points

- disable root features, again connect/disconnect cable to let it store new reference points

- enable root features again and check what I'm getting

It seems that for example at Other the "Screen On" matches the root mode created reference point, while Awake matches the user mode created reference point. It actually seems that I'm getting even older data for Screen On, and also repeating the above process again (basically just reenable root features back) leads to BBS crash, see the attached system-wide debug logcat output and check time 11-19 00:15:46.203

EDIT: Added logcat-2013-11-19_011412832.txt that demonstrates the changes in "Screen On" values. Started BBS with root features, connected/disconnected cable, refreshed until I got valid values and all reference points were ok, switched off root features, again connected/disconnected cable, refreshed etc..., switched root features back on, got very strange values for "Screen On", like 3h 18m, disconnected/connected cable, refreshed etc, got finally good values again. Well, it seems as there's some miscalculation in this case.

Note that at the beginning of that log file there's another crash - the same stuff again coming from repeated disabling and enabling of root features.
[BetterBatteryStats] artttur:
Please tell me if it's OK,and if possible explain what wakelock is SyncLoopWakeLock and keyguard... Tryed to stop any Sync process,which i have find. When starting to use device,this both give up to 2000 wacklocks.

Regards...
[BetterBatteryStats] Perseus:
Turn off Location Services, Google Sync. If you wish to keep Battery Guru, Switch Location Service to Wireless only and GPS off.

All the things that are ON should be turned off. Also turn off Google Sync.
[BetterBatteryStats] Serotheo:
I am blanketed by WiFi at my school I am within WiFi coverage 80% of the time if not more.

- Supposing that I turn off everything then I should achieve actual sleep time.

I don't see how turning off everything is really a solution cause then I'd be stuck on mobile data, which shouldn't be more efficient then being on WiFi.

These are even more moderately controlled settings than my Nexus 4 - which actually has everything on and sadly achieves the same battery life.
[BetterBatteryStats] Aerowinder:
BetterBatteryStats log or we're guessing.
[BetterBatteryStats] Serotheo:
I have actually posted a BBS log.. its just that he was quoting me - making it appear like I did not post one, but hey I'll reattach it.
[BetterBatteryStats] Sharpeyes:
Hello,

I need help with the google log event wakelock anything else if it is the case.

Dumpfile attached.

Thank you!
[BetterBatteryStats] chamonix:
Well I have decided to get rid of the dependency to 'awk' and do the parsing in Java to avoid that.
[BetterBatteryStats] chamonix:
No airplane mode as this will (I guess) not be representative of your normal phone state
[BetterBatteryStats] exynoss:
Just installed it and lets see
[BetterBatteryStats] Aerowinder:
Thanks.

There is likely a game or app that is running in the background without your knowledge. Use Greenify to make sure it behaves. Could be MX Player.

Disable people details sync in the sync options.
[BetterBatteryStats] jj20042004:
Any improvements to be made?

Hi there,

Long time follower of this thread and now first time poster. Really appreciate the app :)

I've had the Nexus 5 for under a week and am running a custom rom (Cataclysm) along with a custom kernel (franco).

In the past I've used information from one of the posts to control apps by using Autostarts. Back then I was using it on my SGS2.

I know folks are still in process of figuring out what to disable in Autostarts for KitKat 4.4. Are there any updates on what to disable via Autostarts?

I wanted to see if there was anything strange or odd from the dumpfile I have attached.

Theres a lot of Alarms. Specifically an "android.net.ConnectivityService.action.PKT_CNT_Sample_INTERVAL_ELASPED"

wakeup.

I use google hangouts and whatsapp, so I know that theres a lot of wakeups just from using these two apps.

Other alarms that I've noticed are "com.google.android.gms" and "com.google.android.gsf".

Something that I've never quite figured out is the "telephony.data-stall" alarms. I had them on my S2 and I still have them on the Nexus 5. I think it has to something to do w/ my cellphone provider. I live in Taipei, Taiwan (3G/HSPA+ no LTE). Are these alarms something I should be worried about?

BBS has been working fine on 4.4 so far and I haven't seen anything different, other than the changes that has been made which messes up things. For good measure I'll add other logs (they may be irrelevant, but I'll post them anyway.)

Anyways, that's about it. Thanks for taking the time to read and diagnose. You guys do a great job and handle the repetitive questions really well.
[BetterBatteryStats] chamonix:
New RC is up with a fix to system app install.

It costed me a whole day of work but I learned quite a lot. Copying an apk from data/app to /system is not a good idea because the apk will get deleted from data/app. This happens straight awake or at latest after a reboot. The issue here is not that the package manager compares file dates but it compares version numbers. If both are the same then the one from /data/app get deleted.

On the other hand when an apk in a newer version is installed for an apk present in /system the newer one (with the newer version) is loaded.

Now I say apk but I mean package (from the manifest) so there were a few things to take care about:

- provide different packages for system app as the xdaedition does not have the same package name as google play.

- sign the packages with the right keys as the signature of a system app must match the signature of the apk installed afterward.

When you come from RC2 please use BBS to uninstall the system app first and make sure that /system/priv-app (on kitkat) or /system/app (on previous version) does not contain anything named like "com.asksven.betterbatterystats". If something is left use adb shell or root explorer to remove it and reboot.

After you have a clean group install BBS as a system app using RC3 and reboot (again).
[BetterBatteryStats] Aerowinder:
The only issue I see is your touchscreen sounds are enabled. Disable those and the haptic feedback. Everything else looks fine.
[BetterBatteryStats] chamonix:
Thanks for your testing. I have noticed one of the errors while testing (alarms) and fixed it in RC3.

Now about your tests: switching back and forth between root and not root features is something BBS was not designed for and you should not expect any stats to be consistent. The reason is that the references (on kitkat) are not retrieved by the same means. Adding the system-app to the equasion even increases the complexity more. In you want to get consistent results while testing you should reboot your device wafter turning system-app on/off and the same when turing root on off: this may not be a real life scenario but it's the only way to get consistency.

Of course I am awakre of the fact that users could do that and get the same kinds on inconsistencies but that use case is not a primary priority to me right now.

And btw: I now have completely re-written the system app stuff right now as the previous implementation was flawed (even if correct)
[BetterBatteryStats] mag01:
Yes I pretty much expected that in the end as it was quite non-standard behavior from me, however please try to look at the following:

- yes people can freely switch root mode on and off, as long as it's technically possible, please try to give them at least some warning about it when switching this mode

- switching the root mode on and off repeatedly (during one BBS run) leads to a crash in the end (see logs in that post http://xdaforums.com/showpost.php?p=47599321&postcount=20679 ), as long as it's technically possible to perform such switching (regardless of whether it's formally valid action), it would be good to fix the crasher.

EDIT: Well, the crash seems to be fixed in RC3, good.

Now going to play with RC3