profiles triggered with delay: it's getting worse

667 views
Skip to first unread message

CoolRaoul

unread,
Aug 9, 2016, 2:27:39 AM8/9/16
to Tasker
This is a old problem that I'm facing since quite a long time: at moments profiles reacts to events with very important delays.

It can't be related to a specific device since it  happens on my phone *and* my tablet. And, even if on the phone I've a rather complex set of profiles, that not the case on the tablet on which I'm using a pretty basic setup.
It's not doze/energy saver related either since this happens when screen is on (and BTW, since the tablet is running Android 5 so doze is off the way there)
Unfortunately I feel that it's worsening.

Two examples (among many others)
  • On my phone I have a "speak SMS" profile, which I'm use my "car mode" profile is active. I've experienced delays between the arrival of the text message and the execution of the associated task up to 5mn, and it's often greater that 1mn. 
  • On my tablet, I've a Tasker shortcut on my home screen which runs a associated task. Sometimes the task runs immediately but often it takes several tens of seconds between pressing the icon and task execution (I think this one shows that it can be related to some kind of "polling period" setting since it's a direct user action => task sequence)
I'm pretty lost searching for a solution or explanation of what's going on there.
Tasker run log hasn't been useful either.

Every idea about this will be very welcome

Archinspain

unread,
Aug 9, 2016, 10:35:12 AM8/9/16
to Tasker
Do you have any other tasks running that Tasker might be busy with, perhaps ones containing 'wait' actions or 'get location'? Those can cause delays.

CoolRaoul

unread,
Aug 9, 2016, 10:40:56 AM8/9/16
to Tasker
Do you have any other tasks running that Tasker might be busy with, perhaps ones containing 'wait' actions or 'get location'? Those can cause delays.
Not really. The last times (2 mn this morning and 5 yesterday) I've experienced the  SMS delay, I was in waiting in my car stopped waiting for a colleague. No profile change activity. And I dont use "get locations" in none of my tasks. 

And, regarding the tablet, there is always very minimal activity on this device, including at times when I'm experiencing the issue.

Rich D

unread,
Aug 9, 2016, 12:36:15 PM8/9/16
to Tasker Google Groups Post


> Tasker run log hasn't been useful either.
>

What dose the run log show during the delay times. Is there any activity?  Do you see any 'monitor starts' ( Not monitor restarts). The restarts are normal.

If there is any relevant info in the log could you post the log along with the exported description of the profile and tasks involved with the delay.

To post your profile or task here...  Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)

Any linked tasks will be exported with the profile they are linked to..

To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name.  Tasker will list your profile with the context name if you have not given it one).

CoolRaoul

unread,
Aug 9, 2016, 1:26:12 PM8/9/16
to Tasker


What dose the run log show during the delay times. Is there any activity?  Do you see any 'monitor starts' ( Not monitor restarts). The restarts are normal.


I'm taking as example yesterday run of my tablet shortcut triggered task since I had the issue there and Tasker log was enabled. Note that I had already seen longer delays others days but I don't have the logs.

This sequence of events appears just before actual task execution (note the timestamps)
The shortcut press happened just after having used the tablet "on" button (triggering the "DisplayOn" profile as one can see):
20160808 22.20.25 P Active   ID10     DisplayOn
20160808 22.20.26 E Start    ID0:0.0  TaskService
20160808 22.20.26 T Running  ID11     Anon
20160808 22.20.26 A OK       ID11.1   Anon.Stop
20160808 22.20.26 T ExitOK   ID11     Anon
20160808 22.20.26 E Stop     ID0:0.0  TaskService
20160808 22.20.38 E Start    ID0:0.0  TaskService
20160808 22.20.40 E Stop     ID0:0.0  TaskService
20160808 22.20.47 E Start    ID0:0.0  TaskService

Then the task starts to run (about 20 seconds after having pressed the shortcut):
20160808 22.20.47 T Running  ID-7     Sleep
could it be those sequence of "stop/start TaskService" events which creates the delays?

I've posted the complete log regarding the execution timeframe there: http://pastebin.com/ibb9gZx0

And here's the task (pretty basic, only 3 actions)
Sleep (46)
 A1
: AutoHue [ Configuration:IP: <IP_Hidden>
Light: Iris, Lightstrip, Burea Timeout (Seconds):5 ]
 A2
: System Lock
 A3
: Perform Task [ Name:Bravia.off Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]


The "bravia.off" task simply shuts down my TV Set by sending using an http post (using "REStask" plugin)
Autohue turns off lights using a Philips HUE Plugin

Rich D

unread,
Aug 9, 2016, 5:38:06 PM8/9/16
to Tasker Google Groups Post


