Delayed tasks - by Android, I think

205 views
Skip to first unread message

Scott Miller

unread,
Jan 12, 2016, 6:49:10 PM1/12/16
to Tasker
I've been trying to figure out a problem that I've been seeing for a few months. I have quite a few profiles, and most seem to work just fine. In fact, they all work fine, but I have one that doesn't launch when I expect it to. Or at least it seems that way. I was wondering if anyone might have an idea why this might be, or better yet, a proper solution. But I'm not counting on that.

I have one profile that I use when I get in my car. It is activated by two contexts; one is Power Any, and the other is a Variable Set. This profile used to go active very quickly when I would get in the car. I used to have a separate profile that was triggered by an NFC tag, and all it would do was set the variable. I have the phone plugged in, so that is the other context.

I don't use an NFC tag in the car now. I was starting the same task by tapping a Tasker shortcut on my homescreen, but more recently change to using Bluetooth Near. Again, all this does is launch a task that sets a variable.

The problem is that now it takes as long as 10 minutes for my car profile to activate and run. Or it seems that way, at least. When I check the Tasker run log, the profile launched and ran the task exactly when it was supposed to run. Exactly. To the minute. Every action step. But I didn't see anything happen. It's like the tasks got stuck in a queue or something, and won't complete until something else gets out of the way. The actions in the task do eventually run correctly, just with a very long delay.

I can't say when this began. My phone is a Nexus 6 with Android 6.0.1, with patch level December 1, 2015. When I bought the phone, it had Android 6.0. It is possible this began after the update to the December patch level, but I'm not sure. That's about as close as I can guess.

I'm hoping someone might have an idea why this is happening, and could provide a suggestion about how to resolve it. Or at least make it more tolerable. Maybe I just need a reboot, since it hasn't done that in almost 27 days. That's by far the longest I have ever run my phone without a reboot.

Thanks for any ideas.

Scott M.

Wayne Longford

unread,
Jan 12, 2016, 7:32:14 PM1/12/16
to Tasker
Can you provide a copy of the run log?

When in the run log go to Menu / External Viewer then you can copy paste it here.

Scott Miller

unread,
Jan 12, 2016, 8:06:27 PM1/12/16
to tas...@googlegroups.com

I can, but it will show that the task runs on time. The only thing mildly of interest is the start and stop of the task service, several times, AFTER all of the steps have been run.

In the log, the profile goes active shortly after I get in my car, at 17:11:59. The enter task completes less than a minute later, at 17:12:46. It was at least 17:15 before the actions do anything, based on what I actually see happening on my phone. The profile becomes inactive when I leave the car at about 17:30.

Again, I am pretty sure this is not a Tasker problem, since Tasker thinks everything ran correctly.

