yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] brandall:
Really appreciate this nobnut, would thank you twice if I could. You're flagging up an issue that I had concerns about, where tasks are failing due to data not being populated correctly. The boot task is failing and then having a knock on effect for the others. If I was coding this I could check initial runs etc, but this is not in the Tasker armoury, so currently thinking how I can correct this...

Here are the contents of my files:

DSD-Shutdown.txt

07.38
791
%DISPOFFT
6-28-11
5148
07.53
838
%DISPOFFT
6-28-11
3672
07.53
878
%DISPOFFT
6-28-11
3816
08.20
1605
%DISPOFFT
6-28-11
14256

This shows me that %DISPOFF is not populating which will cause a data failure and prevent the task from clearing the file. The data from the next shutdown is then being appended on the end, making the boot file read from the top of the data and fail again....

Can you go into the task DSDShutdown and untick 'append' from the first write file action please and delete the DSD-Shutdown.txt file. Then (if convenient), could you give you device a bit of screen off time, maybe 15 minutes or so, so the variables have a chance to populate. Need to figure out a way for Tasker to spot the data corruption within the file...

The DeepSleepDetective file is working on threasholds at the moment. There is a 10 minute hold on the screen off time - if it wakes up before 10 minutes, I cancel the analysis so you are not continuously getting popups. These can be adjusted and I'll post instruction on how to do this. The text file will only be written if there is a substantial difference between the screen off interval and the deep-sleep time during that interval - I can reduce this if it's not being flagged.

I've attached two new tasks that enable you to get an update of what's going on whenever you like. Set DSDAdhoc as a shortcut on your launcher somewhere and press it whenever you like for an on screen update. This task automatically kicks off the other task DSDAhMaths. The usual SuperUser permissions needed. These tasks are beasts...

Again, really do appreciate your feedback
[Android Apps and Games] nobnut:
Will do but have to go into a meeting now. I will report back as soon as possible, probably after lunchtime though - BST.

Cheers, we'll crack this nut sooner or later!
[Android Apps and Games] nobnut:
OK, tested as prescribed. My findings:

Following setup, I rebooted and left the device for 30 minutes. Then rebooted.

No notifications appeared at any stage.

Nothing happens when I clicked on the DSDAdhoc shortcut I created.

When I click on 'Test' for DSDAhMath, I see the information in the thumbnail attached below (this content appears to have much more to do another Tasker profile which identifies my current location #PARKPLATZ... I also see the coordinates of where I was ran I last ran it). Just as well I don't really give two hoots for privacy (mine or anyone else's :p).

Still nothing written to DeepSleepDetective.txt

DSDShutdown.txt contents

14.05
2438
%DISPOFFT
6-28-11
17100

DSD-Uptime.txt contents (Following post test Reboot)

14.05
2438
%DISPOFFT
6-28-11
17100

FYI (The following is speculative and not conclusive) There appears to be some battery drain now. After 30 minutes the battery was showing 98% (it is normally on 100% for up to an hour). On reflection I see that the biggest dip was caused immediately after reboot, which is normal I guess (with data synching etc). Also, if you look at the second screenshot attached, there is a frequent wakeup. I am not sure, as I was getting something similar before, but it seems more regular than occurred previously. Might there be part of the process contributing to this? Like I say, this is far from conclusive.
[Android Apps and Games] brandall:
That is the contents of a 'variable list action' - I use them in testing to make sure variables populate correctly. I can only assume somehow I posted you my test version.... Although I wiped it last night... :confused: I'll upload the proper one! Sorry!!

14.05
2438
%DISPOFFT
6-28-11
17100

Right, we are left with the problem of why your %DSPOFFT is not populating, which is basically the time your screen spent off when your device could have gone into deep sleep.

Is Tasker ticked under accessibility and down as a device administrator? In the Tasker preferences, is 'popup errors/warnings' ticked?

In the task DSDDispOn there is an action to variable set %DISPON to %UPS (I've changed my version so can't remember what action number it used to be!) Directly after that action can you add in another 'Alert, Notify' and in the title put %DISPON -- %DISPOFF. That way we can make sure your screen on/off trigger is working correctly on your device. There is a GoTo action just below it that you'll need to add 1 to, to make sure it still goes to the variable clear action at the end!

Right now, with tasks failing and struggling to do maths with incorrect values, this will be draining the battery more... it won't when it's sorted though! And also it serves you right for having a device that spends an hour at 100%!! ;) My desire drops by 1% if I just look at it...... :mad:

