You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Fréderic Cox <co...@gmail.com> on 2016/02/12 16:43:51 UTC
Application in background throttle issues
I have an AIR application (running on Mac OSX) which periodically does things
like:
- Checking data and altering it via HTTPService requests
- Checking things using Timers
- Using NetConnection to communicate between multiple devices
These functionalities are working fine when the application is actively used
by the users. However the problems occur when the application is in the
background. After 20-30 seconds the HTTPService requests are not executing,
the timers are not running and the netconnection is not receiving nor
sending any data until the application has been made active again.
I did some tests and also added an enterFrameHandler to trace the frames. I
can confirm the enterFrameHandler fires a lot when the application is active
and when it becomes inactive it degrades to 4 FPS to 1FPS to 0FPS.
I have set backgroundFrameRate to 60 and frameRate to 60 (although the
default backgroundFrameRate of -1 should suffice) but that doesn't prevent
the issue either.
This is occurring on Adobe AIR 3.8 with Apache Flex 4.10. Please can anyone
help me figure out how to keep a constant frame rate even when the
application is in the background? This is a critical feature for my
application.. hope anyone here has experienced with this to figure out what
is going on. Not sure if this is a Flex thing or AIR.
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Application-in-background-throttle-issues-tp11976.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: Application in background throttle issues
Posted by Fréderic Cox <co...@gmail.com>.
I'd say luckily this has nothing to do with Flex or AIR :-). Thanks for your
answer I'll check into it immediately!
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Application-in-background-throttle-issues-tp11976p11978.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: Application in background throttle issues
Posted by Martin Miko <ma...@gmail.com>.
Hello Fréderic,
sadly this has nothing to do with Flex nor AIR. Since OSX Mavericks, Apple
introduced a feature called App Nap [1]. There's plenty of tutorials how to
disable it from UI or terminal e.g. [2]. There's also Objective C API e.g.
this stack overflow [3]. At the time we had to fix this problem it was not
possible to do it directly from AIR, so we ended up building our selves an
ANE. Unfortunately, we haven't open sourced it, so I cannot paste you the
source we used. But it shouldn't be a problem with a bit of googling, it's
also possible that someone also did such a thing and open sourced it and
you'll be able to find it on github or elsewhere.
[1]
https://helpx.adobe.com/creative-cloud/kb/app-nap-reduces-application-performance.html
[2] http://www.tekrevue.com/tip/disable-app-nap-os-x-mavericks/
[3]
http://stackoverflow.com/questions/19847293/disable-app-nap-in-macos-10-9-mavericks-application
Martin Miko
On Fri, Feb 12, 2016 at 4:43 PM, Fréderic Cox <co...@gmail.com> wrote:
> I have an AIR application (running on Mac OSX) which periodically does
> things
> like:
>
> - Checking data and altering it via HTTPService requests
> - Checking things using Timers
> - Using NetConnection to communicate between multiple devices
>
> These functionalities are working fine when the application is actively
> used
> by the users. However the problems occur when the application is in the
> background. After 20-30 seconds the HTTPService requests are not executing,
> the timers are not running and the netconnection is not receiving nor
> sending any data until the application has been made active again.
>
> I did some tests and also added an enterFrameHandler to trace the frames. I
> can confirm the enterFrameHandler fires a lot when the application is
> active
> and when it becomes inactive it degrades to 4 FPS to 1FPS to 0FPS.
>
> I have set backgroundFrameRate to 60 and frameRate to 60 (although the
> default backgroundFrameRate of -1 should suffice) but that doesn't prevent
> the issue either.
>
> This is occurring on Adobe AIR 3.8 with Apache Flex 4.10. Please can anyone
> help me figure out how to keep a constant frame rate even when the
> application is in the background? This is a critical feature for my
> application.. hope anyone here has experienced with this to figure out what
> is going on. Not sure if this is a Flex thing or AIR.
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Application-in-background-throttle-issues-tp11976.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>