20160112 17.11.59 P Active   ID102    BT Car Mode On
20160112 17.11.59 E Start    ID0:0.0  TaskService
20160112 17.11.59 T Running  ID95     Turn On Car Mode
20160112 17.11.59 A OK       ID95.1   Turn On Car Mode.Var Set, %Carmode=On
20160112 17.11.59 A OK       ID95.2   Turn On Car Mode.Bluetooth
20160112 17.11.59 T ExitOK   ID95     Turn On Car Mode
20160112 17.11.59 P Active   ID62     Car Docked
20160112 17.11.59 P Active   ID94     CarModeOn
20160112 17.11.59 E Stop     ID0:0.0  TaskService
20160112 17.11.59 E Start    ID0:0.0  TaskService
20160112 17.11.59 T Running  ID12     Car Docked Enter
20160112 17.11.59 T Running  ID30:2   Car Mode On
20160112 17.11.59 A OK       ID12.1   Car Docked Enter.Var Set, %CARDOCKED=1
20160112 17.11.59 A OK       ID12.2   Car Docked Enter.Bluetooth
20160112 17.12.00 A OK       ID12.3   Car Docked Enter.Auto Brightness
20160112 17.12.00 A OK       ID12.4   Car Docked Enter.WiFi Net
20160112 17.12.00 A OK       ID12.5   Car Docked Enter.WiFi
20160112 17.12.00 A OK       ID12.6   Car Docked Enter.Launch App
20160112 17.12.00 A OK       ID12.7   Car Docked Enter.If
20160112 17.12.00 A OK       ID12.11  Car Docked Enter.Media Volume
20160112 17.12.00 A OK       ID12.12  Car Docked Enter.Notification Volume
20160112 17.12.00 A OK       ID12.13  Car Docked Enter.Ringer Volume
20160112 17.12.00 A OK       ID12.14  Car Docked Enter.In-Call Volume
20160112 17.12.00 A IfFail   ID30:2.1 Car Mode On.Car Mode
20160112 17.12.00 T ExitOK   ID30:2   Car Mode On
20160112 17.12.15 A OK       ID12.15  Car Docked Enter.Wait
20160112 17.12.15 A OK       ID12.16  Car Docked Enter.Bluetooth Auto Connect
20160112 17.12.31 A OK       ID12.17  Car Docked Enter.Wait
20160112 17.12.31 A OK       ID12.18  Car Docked Enter.Bluetooth Auto Connect
20160112 17.12.46 A OK       ID12.19  Car Docked Enter.Wait
20160112 17.12.46 A OK       ID12.20  Car Docked Enter.Bluetooth Auto Connect
20160112 17.12.46 A OK       ID12.21  Car Docked Enter.BT Voice Volume
20160112 17.12.46 T ExitOK   ID12     Car Docked Enter
20160112 17.12.47 E Stop     ID0:0.0  TaskService
20160112 17.15.48 E Start    ID0:0.0  TaskService
20160112 17.15.48 E Stop     ID0:0.0  TaskService
20160112 17.16.39 E Start    ID0:0.0  TaskService
20160112 17.16.39 E Stop     ID0:0.0  TaskService
20160112 17.17.08 E Start    ID0:0.0  TaskService
20160112 17.17.08 E Stop     ID0:0.0  TaskService
20160112 17.17.12 P Instant  ID105    Focus Waze
20160112 17.17.12 E Start    ID0:0.0  TaskService
20160112 17.17.12 T Running  ID106    Focus Waze Enter
20160112 17.17.42 A OK       ID106.1  Focus Waze Enter.Wait
20160112 17.17.42 A OK       ID106.2  Focus Waze Enter.Launch App
20160112 17.17.42 T ExitOK   ID106    Focus Waze Enter
20160112 17.17.42 E Stop     ID0:0.0  TaskService
20160112 17.18.00 E Start    ID0:0.0  TaskService
20160112 17.18.00 E Stop     ID0:0.0  TaskService
20160112 17.20.41 P Inactive ID102    BT Car Mode On
20160112 17.30.52 P Inactive ID62     Car Docked
20160112 17.30.52 E Start    ID0:0.0  TaskService
20160112 17.30.52 T Running  ID-6142  System
20160112 17.30.52 T Running  ID15:2   Car Docked Exit
20160112 17.30.52 A OK       ID-6142.1 Anon.In-Call Volume
20160112 17.30.52 A OK       ID-6142.2 Anon.WiFi
20160112 17.30.53 A OK       ID-6142.3 Anon.Ringer Volume
20160112 17.30.53 A OK       ID-6142.4 Anon.BT Voice Volume
20160112 17.30.53 A OK       ID-6142.5 Anon.Notification Volume
20160112 17.30.53 A OK       ID-6142.6 Anon.Media Volume
20160112 17.30.53 T ExitOK   ID-6142  System
20160112 17.30.53 A OK       ID15:2.1 Car Docked Exit.Display Brightness
20160112 17.30.53 A OK       ID15:2.2 Car Docked Exit.Auto Brightness
20160112 17.30.53 A OK       ID15:2.3 Car Docked Exit.Var Clear, %CARDOCKED=%CARDOCKED
20160112 17.30.53 A OK       ID15:2.4 Car Docked Exit.Bluetooth Auto Connect
20160112 17.30.53 A IfFail   ID15:2.5 Car Docked Exit.Bluetooth
20160112 17.30.53 P Inactive ID94     CarModeOn
20160112 17.30.53 A OK       ID15:2.6 Car Docked Exit.Var Clear, %Carmode=%Carmode
20160112 17.30.53 A OK       ID15:2.7 Car Docked Exit.Car Mode
20160112 17.30.53 T ExitOK   ID15:2   Car Docked Exit
20160112 17.30.53 T Running  ID92:3   Car Mode Off
20160112 17.30.53 A OK       ID92:3.1 Car Mode Off.Car Mode
20160112 17.30.53 T ExitOK   ID92:3   Car Mode Off

Scott

On Jan 12, 2016 7:32 PM, "Wayne Longford" <wlong...@gmail.com> wrote:
Can you provide a copy of the run log?

When in the run log go to Menu / External Viewer then you can copy paste it here.

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Wayne Longford

unread,
Jan 15, 2016, 1:08:32 PM1/15/16
to Tasker
I misunderstood what you were saying about delayed actions, I thought you meant there was a delay in Tasker processing the actions at a particular point during the task.

Anyhow, I can't offer an answer, other than to say have you tried changing the order of the actions or temporarily disabling some of them to determine if there's one in particular that maybe causing the delay?

Scott Miller

unread,
Jan 15, 2016, 7:00:33 PM1/15/16
to tas...@googlegroups.com

Yes, I most certainly have made changes. Disabled some actions, removed others completely.

While not totally solved, two things happened that have made an improvement. First, I restarted the phone. This seems to have helped reduce the delay, but it still takes longer than I think it should. Now it's 2 or 3 minutes, not 5 or 10. The very next day I received the January patch update, so my phone would have restarted then if I hadn't already done so. Of course it did again. So the bottom line is that the task performs better, but it's not as instant feeling as it used to be.  I still blame Android. I was just hoping someone might have discovered a setting or something that might be the culprit. The delay is annoying, but it's not gonna kill me.

Scott

CoolRaoul

unread,
Apr 21, 2016, 1:24:35 PM4/21/16
to Tasker

I'm facing the same problem: some tasks are started with delays apparently randomly (which make this very difficult to debug)

Just created a really simple task which increment a counter in a global variable and displays along with the time it in a toast:

test (213)
A1: Variable Set [ Name:%fmt To:%H:%M:%S Do Maths:Off Append:Off ]
A2: Run Shell [ Command:date +"%fmt" Timeout (Seconds):0 Use Root:Off Store Output In:%strtime Store Errors In: Store Result In: ] 
A3: Variable Add [ Name:%TestCount Value:1 Wrap Around:0 ] 
A4: Flash [ Text:[%strtime] %TestCount Long:Off ] 


Then put a tasker shorcut to this task on my desktop,
The delay between the press of the shortcut and the display of the toast vary from instantaneous to many (up to 10) seconds.
This seem to be greatly made worse when I launch another Tasker task (which activate a VPN connexion using secure setting "execute shortcut" action) in parallel

CoolRaoul

unread,
Apr 21, 2016, 1:40:47 PM4/21/16
to Tasker
Added a log file and scheduled my task to tun every two seconds, (using Tasker "task timer" widget)

Here're the results, notice the delays:

TimeStamp Count Delay
19:27:57 120
19:28:11 121 00:00:14
19:28:13 122 00:00:02
19:28:15 123 00:00:02
19:28:36 124 00:00:21
19:28:56 125 00:00:20
19:29:08 126 00:00:12
19:29:11 127 00:00:03
19:29:13 128 00:00:02
19:29:15 129 00:00:02
19:29:17 130 00:00:02

Pent

unread,
Apr 22, 2016, 2:41:19 AM4/22/16
to Tasker
Would try all of these if not done already:

http://tasker.dinglisch.net/userguide/en/androidpowermanagement.html

Pent

CoolRaoul

unread,
Apr 22, 2016, 3:12:50 AM4/22/16
to Tasker
Already done.
Note that this happens with screen on and device unlocked thus I would be surprised that it be related to marshmallow battery optimisations.
Other thing to take into account: my device has just been upgraded to Android 6 this week but I had those issues before (funny that it was in the context of a "car mode" profile too).
Sidenote: I've tried to reproduce the test on my tablet (xperia Z3TC, still running lollipop) and there I'm facing another issue: the task timer widget is unable to use any interval lower than 5 seconds.

CoolRaoul

unread,
Apr 22, 2016, 4:01:37 AM4/22/16
to Tasker
I've found how to reproduce this at will (at least on my phone)
When network connectivity switches, all tasker task scheduling suffers of those delays for a few moments.
Ive made a very simple task which switches wifi off then on, which I'm able to launch from a shortcut.
I first activate the task timer widget on my simple counter task, then, while it's running, I launch the toggle Wi-Fi task.
Et voilà! Immediately I can notice the delays, up to more than 30seconds!

CoolRaoul

unread,
Apr 22, 2016, 5:34:41 AM4/22/16
to Tasker
I now understand why I' had previously noticied that glitch occurs when using my "car profile" specifically when I was leaving work: when I go back to my car, at the end of my working day, my phone is still connected to our public wifi network there (in the car park, even if the signal is very weak, its still present).
The car dock profile, triggered by the bluetooth connected state, among other things, starts by turning off the wifi, triggering a network switch (from wifi to mobile)
That's why this issue happens in this situation (and, I repeat, I had not received Marshmallow upgrade until this week)

Phil

unread,
Apr 22, 2016, 9:39:37 AM4/22/16
to Tasker
I've observed the same delays in 6.0.1 in launching my car profile which also disables wifi early in the task. The Tasker log has been useless in this because like others observed, Tasker performed all of the actions in a second or two but Android appears to queue/delay them. So it doesn't appear to be a Tasker issue.

I've always had battery saver disabled and battery optimizations disabled for Tasker and all of the plug-ins I use (as well as some apps).

I'm going to delay the wifi/off until the end of my task and see if that helps.

Phil

unread,
Apr 22, 2016, 2:03:05 PM4/22/16
to Tasker
My first attempt with moving wifi/off to the end of my car task didn't seem to improve the lag.  So I wonder if it has more to do with the bluetooth connection.  However, I see my car stereo's bluetooth icon lit up within 5 seconds yet it takes 1-2 minutes usually to run my task even though Tasker shows it completing in a couple of seconds.

AA

unread,
May 17, 2016, 2:18:50 PM5/17/16
to Tasker
Thanks to CoolRaoul pointing me to this post from another.   This seems to be the exact same problem as I have (Android 5.0, latest Tasker), at least now I confirm it's not my phone or any app I installed that conflicts.   And it seems the delay is somehow related to wifi and/or bluetooth on/off, as this usually happens when I'm switching location based on cell tower/wifi, and then for now reason (now there is) there is a delay of seconds to minutes.   

Does anyone figure out a workaround?    I'll also try pushing the wifi/BT on/off later in the tasks, and calling a separate tasks and see if that helps.   From Phil's posts it seemed it's not speeding it up.

technogeezer

unread,
May 18, 2016, 7:51:39 AM5/18/16
to Tasker
Just to chime in, I've had these types of delays for some time now.  Didn't have them when I started using Tasker a couple of years ago but they are chronic now.  It started with missing messages in Tasker that autoRemote's log showed were received.  Then the delays spread to my car and the BT exchanges that occur in my related profiles.  Finally, delays started showing up in the home automation stuff I'd built with Tasker.

I too have tried many things just to try and figure out what is actually happening.  The Tasker log does not help since it always shows that actions are executed in a timely manner.  I've used the wireShark-like apps on my non-rooted phone and tablets and found that there is some wifi interference but not enough to account for these long delays.  I don't know as much about BT so troubleshooting has been difficult.

I've been a programmer for many years.  Even did some custom android work back in the day.  I do not know what Tasker does 'under the hood' but the symptoms indicate, at least to me, that Tasker's interface with android is somehow associated with these delays.

Of course, it could be something the NSA has secretly uploaded to our devices.  ;)

CoolRaoul

unread,
Jun 19, 2016, 5:42:48 AM6/19/16
to Tasker

Since few weeks I've started getting start up delays of tasks directly launched by a launcher shortcut too! (from launcher, add widget -> tasker -> "task shortcut").

