yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] curiousrom:
Galaxy S5 G900M LineageOS 18.1 klte - BBS 3.0-beta-1-423

Galaxy S5 G900M LineageOS 18.1 klte build 2022-05-15 + MindTheGapps + Magisk 23.0 + TWRP 3.6.1_9-0 testing BBS 3.0-beta-1-423.

No network data. - Had that issue also with previous versions 2.6-382 (99), 2.6-378 (99), etc.

As seen in the screenshots GSam > Phone radio shows data uploaded & downloaded but GSam > App usage > View network data also says "No data available".

Attached BBS shared dmesg (failed with "Bad system call") , BetterBatteryStats dump & BBS logcat + a full logcat captured with DiamondJohn's TeMeFI.

No arrows in black theme - When switching from white to black theme the down arrows hinting the drop down menu disappears. (screenshots)

No Graphs option in 3-dots menu- Not a biggie but was this removed on purpose or just an oversight?

***

BTW BIG thanks for supporting BBS all these years. :cool: 👍

***
[BetterBatteryStats] Tomo123:
Just to mention, on ArrowOS 11, no issues whatsoever. Everything works. Big hug from me!

P.S. manually selectable dark theme would be nice ( not depending on system ), but no priority.
[BetterBatteryStats] chamonix:
Thanks for the confirmation. Does the toggle of the theme in advanced settings not work for you?
[BetterBatteryStats] Tomo123:
Toggle works, but I don't see the option for dark theme anywhere. That's the reason I mentioned a selectable dark theme.

My system default theme is light, so selecting either gives me... well, light theme :)
[BetterBatteryStats] seepranavg:
I have BBS app running on Redmi k20 in android 12 based custom rom (rooted with magisk). When I open the app, I'm getting this screen with Fallback to Since Boot' showing at the lower screen along with the red highlighted line. Can someone say whats wrong with this?
[BetterBatteryStats] asripath:
Did you update to the latest beta available in post#2?
[BetterBatteryStats] sconebranch:
I don't know about OP, but I'm getting "Private APIs not granted" with 3.0-beta-1-426. Does it matter?
[BetterBatteryStats] chamonix:
426 should be fine. Have you executed the adb command from the permissions dialog? If not, have you granted BBS root so that the command can be applied automatically?
[BetterBatteryStats] chamonix:
My bad, logic error: there should be 3 options. Will be fixed in the next build
[BetterBatteryStats] sconebranch:
Yes, I think it needed a reboot to become effective.
[BetterBatteryStats] Tomo123:
Things getting solved all up and down this thread. It warms my cockles :)
[BetterBatteryStats] chamonix:
New build is up fixing:

- missing graphs

- theming with 3 choices
[BetterBatteryStats] Tomo123:
Suck beauty to behold! Thank you for one of the MOST USEFUL apps ever created.

A suggestion, if you may, for some future times... adding a PID number to the apps. Or a possibility to have a list of running processes, sortable by UID or PID. Very useful if you want to check out logcat issues while the app is running.

Just throwing ideas around, mind you. Don't take me seriously on that one :)
[BetterBatteryStats] ToothlessXD:
Enabling active monitoring is crashed the app. Crash log that my custom rom given Crash log. Using Redme Note 10 pro with crdroid Android 12L Rom. After crash, app refused to open again unless i erase the app data. Used latest Version 3.0-beta-1-432.
[BetterBatteryStats] 4nthe:
Hi guys,

First of all, I would like to thank you for the great app! It has been very helpful for years.

I am currently using a OnePlus 9 pro with crdroid 8.6 (a12) and microg. Unfortunately, the phone never goes into deep sleep and i have a battery drain of between 2% and 5% per hour overnight. i've already tried to analyse the consumption with BBS and gsam, but i can't figure it out. two things struck me:

1) the kernel wakelock "dumpstate_wakelock" has a value of 100%.

2) also the sensor "sns_smd" seems to be active all the time.

Unfortunately, i can't find any helpful information about the wakelock and the ("significant motion"?) sensor. of course, i've already tried disabling all functions that might have to do with the sensor, like the pocket detection, but nothing fixed the issue.

Maybe I'm on the wrong track and the problem lies somewhere else? I would be very grateful for your help.

4nthe

PS: i seem to be too stupid to add an attachment, so you can find the dumpfile here.
[BetterBatteryStats] TNSMANI:
@4nthe

You are on A12 on OP 9P which is already troublesome. A12 ROMs including stock seem to have various issues. To my knowledge, kernel wakelocks can't be wished away. You have to flash another kernel or ROM which has no/lesser issues.

The phone was awake (screenoff) almost the entire time.

You have mobile signal issues. It normally consumes a lot of battery. And you seem to have disabled wifi so that all background uploads/downloads happened on mobile data. This coupled with the signal issues surely contributed to the drain. Wifi is more efficient drain-wise than mobile data. Please enable your wifi.

Appwidgets updates triggered a lot of alarms. Try and either reduce the number of widgets or the number of times they update.

Regarding sensors, don't you have the option to disable them completely? If available, disable them and take another dump after taking care of the above points too.

Apart from this, I don't find anything else that jumps out.
[BetterBatteryStats] 4nthe:
Thank you very much for your quick feedback! I will take a look at the points you mentioned and upload another dump in the next few days.
[BetterBatteryStats] PeQuEsan:
@chamonix , just to let you know that the "settings put global bla bla bla" adb command doesn't fix STATUS under Android 13 beta, so no stats at all. I've tested last "stable" 2.6-382 and also last 3.0 beta. Same thing:

STATUS: Failed: Transaction failed on small parcel; remote process probably died, but this could also be cause by running out of binder buffe

bye!

EDIT: not rooted, so I'll wait patiently till you get there, then to A13...
[BetterBatteryStats] djpohly:
I've made a Magisk module which selectively grants the Private APIs permission for BBS. If you are getting "No stats have been collected yet" but are security-minded and don't want to run a command that grants every app on your phone access to hidden APIs, you can try this instead. Note that the module creates its overlay when you install it, so if you reinstall BBS, install the module again afterward.

GitHub - djpohly/magisk-bbs-hidden-apis: BetterBatteryStats hidden API helper [Q]

BetterBatteryStats hidden API helper [Q]. Contribute to djpohly/magisk-bbs-hidden-apis development by creating an account on GitHub.

github.com

If you (or BBS) have already run the settings put command, the undo button is

settings delete global hidden_api_policy

Technical details: there is a whitelist for hidden APIs in /etc/sysconfig which allows system apps to bypass the blocking in Android Q+. The module simply systemizes the installed BBS and adds a whitelist entry for it.
[BetterBatteryStats] 4nthe:
Here is a fresh dump. Unfortunately the stats have not improved.

I left the wifi enabled overnight this time and removed some widgets.

In addition, I disabled all sensors (if anyone is looking for the function: tap "quick settings developer tiles" in the developer options and toggle on the "sensors off" switch. Then you have a new tile called "sensors off."). The sensors are actually off, for example the phone does not detect that it has been turned or when the brightness changes. What is strange though: this setting does not affect the BBS sensor stats.

Any ideas? Thanks a lot for helping!
[BetterBatteryStats] chamonix:
To me it looks like your telefony subsystem (not in Userland) keeps your phone awake. I read this from the kernel wakelock that has 7 hours out of 8. Since the wakelock has a high number (1700+) it would be interesting to know:

do you have gps and wifi off? this could trigger a high number of triangulations to track location. Are you in a bad reception area or have roaming on that could cause you phone flapping between towers? Is LTE or 5G available that could cause this flapping.
[BetterBatteryStats] 4nthe:
Thanks for the reply. I have gps off and wifi on (like TNSMANI recommended). I live in a big city and don't use roaming. LTE is available, 5G is not included in my tarif. The signal in my flat is not good, but the problems also exist outside the flat.
[BetterBatteryStats] TNSMANI:
As pointed out by the developer chamonix, your mobile signal is patchy. I also said the same earlier. Now after you switched on wifi, I also see that it is not ok either. There is constant switching between wifi and mobile data which will drain battery. Try this: switch off your wifi router for a couple of minutes and then switch it on. If any other devices, especially printers, connect to it, disconnect them. This is for the next dump. May be also locate the phone where you get the best possible mobile signal while taking the next dump.

Apart from that, as I said earlier, you may have to switch ROMs or atleast the kernel. I don't know why the sensors are behaving this way or BBS is reading them this way.

The appwidget updates have now stopped.
[BetterBatteryStats] Tomo123:
Don't know about you, but I am laughing my a$$ off.

I guess he needs to put the phone near the toilet window.
[BetterBatteryStats] DiamondJohn:
I was thinking of PM'ing @TNSMANI on the exact same mis-read. But I thought it was too childish.... ;)
[BetterBatteryStats] Tomo123:
Never a bad time for a good toilet joke LOLOL!

@chamonix I updated my log file, because it seems BBS is rather chatty and frequently causes System.out/android.os.RemoteException logcat messages. Just wanted to ask if this is expected behaviour?
[BetterBatteryStats] chamonix:
Just an idea: there is developer setting to turn off the radio (rilj) when wifi is connected

. I would not recommend this under normal use but it could help proving the point that the combo radio / mobile network is the issue.
[BetterBatteryStats] chamonix:
Logging is a feature and logcat is almost without overhead. If there is calls tack though (exception) I am interesting in seing these so that I can check what is wrong at runtime
[BetterBatteryStats] chamonix:
I will enroll my 6 pro to the beta and start working on A13 today
[BetterBatteryStats] PeQuEsan:
Great! Anything you want to test just tell me. I'm a bbs fan for many years.
[BetterBatteryStats] chamonix:
Those are debug logs to inspect the methods of an object. I have removed the log entries unless you tick the debug logging in the app since these are non telling for normal use but may come-in handy when google tries to prevent reflection access to their "private" apis
[BetterBatteryStats] chamonix:
beta-1-435 is up, fixing the crash when enabling the watchdog feature. Next build will be beta-2
[BetterBatteryStats] chamonix:
Sorry for the release bomb: I merged a few contributions to translations
[BetterBatteryStats] shaggyskunk:
@chamonix Thanks for the Updates! 🙇🏼‍♂️🕊️
[BetterBatteryStats] xn0live:
where is link?

does ot work on a12?
[BetterBatteryStats] asripath:
See Post#2 for test builds
[BetterBatteryStats] customuzer:
Hey chamonix,

the graphs for WLAN, charge, GPS and Bluetooth are not displayed at all although they are partially in use. Is it perhaps due to a lack of permissions?
[BetterBatteryStats] xn0live:
my phone do not go do deep sleep more i think that is the problem, anyone know how to fixed?

Sensors

==========

(Telefondienste): Sensor: sar_detector Wakeup(12), wakeup=true, Time: 2 h 43 m 17 s

Sensor: sar_detector_1 Wakeup(27), wakeup=true, Time: 2 h 43 m 17 s

(Android-System): Sensor: sns_smd Wakeup(10), wakeup=true, Time: 1 h 16 m 11 s

Sensor: rohm_bu27030 Ambient Light Sensor Non-wakeup(36), wakeup=false, Time: 38 m 38 s

Sensor: device_orient Wakeup(40), wakeup=true, Time: 1 h 8 m 27 s

Sensor: Touch Sensor(45), wakeup=false, Time: 2 s
[BetterBatteryStats] TNSMANI:
I am on 3.0-beta-1-440 with OOS 11 on OnePlus 9 Pro and I can confirm this behaviour.
[BetterBatteryStats] One Twelve:
Thanks for the update. kernel wakelocks and sensors now display. However the the CPU states section is blank.

Running 3.0-beta-1-440 on stock Samsung S20FE

EDIT: unable to attach the log. Pastebin

here
[BetterBatteryStats] Tomo123:
Poco X3 Pro, Arrow OS 11, same here.
[BetterBatteryStats] 4nthe:
Unfortunately I haven't had a chance to create a new dump yet. But I have now decided to try another ROM anyway, instead of continuing to search for the problem.

Many thanks for your help, this is really a great thread and a awesome community.
[BetterBatteryStats] mangoman:
im trying Version 3.0-beta-1-438 (100 on moto edge 30 pro\android 12.

the adb commands, (with xda..) does not seem to stick and getting "fallback to since boot"

anyone else?
[BetterBatteryStats] TNSMANI:
Why not try version 440 which is the latest?
[BetterBatteryStats] chamonix:
New version is up with language improvements and fixed, courtesy to @Eleo

Next on the list: graphs and Android 13
[BetterBatteryStats] shaggyskunk:
Thanks @chamonix & @Eleo 🙇🏼‍♂️ 👍🕊️
[BetterBatteryStats] shaggyskunk:
Thanks for the update to BBS! 😇🕊️
[BetterBatteryStats] customuzer:
The icons of the listed apps are not displayed in the app. So it is not possible to access the app settings directly from the app.
[BetterBatteryStats] shaggyskunk:
If you Select Processes - You will see the app Icons.
[BetterBatteryStats] chamonix:
I did some debugging today trying to find out what prevents BBS to work on Android 13.

The behaviour is very weird: retrieving the data from the batterystats services crashes when trying to access the cpu stats as if this part was broken in android. This may because of some change in the permissions to access kernel files but I could not find any permission issues related.

Has anyone read of similar issues with other apps on Android 13?

Edit: added the callstack showing where the crash happens, in "readFreqs". Unfortunately the source code running on my phone does not seem to have been published on android.googlesource.com.
[BetterBatteryStats] customuzer:
But the icons should also be displayed in partial wakelocks, right? It is only displayed by some but not all apps
[BetterBatteryStats] chamonix:
You will see them displayed for each wakelock where a package could be identified, and not when there is a number instead of the package. Will look into what may have changed / causes the packages not to resolve
[BetterBatteryStats] chamonix:
The problem is that this wakelock masks anything else and it's hard to tell if other wakelocks are cause or consequence. Please repost a dump once the rx_wakes were fixed
[BetterBatteryStats] madLyfe:
so whats the best way to go about getting a good read on my battery performance? charge it all the way up to 100%, then unplug(while the setting in app is set to report from when unplugged?) and set phone down for a few hours and export a log?
[BetterBatteryStats] cdmackay:
Exactly.

Well, doesn't need to be 100%, just enough to sustain a few hours on battery.
[BetterBatteryStats] jeremysherriff:
I have this issue some times, but i have no idea how to make a log for you.

Also, I never had this issue on 1.4 or 1.5, has the logic changed?
[BetterBatteryStats] Braneless:
Wifi run time is not displaying in 'Other' after today's update. I've rebooted, but still no dice.
[BetterBatteryStats] Register_:
Thanks, how much time should I wait before making the dump.

I'm going crazy, i've got actually a 225mA drain... no net connection, screen luminosity at the min.

Edit: since I had to use the phone for app testing this morning I attach new dmp
[BetterBatteryStats] nixie2121:
can someone take a look at this please? I charged then left alone for about 3 hours with wifi on. then put in airplane mode for the night and woke up at 83%!!! the night used to take 2% with airplane mode so something is wrong. titanium backup always ran at night...

anything stand out???

thanks so much!
[BetterBatteryStats] chamonix:
Prior to 1.6 there were no refs 'since..... ' for kernel wakelocks/alarms.

If you don't know how to use logcat the easiest way would be to download CommandCenter (play), to charge you phone fully, disconnect from charger and use CommandCenter to write a logcat file.
[BetterBatteryStats] chamonix:
First make sure that you have a red 'since unplugged' by plugging/unplugging since reboot deletes the refs. Then turn on wifi as there is no reporting for '0' values. If is still does not show please provide a logcat
[BetterBatteryStats] chamonix:
This reading shows 5 hours on screen from 6 hours awake. Are those 225 mA/h while using your phone? If yes and you feel it's too high stop using your phone ;)
[BetterBatteryStats] chamonix:
I see deleted_wake_locks (kernel) : and quite some wakeups due to email
[BetterBatteryStats] nixie2121:
thanks.. email is set to push.. maybe I should turn it off at night.. what is the other one
[BetterBatteryStats] Register_:
Depends on what you call "using" if it's starring at the Battery Monitor Widget, yes i'm using it :p

Sometimes "the starring" is draining less 45mA or 12mA. Even less if I just had been recharging it, it's 2mA.

Until I use an app connected to the wifi, after that it stay at ~100 or 200 or 300 after closing the app and the WIFI connection . And this even when i'm not starring at it (display off) > Just checked the battery usage and yes it's draining in sleep mode. :(

Thanks for your help.
[BetterBatteryStats] sp8y:
I've tried that & still don't see the "wifi running" stat in the "other" list. I'm running froyo on my rooted Defy but it also doesn't show up in my sons non rooted Atrix on gingerbread.

Here's a few errors I found for BBS in logcat but don't know if it's of any help to you.
[BetterBatteryStats] shadow3352:
I disabled JuiceDefender because it was giving me a ton of wakelocks, and now I'm not really sure what else to change. I'd appreciate it if someone took a look at the dump file.
[BetterBatteryStats] cdmackay:
The kernel wakelock "sec-battery-adc" looks to be a huge contender... no idea what that is though. If you're on a Custom ROM/kernel, time to take it up in the relevant thread?

See: http://xdaforums.com/showthread.php?t=1475739
[BetterBatteryStats] shadow3352:
Yeah, I can't seem to find anything about it other than that some other people have had the same issue.
[BetterBatteryStats] jeremysherriff:
You have Google's backup thing running, it woke your phone almost 1800 times:

*backup* (Android System): 17 s (17 s) Count:1796 0.1%

Turn it off :)

On the kernel side, as previously mentioned by @cdmackay there is the sec-battery-adc wakelock - dunno what that is. But you also have these:

"wlan_rx_wake" (): 38 m 8 s (2288 s) Cnt:(c/wc/ec)3762/0/3762 7.3%
"wlan_wake" (): 29 m 16 s (1756 s) Cnt:(c/wc/ec)9968/3202/0 5.6%
"sec-battery-monitor" (): 3 m 41 s (221 s) Cnt:(c/wc/ec)6622/49/0 0.7%

- switch you wifi sleep policy to "when screen off", or at least "never when plugged in". The sec-battery-monitor looks like it links with sec-battery-adc and might be the kernel querying the battery interface for health/charge levels - try a simple reboot? Something may have simply malfunctioned. You may find you need to reboot after each time you unplug the charger..

AlarmManager, alarms, and alarm_rtc all point to the Alarms section of the dump, no real stand-outs here but the maps/locaton services show up in different ways. Is your maps application updated to the latest? Google had several battery-drain related issues with the last few updates so getting the most up-to-date version will be important.
[BetterBatteryStats] madLyfe:
i have a couple battery logs here. the first one i charged the phone to 100% and then took it off the charger and let it sit for a few hours. the second one was still on the same charge but taken later in the day at around 6% left after some normal use plus another 4-5 hours of down time. im not really sure what im looking for here and was wondering if one of you guys could take a look at them for me?

thanks
[BetterBatteryStats] One Twelve:
BetterBatteryStats version: 3.0-beta-2-451

Even on the latest beta CPU states still shows up as blank

What more information do i need to provide to fix this ?
[BetterBatteryStats] Tomo123:
Sadly, graphs still not working for me ( latest 454 ). I had Wifi & Bluetooth on.
[BetterBatteryStats] chamonix:
What target SDK / Android version are you running. Google keeps messing-up the constants so I may need to add a rule or two
[BetterBatteryStats] chamonix:
Unfortunately it is a known issue that on Samsung devices the android subsystem is not allowed to access the kernel cpu stats
[BetterBatteryStats] Tomo123:
Arrow OS 11.
[BetterBatteryStats] chamonix:
Fix for graphs (Wifi on Android 11+) and missing package icons (android 11+)
[BetterBatteryStats] customuzer:
Thanks a lot @chamonix , now the icons in the lists are shown more accurately.

Ps: finde es sehr gut, dass so fleißig geupdated wird. Wann und wo würde man es dann offiziell runterladen können?
[BetterBatteryStats] chamonix:
I am planning to re-release to Google play soon
[BetterBatteryStats] customuzer:
The graph for loading shows at a point that loading has taken place where there was no loading process. If you look at the top graph of this, you can see that there was a steady battery consumption.
[BetterBatteryStats] One Twelve:
An earlier version (BetterBatteryStats version: 2.6-382) shows CPU states working on A12 with a S21 if you see this

post

However on my S20FE using 382 I don't get CPU states showing up. So it appears specific to S20FE
[BetterBatteryStats] Tomo123:
Latest 461 - icons work, graph works, but when taking complete log dump, dmesg log has an error ( ArrowOS, Android 11 ). Dmesg log attached.

EDIT: Added dmesg tombstone, if it helps.
[BetterBatteryStats] chamonix:
Seems dmesg requires root these days...... I have fixed it by running "su -c dmesg" but of course it will only work if rooted on current android version
[BetterBatteryStats] shaggyskunk:
Thanks for the update to BBS 🙇🏼‍♂️
[BetterBatteryStats] Tomo123:
Just tried the latest version with fixed dmesg. Sadly, it outputs an empty txt file.

Tried myself in Termux.

Without root shell in Termux:

$ su -c dmesg > /storage/emulated/0/dmesg.txt

... gives out an empty txt file.

With root shell in Termux ( entered su before dmesg output command ):

dmesg > /storage/emulated/0/dmesg.txt

... gives out a proper dmesg txt file.

Seems that the su -c causes an issue...
[BetterBatteryStats] chamonix:
Interesting. I indeed just tested it by hand in the shell....my bad! Fix is tested and building as I write
[BetterBatteryStats] Tomo123:
Tested, confirmed working. Many thanks!
[BetterBatteryStats] DiamondJohn:
This surprised me, as I have an app that basically runs hundreds of different shell commands. I have 2 specific calls to dmesg

su -c dmesg;

and

su -c dmesg | grep "processing action";

NB: Thats a little different to the above, but also two parts to the command

Both these actions were created back about mid 2018, which would of been a previous version of Magisk. I would of tested them back then when I created them, and confirmed they were working. I just tested them in the app now, and the second one fails, but the first works. I am running the latest STABLE version of Magisk v24.3, and always have only ran stable.

I just tested in a shell (ie outside the app), and the exact same behavior. ie the 1st worked and the 2nd failed. NB: recently I had a case where something worked in my app, but failed within a standard root shell🙃I cant remember what it was, but I could not explain it.

So I tried an adjustment to the one that didn't work for others (in a non root shell over ADB) to su -c "dmesg > /sdcard/test.txt"; and THAT WORKED!

At least to me, this is a bug in su, as I am pretty sure it used to work in a previous version of Magisk, and Im pretty sure its how it is "suppose" to work. ie I dont think its so much of a "my bad" ;)
[BetterBatteryStats] Tomo123:
Just for info, this was done on Magisk 25.1.
[BetterBatteryStats] Tomo123:
A quick question... when does the "charging" graph activate?

Charged the phone last night, yet the graph is empty. Does the "Enable while charging" option have to be activated?