Ok, I'm uploading V3 later, with a few other issues solved - let me know if your notification shows that the times are populating!

Thanks again..
[Android Apps and Games] nobnut:
Oops :o

I have just realised that Popups wasn't selected. Everything else is as it should be. I have corrected this and will repeat the tests.

Will update in 30+ minutes with results.

Thanks
[Android Apps and Games] brandall:
No worries on the popups - they only work next time you open Tasker and really don't tell you enough about the errors! Until we sort out the data corruption, you're bound to get quite a few! Ones I've fixed already are %CPUDSDD not being numeric and a few other similar ones...
[Android Apps and Games] nobnut:
I will edit the DSDDispOn values when I have just finished this test. I have to go into a short meeting now anyway now, so I'll just let it run.
[Android Apps and Games] azj:
Yes I tried the chmod before and after running "su"... same result.
[Android Apps and Games] brandall:
I'm on the case and will come back to you as soon as.
[Android Apps and Games] nobnut:
Houston, we have a problem.

I've been testing like a testic... and either I am doing something wrong, my phone is misbehaving, or there is a (small I hope) problem.

I have installed, wiped and reinstalled DSD a number of times and the short of it is that DeepSleepDetective.txt isn't being overwritten/updated following reboot (without a USB going anywhere near the phone). This has been the case with every attempt I have tried, including the initial install of v8a yesterday afternoon.

Also to get everything installed, I am having to do the following:

1/ Clear everything to start fresh (SU permissions, DSD folder and tasks & profiles).

2/ Run DSDSuperuser and get the three SU requests ok

3/ Run DSDFileSetup

4/ Run DSDSUPOP (both options) and then view the report

If I don't do 3 and 4 the files aren't written, nor written after reboot.

Before reboot, I can see that a DeepSleepDetective.txt is written and includes wakelock count content.

Following reboot, nothing is changed in DeepSleepDetective.txt. This is repeated for subsequent reboots.

Everything else works well and as intended.
[Android Apps and Games] brandall:
Morning Captain!

Thanks for your thoroughness. Are you looking for the detective report to be written on boot? Or are you saying that after some display off time where DSP in prevented, by music playing or something, that it doesn't update thereafter?

Reason I ask, is that on boot, the detective report isn't supposed to be written, just the boot report which will store the 'daily' stats.

Do we have the same expectations here? Sorry if I didn't make it clear what should be updated.

Or are you saying that the detective report refuses to update when DSP is prevented under forced conditions?

Let me know!
[Android Apps and Games] nobnut:
Good day Sir!

Following it being written at the time of installing DSD, I can't get it to change under any circumstances. NOTE - I haven't given it the old Media test yet. I will do that later.

Driving home last night, I had Copilot running (with the screen off for 30 minutes) but the report wasn't changed. Following at least 5 reboots, with screen off time between each, the data in the DeepSleepDetective.txt this morning before I started to uninstall and reinstall was still the same as that which I posted here yesterday, just after 5pm.

Maybe it is a trigger thresholds thing... I will run the Media test later. I need my phone for the next hour or two.

Over and out.
[Android Apps and Games] brandall:
Thank you in advance.

The detective file isn't set to be created on setup - it should only be created once a problem is discovered. Under normal thresholds, that is after a minimum of 10 minutes of display off time, when less than 80% of DSP was reported.

If you delete it, it shouldn't reappear until such time (unless you've changed the thresholds of course). If a report is 'forced' outside of these parameters when no wakelocks were active, the profiles are set to prevent the report so it doesn't fail when trying to dissect data from wlinf.txt which would be empty...

Hope that makes sense?
[Android Apps and Games] nobnut:
Indeed, crystal clear.

I had hoped that I would have triggered it. Sounds like perhaps there is no problem after all.