It's getting very annoying.

Scott Miller

unread,
Oct 12, 2016, 6:20:06 PM10/12/16
to Tasker
I thought I would post an update to this old thread. On Monday of this week, I received the October 5 2016 Security Patch Update for my Nexus 6. It's still on Android 6.01. But what a difference. Tasker is running tasks almost too fast, now. The task I wrote about here is working correctly once again. I have no idea what Google fixed with this patch update, but they certainly did fix something. I guessed this was a Google problem from the beginning, but I had no way to prove it. I don't have Android 7, yet, but I know it's coming soon. I hope Google doesn't screw it up again when I get that version.

CoolRaoul

unread,
Oct 16, 2016, 10:59:55 AM10/16/16
to Tasker


Le jeudi 13 octobre 2016 00:20:06 UTC+2, Scott Miller a écrit :
I thought I would post an update to this old thread. On Monday of this week, I received the October 5 2016 Security Patch Update for my Nexus 6. It's still on Android 6.01. But what a difference. Tasker is running tasks almost too fast, now. The task I wrote about here is working correctly once again. I have no idea what Google fixed with this patch update, but they certainly did fix something. I guessed this was a Google problem from the beginning, but I had no way to prove it. I don't have Android 7, yet, but I know it's coming soon. I hope Google doesn't screw it up again when I get that version.


That's a good new (globally) but not for me: my device (Moto X gen2) is still running 6.0, not sure if 6.01 will even be delivered some day
Anyway, tell us informed about Android 7 please.

AA

unread,
Dec 26, 2016, 10:53:25 AM12/26/16
to Tasker
Chiming in with my results. Finally upgraded mine to 6.01 a few weeks ago, and it is way better. There are still a little delay once in a while (usually less than 5 seconds), but majority of the time tasks launches almost instantly, tasker is usable again!
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Gilles P

unread,
Mar 18, 2017, 11:26:14 AM3/18/17
to Tasker
On Tuesday, May 17, 2016 at 8:18:50 PM UTC+2, AA wrote:
Thanks to CoolRaoul pointing me to this post from another.   This seems to be the exact same problem as I have (Android 5.0, latest Tasker), at least now I confirm it's not my phone or any app I installed that conflicts.   And it seems the delay is somehow related to wifi and/or bluetooth on/off, as this usually happens when I'm switching location based on cell tower/wifi, and then for now reason (now there is) there is a delay of seconds to minutes.   

Does anyone figure out a workaround?    I'll also try pushing the wifi/BT on/off later in the tasks, and calling a separate tasks and see if that helps.   From Phil's posts it seemed it's not speeding it up.

I know this is a pretty old thread, but since I was still getting this delay issues even if I'm now using a rather different phone (Samsung S7 running Nougat vs Moto X 2015 running Marsmallow) I've decided to investigate a bit further.
I've come to the conclusion that it's the Android network switch events (toggling WIFI from on to off) which are the root cause of those problems.
As soon as I've disabled the "toggle wifi off" step  in my car dock tasker enter task, everything went *way* much smoothly.
In all case it seem that switching networks (from mobile data to wifi and back or when activating VPN too ) have a huge impact on Tasker performance.
Did anyone noticed that too?

Pent

unread,
Mar 18, 2017, 12:58:13 PM3/18/17
to Tasker

In all case it seem that switching networks (from mobile data to wifi and back or when activating VPN too ) have a huge impact on Tasker performance.

 
Coincidentally, I just noticed today that activating the VPN causes a Tasker monitor restart on the S7, possibly other network events do too.

Will investigate.

Pent

Pent

unread,
Mar 22, 2017, 10:37:52 AM3/22/17
to Tasker

 
Coincidentally, I just noticed today that activating the VPN causes a Tasker monitor restart on the S7, possibly other network events do too.


No, try as I might I can't reproduce what (I think) I saw one time, could be I was mistaken.

Android can get very busy when network state changes, especially when e.g. wifi comes on because all the apps
notice and want to call home.

Pent 
Reply all
Reply to author
Forward
0 new messages