AutoVoice Tasker does not respond quickly for Broadcast receivers of Autoapps

Discussion in 'AutoApps' started by Haider, Feb 6, 2016.

  1. Haider

    Haider New Member

    Joined:
    Feb 6, 2016
    Messages:
    14
    Likes Received:
    0
    I had AutoVoice working great sometimes on my Galaxy Note3 but now having problems with significant delays between AutoVoice and Tasker. And not just AutoVoice is affected. Autonotifications is also delayed sometimes but probably less often.

    I thought the problem is for me only, but I have checked this forum and it seems it is a well known issue. The problem is that Android is giving low priority for broadcast receiver intents which all Tasker plugins are depending on, and there is no other way to communicate between plugins and the main tasker program.

    This is very very sad!!
    Autoapps are brilliant. And this limitation is making it much less useful for tasks needing almost real time response. Sometimes the delay is 15 to 20 seconds and sometimes it is neglected (I think there is some timeout for the intents).

    I had few questions in my mind for a workaround and hopefully will lead us to some solution.

    Any way to increase the priority of broadcast intents (system wide for all apps) in a routed android phone?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Unfortunately I don't know of a way, no :( This only seems to be an issue when your system is under some load and shouldn't happen all the time. Is you Galaxy Note 3 quick to respond in general? How are you reacting to the voice commands? Using the Google App?
     
  3. Haider

    Haider New Member

    Joined:
    Feb 6, 2016
    Messages:
    14
    Likes Received:
    0
    Yes. This doesn't happen usually. Only maybe 10-20% of cases. Especially when I go outdoors and under the sun even if the hand phone is not under load. It seems when the hand phone is in a hot environment (It is hot here in winter in Malaysia :) ), generally the hand phone will be slower a bit, maybe due to throttling the processor. But the phone is generally very responsive for anything else. Only autoapps will have this problem. 10 Seconds delay or more and most of the time when it happens, it is neglected and I have to repeat the command.

    I understand now that the main problem is due to the low priority of the broadcast receivers intents which is difficult to increase their priority. At least I know that the problem is not in my setup or my phone.

    Are all android phones equally affected?
    I mean is it a chore feature of Android to give low priorities for such intents? or there is difference in severity among different brands (HTC, Samsung, Lg, Nexus...etc.)?

    And this beg the question, does it differ if the Android version is Kitkat, or Lollipop or Marshmallow?
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    I never get this issue on my devices for example, but it's a known "feature" of the Android OS. Do you maybe have another app on your device that's throttling processes? Some kind of battery saving app for example?

    Thanks
     
  5. Haider

    Haider New Member

    Joined:
    Feb 6, 2016
    Messages:
    14
    Likes Received:
    0
    Interesting!
    What are the devices that you have tested which do not have this issue, and what are their OS version?

    No I have no power saver apps or like that. I hate such apps and try to avoid them.
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    I have a Nexus 6, Nexus 7, LG G4 and a Galaxy S3 and none of them have this issue.
     
  7. Haider

    Haider New Member

    Joined:
    Feb 6, 2016
    Messages:
    14
    Likes Received:
    0
    What do you think about this modification to the intents(source: here ) :
    ------------------------------------------------------------------------------
    In Android System, broadcast are processed internally.
    Sometimes, due to system loading/ restart/ high runtime, the broadcast receiver gets time to receive some intent
    Workaround is, to add Flag FLAG_RECEIVER_FOREGROUND to intent sending broadcast
    intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
    This will speed up the broadcast delivery much than before in problem scenario
    ---------------------------------------------------------------------------------

    Because I can reproduce the issue in my galaxy note3, I am happy if I can help to check this modification (or any other modification that you think maybe useful).
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
  9. Haider

    Haider New Member

    Joined:
    Feb 6, 2016
    Messages:
    14
    Likes Received:
    0
    What do you think about this modification to the intents(source: here ) :
    ------------------------------------------------------------------------------
    In Android System, broadcast are processed internally.
    Sometimes, due to system loading/ restart/ high runtime, the broadcast receiver gets time to receive some intent
    Workaround is, to add Flag FLAG_RECEIVER_FOREGROUND to intent sending broadcast
    intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
    This will speed up the broadcast delivery much than before in problem scenario
    ---------------------------------------------------------------------------------

    Because I can reproduce the issue in my galaxy note3, I am happy if I can help to check this modification (or any other modification that you think maybe useful).


    I have installed this apk, but unfortunately the issue is still there.
    Are you sure the flag has been put in the code correctly and in all sent intents?

    I have tested in a well known scenario where most of the time there will be huge lag between AutoVoice sending the intent and tasker recieving the intent. This is happens almost always when I turn off the wifi and then turn on the wifi and then begin the google voice.
    In the meantime the system is trying to connect the wifi and once it is connected recognize the voice and then I get a toaster saying that "possible command bla bla bla" which means that Autovoice worked and sent the intent. But after that nothing happens. It is true by doing the wifi switch off and on, the phone will be less responsive and this is my way to reproduce the issue.

    Now I am restarting the phone and trying again. Please double check the modification is correct for the code and nothing missed regarding this flag.

    Thanks
     
  10. Haider

    Haider New Member

    Joined:
    Feb 6, 2016
    Messages:
    14
    Likes Received:
    0
    Are you sure you have provided me with the modified apk?
    It seems the version number is the same of what i have. It is version 2.0.46
     
  11. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Yes, I'm sure I've added it :( I just didn't change the version number on the app. Sorry, I really wish this would've worked. uJust to clarify, what Android version are you using?
     
  12. Haider

    Haider New Member

    Joined:
    Feb 6, 2016
    Messages:
    14
    Likes Received:
    0
    Kitkat 4.4.2

    Kindly can you check this scenario in one of your devices?

    Turn off wifi
    Wait 1 second
    Turn on wifi
    Say a voice command in Google now

    Is there any delay after the toaster appearing of autovoice?
     
  13. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    I just tried that. There seems to be a bit more delay with Google recognizing what I said, but after it does the AutoVoice command is executed immediately... :(
     
  14. Haider

    Haider New Member

    Joined:
    Feb 6, 2016
    Messages:
    14
    Likes Received:
    0
    The delay in Google recognition is completely acceptable since it tries to connect the wifi which is used by google online recognition.

    It is worth to mention that after installing autoVoice, if I open it, there is a red warning says: Autovoice Accessibility service not enabled
    So I will go to Accessibility settings of the phone, then enable Autovoice google Now Integration -> Ok

    I will get the following note (picture attached).

    What does that mean?

    Even after enabling Autovoice integration, I am still able to use the Note3 Pen. And I am still able to use multi window. So what is this note about and how it is affecting AutoVoice?

    Are these features part of Touchwiz of Samsung?
    Is it possible that this is the source of our issue?
    Note that the people that I found complaining about this issue in all your forums are either Samsung galaxy s6 ,Note3 like me and perhaps Note2. All with Touchwiz that contain those above features. Galaxy s3 that you have tested and does not have the issue doesn't have those features I think.

    Did you get complains from non Samsung phones? What are the phones affected?
    What do you think?
     

    Attached Files:

  15. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Yeah, Samsung devices have a lot of, let's call it "optimizations" :p
    Most of the complaints like this come from people with samsung devices, that's true.
    It seems that those touchwiz features are not compatible with accessibility services being enabled.

    By the way, did you try your delay test with the regular AutoVoice Recognize action in Tasker? Or with the Recognize widget? Is that faster maybe?
     
  16. Haider

    Haider New Member

    Joined:
    Feb 6, 2016
    Messages:
    14
    Likes Received:
    0
    I am using Tasker to recognize an intercepted voice commands from google now. I click on the native google now microphone, then tasker should receive the intent from Autovoice after intercepting it.

    Do you suggest something else?
    However, I have the same issue with Autonotification. When I press on an AutoNotification button, there will be the same delay in these scenarios. I think all Autoapps are equally affected. AutoInput GUI query also affected. The problem is with all intents delayed in Android OS as you stated and not particular to Autovoice.

    If I try a different Launcher, will that disable the effect of Touchwiz?

    Do you remember a similar complain from a non Samsung phone? Any other device?
    This can be helpful to rule out some factors.
     
  17. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    I was suggestion that you could try the AutoVoice "Recognize" widget to see if that works faster.

    I don't think a different launcher would make a difference sadly.

    I don't remember if similar complains came from different devices but I would say it's mostly samsung phones, sorry!
     

Share This Page