Best thing to do is ignore me. Move along, nothing to see here.

Until later. Thank you. Bye.

EDIT: Bring on the chickens!
[Android Apps and Games] brandall:
LOL!

I'm going to be incomunicado for most of the day today, but a new version will be completed tonight. It's full of informative notifications which will clarify what is and isn't happening behind the scenes, so I can highlight problems rather than using a generic 'report failed'. There will also be an error log too, which will be requested to be sent via email, so I can see where the profiles are failing for those that aren't as hot on reporting as your good self!

It was supposed to be ready this morning, but I fell asleep and woke up with the phone balancing on my forehead.... Quite clever really... I thought...

Until later! Good luck soldier!
[Android Apps and Games] nobnut:
Clever? That is a latter day miracle. You could be on the radio with that kind of talent!

I will just fanny about cocking things up at this end. But being absolutely genuine now, I am keenly awaiting this new version, sounds extremely interesting.

As for being incommunicado. Whatever works for you. I prefer to wear underpants though.

To the left... QUIIIIIICK MARCH!!
[Android Apps and Games] brandall:
HA! Well a true tester needs to be exposed to the elements to keep his senses alert. I hope none of your immediate colleagues will object...

It's all part of taking your role more seriously post your appraisal....

Just be careful about standing to attention....
[Android Apps and Games] nobnut:
You are indeed a wise man. I see I have much to learn still.

I have to do some work now. It'll be my second bit this week (I sent an email on Tuesday). I need a holiday.

Later!
[Android Apps and Games] chamonix:
BetterBatteryStats

I promised to get back when I had first results and here we go. Those are quite primitive right now (read logcat) but an app to show that will be no big deal. What I have done is I re-coded the part of the battery stats looping through all processes and wakelocks without aggregating any data. Here's the output of the wakelock-loop with STATS_SINCE_CHARGED as parameter

Wakelocks: Process = LocationManagerService wakelock [s] 15
Wakelocks: Process = ActivityManager-Launch wakelock [s] 24
Wakelocks: Process = *network-location* wakelock [s] 8
Wakelocks: Process = GpsLocationProvider wakelock [s] 2
Wakelocks: Process = sleep_broadcast wakelock [s] 4
Wakelocks: Process = AlarmManager wakelock [s] 20
Wakelocks: Process = RILJ wakelock [s] 64
Wakelocks: Process = GTALK_ASYNC_CONN wakelock [s] 17
Wakelocks: Process = *network-location-cell-update* wakelock [s] 3
Wakelocks: Process = GOOGLE_C2DM wakelock [s] 5
Wakelocks: Process = Event Log Service wakelock [s] 2
Wakelocks: Process = GTALK_CONN wakelock [s] 3
Wakelocks: Process = Checkin Service wakelock [s] 3
Wakelocks: Process = NetworkInitiatedService wakelock [s] 12
Wakelocks: Process = *network-location* wakelock [s] 702
Wakelocks: Process = LocationFriendService wakelock [s] 138
Wakelocks: Process = TunnyBrowser wakelock [s] 82
Wakelocks: Process = *sync* wakelock [s] 3
Wakelocks: Process = JuiceDefender.Service wakelock [s] 139
Wakelocks: Process = *network-location* wakelock [s] 2

I'll work a little on wrapper code and on a minimal GUI before making the code of the app and the proxy around the non-public API available.
[Android Apps and Games] nobnut:
Interesting stuff there! Do you see this as something which seeks different objectives to DSD?
[Android Apps and Games] strictlyrude27:
nobnut and brandall -

you guys make me laugh.

that is all.

:)
[Android Apps and Games] nobnut:
Hey brandall, he's laughing at us!

;)

Sent from my Motorola StarTac using Voodoo
[Android Apps and Games] brandall:
Looks like it's coming on well chamonix. Is it theoretically possible within the code you are manipulating to get timestamps of the individual wakelocks during the loop? Also, *network-location* wakelock 702, seems a little excessive if the results are collated SINCE_CHARGED ? Assuming they are correct, how do you explain this count? Does the loop you are running cease and recommence within parameters that you have set? Please keep me posted!
[Android Apps and Games] brandall:
All this testing is sending us a little doolally....