> I'm taking as example yesterday run of my tablet shortcut triggered task since I had the issue there and Tasker log was enabled. Note that I had already seen longer delays others days but I don't have the logs.

What launcher are you using?  Is it the same launcher for both devices? 

> Then the task starts to run (about 20 seconds after having pressed the shortcut):
> 20160808 22.20.47 T Running  ID-7     Sleep
> could it be those sequence of "stop/start TaskService" events which creates the delays?

I do not think that is the issue. I do not know why the task service starts and stops like that but it dose do it on my device as well and I do not have the delays.   If you open tasker and go to the task edit screen I believe that will start the task service.

CoolRaoul

unread,
Aug 10, 2016, 2:33:40 AM8/10/16
to Tasker

What launcher are you using?  Is it the same launcher for both devices?  


Nova on both devices. But I cant really see how it could be related with Tasker delays (could be in the case of the shortcut activating a task but in all others case, like the text message I hardly can imagine any link)

> could it be those sequence of "stop/start TaskService" events which creates the delays?

I do not think that is the issue. I do not know why the task service starts and stops like that but it dose do it on my device as well and I do not have the delays.   If you open tasker and go to the task edit screen I believe that will start the task service.


Probably not the direct cause but a side effect or indication of something else.
Look, I've managed to have the log enabled on my phone this morning and I've experienced a delay:

20160810 06.55.41 E Stop     ID0:0.0  TaskService
20160810 06.58.18 E Start    ID0:0.0  TaskService
20160810 06.58.18 E Stop     ID0:0.0  TaskService
20160810 07.01.05 P Instant  ID17     Sms When Driving
20160810 07.01.05 E Start    ID0:0.0  TaskService
20160810 07.01.05 T Running  ID18     Speak SMS
20160810 07.01.05 A IfFail   ID18.1   Speak SMS.Stop
20160810 07.01.08 A OK       ID18.3   Speak SMS.Wait
20160810 07.01.08 A OK       ID18.4   Speak SMS.Say
20160810 07.01.11 A OK       ID18.5   Speak SMS.Wait
20160810 07.01.12 T ExitOK   ID18     Speak SMS
20160810 07.01.12 E Stop     ID0:0.0  TaskService

The text message has been received at 6:58 (I've checked that timestamp inside the SMS app).
At that specific moment there is a stop/start/stop TaskService sequence
The "Speak SMS" profile has been triggered nearly 3mn later (07:01:05) and there is no intervening events meanwhile. During that interval the TaskService was off since the last event was "stop".

Rich D

unread,
Aug 10, 2016, 4:42:23 AM8/10/16
to Tasker Google Groups Post


> Nova on both devices.

Nova has known issues with Tasker.  I would start by
Disabling this setting in nova

Nova Settings -> App & widget drawer -> (Advanced) -> Automatically Close

IF you still have issues try a different launcher.

CoolRaoul

unread,
Aug 10, 2016, 5:17:13 AM8/10/16
to Tasker


> Nova on both devices.

Nova has known issues with Tasker.  

*those* kinds of issues (task triggers delays), really? 

Moreover, regarding the speak SMS profile, Nova UI was not even running: my phone was in car mode and default launcher set to a "car dock" optimized one all the way long.

I would start by Disabling this setting in nova

Nova Settings -> App & widget drawer -> (Advanced) -> Automatically Close

Quickly searched for this, apparently this seem only related to App Context detection.
 
Anyway, I did it, guess it cant' hurt 

Will see...
 

IF you still have issues try a different launcher.

Oh no! That would really be too bad: Nova have been always been my launcher of choice .

Robert Ryan

unread,
Aug 10, 2016, 10:24:22 AM8/10/16
to Tasker
This sounds like some other app or service is hogging the CPU. Have you tried running OS Monitor or a simular app to see what else is running in the background?

P.S. I've used Nova for years without any problems.

CoolRaoul

unread,
Aug 10, 2016, 10:36:48 AM8/10/16
to Tasker

This sounds like some other app or service is hogging the CPU. Have you tried running OS Monitor or a simular app to see what else is running in the background?

Be sure that I've already checked many kinds of possible external causes including those. 
In any case, a CPU consumer process able to produce such important delays (up to 5 minutes) would necessary have other visible effects on others applications, however only Tasker is affected, everything else runs smoothly.

On my tablet especially, I have a very simple set of apps, there is very low activity and it's far from being un underpowered device (Xperia Z3 Tablet).

Jean Dowe

unread,
Aug 11, 2016, 1:34:06 AM8/11/16
to Tasker
While not as bad, I have noticed this issue as well. More notably on an old phone with very weak CPU and low mem.

But on a Nexus6, I can see a delay of 10-20 seconds before a task executes. Though most of my tasks are not time critical so I do not notice, there is one, my SMS notification sound task (I have different sounds for different numbers, etc). I've seen a message arrive and waited quite a bit until the task fired off the sound. Doze is not an issue for me as I'm still on Lollipop. No battery saving apps or stuff implemented either.

CoolRaoul

unread,
Aug 11, 2016, 2:52:46 AM8/11/16
to Tasker

This sounds like some other app or service is hogging the CPU. 

I'm now sure that this option can be eliminated: my "Speak SMS" profile has faced the issue again this morning.
Since my car was stopped (red light), as soon as the SMS has been received, I've been able to use the phone, launching different apps like Google+ for instance. Everything was running completely smoothly without  any lag or delays.

After that, the "speak WMS" task triggered way later.

Steve Rothkin

unread,
Aug 11, 2016, 6:30:55 AM8/11/16
to tas...@googlegroups.com
I've also noted some occasional lag on my Nexus 6. Its most noticeable
when the screen is off, so I'm suspecting its related to marshmallow
power optimization. For example, I have a profile on power connected any
that speaks "Power Disconnected" in the exit profile. Sometimes there's
a lag of a few seconds before that happens (but the screen also doesn't
turn on right away after unplugging). It seems somewhat random and
inconsistent but rarely as much as 10 seconds. It might be tied to how
long the phone has been sitting idle with the screen off.

And many tasks do fire quickly (e.g. when I plug in wired headphones or
connect bluetooth headphones).

BTW, I do have battery optimization disabled for tasker. I had reliable
alarms set to "when off", but I just changed it to "always".

Steve Rothkin

unread,
Aug 11, 2016, 7:50:03 AM8/11/16
to tas...@googlegroups.com
On 8/11/2016 6:30 AM, Steve Rothkin wrote:
> I had reliable alarms set to "when off", but I just changed it to
> "always".
>

And changed it back to "when off" again as I noticed why I originally
chose that setting. Hate the confusion of having the extra alarm clock
icon in the status bar that looks the same as the one put up there when
the alarm clock is set.

Robert Ryan

unread,
Aug 11, 2016, 9:41:41 AM8/11/16
to Tasker


On Thursday, August 11, 2016 at 12:52:46 AM UTC-6, CoolRaoul wrote:
Everything was running completely smoothly without  any lag or delays.

After that, the "speak WMS" task triggered way later.

Ok, what about the TTS engine? Are there any other apps/services that use TTS? If so, maybe one of them is failing to release the resources. This would put Tasker in a wait state until the resources became available.

Have you tried using a different TTS engine?

CoolRaoul

unread,
Aug 11, 2016, 10:27:54 AM8/11/16
to Tasker
Ok, what about the TTS engine? Are there any other apps/services that use TTS? If so, maybe one of them is failing to release the resources. This would put Tasker in a wait state until the resources became available.


I'm using the android default builtin TTS engine.
At the time I receive the text message, only Waze could use voice synthesis but it uses it's own TTS engine. Also I've sounds disabled in the app most of the time (that was the case this morning and yesterday)

And don't forget too the timestamps in the runlog I've previously shown. 
It's the *task startup * which is delayed, not the "Say" action

Remember:
20160810 07.01.05 T Running  ID18     Speak SMS <-task startup
20160810 07.01.05 A IfFail   ID18.1   Speak SMS.Stop
20160810 07.01.08 A OK       ID18.3   Speak SMS.Wait (2 secs)
20160810 07.01.08 A OK       ID18.4   Speak SMS.Say <-- only 3 seconds later
20160810 07.01.11 A OK       ID18.5   Speak SMS.Wait (1 sec)
20160810 07.01.12 T ExitOK   ID18     Speak SMS

Between the task "Running" and "ExitOK" events there is only few seconds (mostly due to the "wait 2sec" actions I've inserted before and after the "say" action)

Robert Ryan

unread,
Aug 11, 2016, 10:53:13 AM8/11/16
to Tasker


On Thursday, August 11, 2016 at 8:27:54 AM UTC-6, CoolRaoul wrote:
20160810 07.01.08 A OK       ID18.4   Speak SMS.Say

 The Speak SMS.say occurs when the intent is sent to the TTS engine. Tasker has no control over when the TTS engine actually acts on that intent.

 Also I've sounds disabled in the app most of the time (that was the case this morning and yesterday)

Just because the sounds are disabled doesn't mean Waze isn't initializing and holding TTS engine resources.

In the Say action, click the magnifying glass next to the engine parameter to see what other options are available.

Scott Miller

unread,
Aug 11, 2016, 1:22:56 PM8/11/16
to tas...@googlegroups.com

I, too, see delays on some tasks. I've reported it here, but of course the usual suspects (Android, alarms, doze, etc) are always blamed, because the run log doesn't show any problems. In my case, the run log always shows everything firing on time, even though what actually happens is late. One thing I have noticed is that every task that experiences delays has a plugin in use. No plugin, no delay. Plugins in profile contexts work correctly. I noticed from this thread that one or two plugins are also being used, that's why I mention it.

I've given up on solving it, as it hasn't caused things to break completely. It's an aggravating nuisance, that's about it. Since you are digging into it so completely, perhaps a solution will be found.

Scott

CoolRaoul

unread,
Aug 17, 2016, 3:20:20 AM8/17/16
to Tasker
I'm making progress collecting data (unfortunately not finding any explanations on what's going on)

Yesterday, in the *exact* same context that my previous tests (same background and foreground running applications, same active Tasker profiles, same time of the day) , the task have triggered almost immediately.

This morning (still same context, screen on), I've experienced long delay again.
Meanwhile I had added a notification action in my "speak SMS" task displaying current time (%TIME) and Text received time (%SMSRT)
Here's my observations this time:
  • According to SMS application (Textra), text message has been received at 06:59.
  • The notification show %TIME and %SMSRT having to the same value: 07:03 (+4mn)
  • the effective clock time where I've got the audio output has been 7:06 (just looked the phone clock in the notification area as soon I've heard the message). (+7mn)
