airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
200 stars 11 forks source link

Framerate automatically went up from 60 to 1000 whilst tweening with TweenMax #1859

Closed 2jfw closed 2 years ago

2jfw commented 2 years ago

Setup: AIR SDK 33.1.1.795 with latest Flex SDK, Windows 10.

Description: In our big Flex app (SeMSy 5), I created a simple spinning animation using Greensock's "TweenMax" (https://github.com/greensock/GreenSock-AS3).

Code: The code for this animation is simple:

TweenMax.to(holder,
                    1,
                    {
                        rotation: 360,
                        repeat:   -1
                    });

Observations:

I found out that while this animation is running, the display list rendering is sort of "blocked" and nearly nothing gets updated/rendered anymore, e.g:

So, it looks like the rendering of nearly the entire AIR application (/display list) is stuck and no longer happening. When the animation e.g. is set to only run x seconds, after the animation has finished, the rendering recovers/resumes back to normal and everything is displayed properly (e.g. the AIR Window shows up, buttons do highlight etc).

Tweening e.g. property "alpha" does NOT cause this issue. It seems that positioning/layout changes only do ("rotation", "x", "y").

[This is also happening with "TweenLite"]


Further breakdown: Please find attached a Scout Session with the phenomena here: https://cloud.dallmeier.com/s/xWp6jLGE77qS5iD

Password: wtAS

At around second 00:49/00:50 the animation gets started and is ended at around 01:07. On 00:59 I did open a new AIR Window, which then caused the issue - strangely, the "Target FPS" did go up from 60 to 1000! There is NO as3 code causing this (no single use of "stage.frameRate" in the entire project). I did also check on the Greensock classes and there is also no single occurence of "frameRate".


I was unable to reproduce this issue in a different Flex application by doing the same tweening using same SDK and settings etc.

Unfortunately, it is impossible to provide you a test application or sample, since there are too many dependencies on other Services/components etc.. I could offer you a remote session to show you the phenomena itself.

My question is, any clue why the targeted Framerate goes up automatically from 60 to 1000 while the tween is playing?

2jfw commented 2 years ago

image

dmunsie commented 2 years ago

"Unfortunately, it is impossible to provide you a test application or sample, since there are too many dependencies on other Services/components etc.."

I use TweenMax with my apps with zero issues. Is it possible to create a very small hello world type app that verifies the issue?

2jfw commented 2 years ago

I use TweenMax with my apps with zero issues. Is it possible to create a very small hello world type app that verifies the issue?

Sadly, I'm unable to reproduce it in a different project. I would really like to know under what circumstances the framerate gets maxed out. I would think that this would require something like a "special" Debug AIR SDK from Harman to find the root of the matter... @ajwfrost: I saw in the discussion at https://github.com/airsdk/Adobe-Runtime-Support/discussions/1860 that you mentioned "custom runtime that will give more information on what's failing" - in the case this issue is of interest to you, would it be possible to also get such a runtime from you? We could then reproduce the issue and provide you the results.

dmunsie commented 2 years ago

Make sure there are no conflicts with delta/frame based time execution. Also, try setting a global boolean which triggers all tweens to use "linear" to make sure there are no strange conflicts going on.

And since this seems to be only affecting you, I would do what ever it takes to isolate the problem. I've done massive debugs before, it's not fun. But you should be able to remove all the fluff and get a thinner version of your app up and running. It may take a long....time to do this, but imop you can probably guarantee that the SDK team would require this anyway before they seriously look into this.

2jfw commented 2 years ago

I wasn't able to reproduce this issue lately - I made an update to the NVIDIA graphics card drivers a while back and could imagine that this may be related

2jfw commented 2 years ago

I am now able to reproduce this issue and will send you an email/provide a test app for you @ajwfrost

2jfw commented 2 years ago

The issue could be retraced with the help of @ajwfrost. It is related to the Flex SDK class LayoutManager and it's function usePhasedInstantiation:

 public function set usePhasedInstantiation(value:Boolean):void
    {
        if (_usePhasedInstantiation != value)
        {
            _usePhasedInstantiation = value;

            // While we're doing phased instantiation, temporarily increase
            // the frame rate.  That will cause the enterFrame and render
            // events to fire more promptly, which improves performance.
            try {
                // can't use FlexGlobals here.  It may not be setup yet
                var stage:Stage = systemManager.stage;
                if (stage)
                {
                    if (value)
                    {
                        originalFrameRate = stage.frameRate;
                        stage.frameRate = 1000;
                    }
                    else
                    {
                        stage.frameRate = originalFrameRate;
                    }
                }
            }
            catch (e:SecurityError)
            {
                // trace("ignoring security error changing the framerate " + e);
            }
        }
    }

Though the exact details for the FPS to not go back to original FPS could not be determined, we at least were able to workaround the issue.