I like to think it was just you ;)

It must take you weeks to set up the signatures for all of your different devices!
[Android Apps and Games] nobnut:
The one that made me chuckle was Juice Defender... causing wake.

On another note, got a parking ticket earlier... nice. I can't pay the fine though as it's against my religion (devout non conformist). I also don't recognise the legal system and therefore shan't be going to court, so it looks like they're clean out of luck.

EDIT: There's nothing wrong with being doolally. It brings with it a liberating feeling, akin to the sensation brought about waking up after a pleasant evening at the opera followed by 17 pints of Special Brew.

Speaking of Sensation... shouldn't be too long before yours turns up Squire.

I'm thinking of changing my username to one of:

NakedStarJumps

JulioInglesias

ItOnlyHurtsWhenIRubIt

I think I will start a poll in the general section.

Goodnight France!

Sent from my HTC Flyer using vodka
[Android Apps and Games] chamonix:
Well I don't know yet, I just joined this thread because I saw your mention in the VR-thread and because I've always been interested in pinning down battery drainers since early XDAndroid times (Android on HTC Touch Pro).

Spare Parts on earlier versions of Android was making an Activity accessible (hidden in settings) so I started looking at the code, then discovered that the batterystats service was not accessible using the API and I decided to change that (I wrote a proxy to the non-public API using Java reflection). Next step is to provide an app with the same kind of functions as the mentioned Activity in an app.

From the wakelock list I would expect to see comparable results even if obtained using different approaches (I understand there are also other aspects reported by DSD but I must admit I haven't looked into those) and if there is something that I could provide to DSD using e.g. the Tasker/Locale API I'd be happy to.

I code for fun (my hobby since I stopped coding for a living) and make my work public under a license allowing free and commercial (re)use.
[Android Apps and Games] waydownsouth:
@brandall, another gem that may help you in your quest :)

dumpsys batteryinfo
[Android Apps and Games] nobnut:
The more of you talented people that join this thread just reminds me of how little I have to offer.

I salute you all.

Sent from my HTC Flyer using vodka
[Android Apps and Games] chamonix:
:) thank you. I was pretty happy when the reeeally uggly reflection code started working.

I'll look into that but from my understanding the wakelocks are stored as Timers / StopwatchTimers and none of those store from/to information.

I assume the value is correct but maybe my understanding of the API not quite yet.

This service seems related to coarse localization and I'm in a place where the network keeps jumping from 3g to H and H+ all the time so it's not excluded that my phone spends a lot of time detecting new locations. I must add to that thatI've had Google Latitude On during the last days even if that should not affect the service itself except if Latitude is generating excessive polling that would be reported on the service.

To sum it up: lots of assumptions, I'll validate the correct use of the API to start with in order to make sure there is nothing getting cumulated.

Basically the code is (supposed to do):

get the uid-stats SINCE_CHARGED
for each uid from the uid-stats
get the wakelocks for that uid
for each wakelock
cumulate time locked
end
write output
end

That code is called on demand from a menu so there is no polling or permanently running process if that's what you meant.

After some testing an looking at the plausibility of the figures I'll keep you posted.
[Android Apps and Games] XlAfbk:
Latitude is indeed creating a lot of location requests and wake locks. My battery life goes down by ~20-30% with Latitude enabled.
[Android Apps and Games] brandall:
LOL! The opera and 17 pints of Special Brew... They are not normally associated activities... Well, not in the conformist world anyway! I'm voting for ItOnlyHurtsWhenIRubIt purely because the acronym is IOHWIRI which is surprisingly easy to remember...

Damn it!!!

Can you narrow down the data to detect the wakelock type?

Thank you, please do and I'd be interested to know if you are concerned with anything other than PARTIAL_WAKE_LOCK and ACQUIRE_CAUSES_WAKEUP..? They are the beasts I'm hunting....

You're pretty damn useful to have around WDS - please keep them coming!! :)

I THINK WE SHOULD SHARE!!! And it's nothing to do with yours being more technical than mine... Honest! ;)