I've been able to make another test with my colleague less than 5 minutes later and the task triggered without any noticeable delay.

Rich D

unread,
Aug 23, 2016, 1:05:27 PM8/23/16
to Tasker Google Groups Post

> I'm making progress collecting data (unfortunately not finding any explanations on what's going on)

I realize most of these issues do not appear to be 'battery optimized ' related. However I would try white listing any associated app in the android battery optimization settings. Like the text app or any plugins used in the task. 

Another user found this ..
http://android.stackexchange.com/q/155364/14562

To be a issue on there particular device ( device specific issue)

http://android.stackexchange.com/q/155364/14562

CoolRaoul

unread,
Aug 23, 2016, 1:26:45 PM8/23/16
to Tasker

Le mardi 23 août 2016 19:05:27 UTC+2, Rich D a écrit :

I realize most of these issues do not appear to be 'battery optimized ' related. However I would try white listing any associated app in the android battery optimization settings. Like the text app or any plugins used in the task. 


Thanks for trying to help.
In general, battery optimisations apply only when screen is off, that's is not the case here
And (for the moment I'm trying to focus on the "text to speak" profile) my default SMS app (Textra) reacts apparently immediately to the incoming text message (getting notification sound and message pop up simultaneously), it's Tasker itself that takes time to reacts after that) and there are no plugins involved in the profile associated task, just Tasker basic built-in "speak" action.

Rich D

unread,
Aug 23, 2016, 2:39:38 PM8/23/16
to Tasker Google Groups Post


> In general, battery optimisations apply only when screen is off, that's is not the case here.

My point was this is a fairly new and very troublesome feature from android and not knowing if it really only affects screen off operations It is a very simple thing to try.



it's Tasker itself that takes time to reacts after that) and there are no plugins involved in the profile associated task, just Tasker basic built-in "speak" action.

I Believe the speak task uses a external voice engine and some people use apps such as Ivona so these are the things I was targeting. 

CoolRaoul

unread,
Aug 23, 2016, 3:00:39 PM8/23/16
to Tasker


> In general, battery optimisations apply only when screen is off, that's is not the case here.

My point was this is a fairly new and very troublesome feature from android and not knowing if it really only affects screen off operations It is a very simple thing to try.

Ok, I've disabled battery optimizations for Textra, but I'm pretty sure that it won't change anything: AFAIK Tasker doesn't uses the default SMS application, it hooks directly to Android Text API to be called back when incoming text events occurs.

If I'm guessing right, when a text message is received, Tasker and Textra (or whatever other application set as default), will be activated separately.


it's Tasker itself that takes time to reacts after that) and there are no plugins involved in the profile associated task, just Tasker basic built-in "speak" action.

I Believe the speak task uses a external voice engine and some people use apps such as Ivona so these are the things I was targeting. 

My task use the Google native TTS engine (as said in my previous answer in this thread, timestamp "11 Aug 2016 07:27:54 -0700") and I even don't have any other one installed.

Reply all
Reply to author
Forward
0 new messages