Consider yourself the forefather nobnut - without the foundation of your testing skills the great empire could never have been built.... :eek:

Hi XlAfbk, I may try to call on your assistance at some point to catch their behaviour....
[Android Apps and Games] brandall:
Morning IOHWIRI, there's nothing like starting the day with a huge dump...

Thank you for sharing it with us :eek:

I have actually been working my way down that list, so not old news as such, just news that isn't 'breaking', but still topical ;) The only reason I haven't already included most of the useful information, is because everytime I need to split the data I have to ask WDS for help with the commands and his app release has already been put back 8 years by the amount of time he's already spent educating me!

:guilty face:

Hope the head is ok and full of the sweet sound of Opera - rather than the deathly haze of 17 Special Brews!
[Android Apps and Games] nobnut:
Oh well, it was worth a punt. I'll leave the Masters to get on with doing what they do best.

I had a bash at WDS's 0.8.50 yesterday and was very impressed.

Out of mild curiosity, I just Googled for images with the term 'special brew opera'. I found this. I wish I hadn't bothered now.
[Android Apps and Games] brandall:
Chuckle... I expect to see that imagine in your signature now too :D Still working on V9! It's really taking me ages! Doh!

EDIT: If you want something else to test nobnut - check this It allows the direct populate of Tasker variables from command line - damn useful... Been testing for a while and haven't found any faults with it...
[Android Apps and Games] nobnut:
Thanks for the tip. I'm gonna get my funk on now.

Scaramoosh! Scaramoosh! Will it do the Fandango? EDIT: Don't answer that. I don't even know if I have the 'Fandango' plugin installed :p
[Android Apps and Games] brandall:
It was standard in 2.3.4 ;)

I've just solved a HUGE bug that was throwing the data off :D :D :D Forgot to clear a variable that was saying 'don't record the data'. WHOOP!

Nearly there on V9.... I need some lunch.
[Android Apps and Games] nobnut:
Well done that man. Tell you what, as a treat, go and have some lunch.
[Android Apps and Games] brandall:
I have to hand it to myself, I can still make a mean Pot Noodle when under immense time pressure.

When the going gets tough and all of that...
[Android Apps and Games] nobnut:
Pot Noodle eh? Cornerstone of a good rounded diet, the food of Kings nomnomnom.

Did you use hot water or vodka? I am often more productive when I have thrown a 'Flaming Noodle' down my cakehole.
[Android Apps and Games] chamonix:
Right now I'm going by this code:

// Only care about partial wake locks since full wake locks
// are canceled when the user turns the screen off.
Timer timer = wakelock.getWakeTime(WAKE_TYPE_PARTIAL);
if (timer != null) {
wakelockTime += timer.getTotalTimeLocked(uSecTime, which);
}

But I can easily change it to other types: WAKE_TYPE_FULL, WAKE_TYPE_PARTIAL, WAKE_TYPE_WINDOW are available

As the function already has a parameter for the period of time to query stats I'll add that as a second param (note to myself: add as todo).

I'll upload it to my GIT repo and share the link when I feel comfortable with the code and the level of comments.

+1000000000
[Android Apps and Games] brandall:
// Only care about partial wake locks since full wake locks
// are canceled when the user turns the screen off.

This comment is good to read, but it also suggests that the code isn't set to read partial wakelocks (PWL) ONLY when the screen is off. Now forgive my ignorance, but I had previously assumed that a PWL would only ever be registered at display off, as this would be when it would be needed - but the stats that were reported as well as the comment above leads me to believe they PWL's are registered with every process that may require it IF the screen goes off. So if 90% of the PWLs occur when the display is on, then the total count is actually not a good assumption of what has been preventing the device from sleeping??

Do you concur, or was I right in the first place?!?

(timer != null)

What does that mean by the time being null...?

No need for me thanks - but ACQUIRE_CAUSES_WAKEUP would be a diamond...! Knowing that your code is not constantly looping, I can't see how you could pick these up.... :(

:) Beware... I may have 10,000 questions for you!

I have a confession to make... I'm actually allergic to Pot Noodles... I emptied the lot down the sink and just had a pot of vodka... :eek: