Interactive Software Developer
Oscillating performance problem in AIR for desktop
I’m currently developing an AIR desktop application that will be used in a gallery as an interactive touch screen exhibit, and I’ve encountered a problem with stuttering / oscillating performance that I am currently unable to resolve. I would be grateful if anyone can offer any assistance or advise as to what might be the cause, or where I might look for more information in resolving this issue.
The application allows people to browse through a series of menus and options, and explore, photos, videos and text information. It’s designed at full HD resolution, and uses StageVideo to display a looping video clip as the background of the interface. Some of the menus are presented as carousels that can be rotated in either direction, and the items within the carousel can be selected to display further screens of information. Animation of the carousels and other parts of the interface is done using Greensocks TweenMax, which I’ve successfully used before without problem. When I run the application on the specific computer on which it will be installed, the performance of the carousel rotation and other animated items seems to stutter, or oscillate. The animation doesn’t appear to constantly perform slowly, it’s more that the animation speed seems to alternate between slow, normal, slow, normal, etc, several times a second, giving the impression of a jerky performance. The application framerate is 50fps. I’ve tried reducing it to 30fps, but the performance issue still occurs.
When the application runs it first displays a screensaver. Interrupting the screensaver then displays a carousel menu with 4 options. When rotating the carousel, and the performance problem occurs, Windows task manager says the application is only using around 70MB memory, and CPU usage is minimal.
I’ve run the application on 4 very differently spec’d computers, with differing results. Computer specs as follows:
Computer 1 – My development computer
- i7-3930K – 3.2GHz (overclocked to 4.5GHz)
- Win 7 Pro 64-bit
- 32GB RAM
- 2 x NVIDIA GeForce GT 440 – 1GB DDR5
Computer 2 – My laptop
- i7 Q 720 – 1.6GHZ
- Win 7 Pro 64-bit
- 8GB RAM
- NVIDIA GeForce GT 330M – 1GB DDR3
Computer 3 – My other computer
- Core 2 Duo – 2.4GHz
- Win 7 Pro 32-bit
- 4GB RAM
- NVIDIA GeForce 7900 GS – 256MB DDR3
- Not hyper-threaded
Computer 4 – Intended installation computer for the application
- i5-4670 – 3.40GHz
- Win 7 Home Premium 64-bit
- 8GB RAM
- Onboard Intel HD Graphics 4600 – now disabled and upgraded to NVIDIA GeForce GTX 650 Ti BOOST – 2GB DDR5. No difference with either card.
- Not hyper-threaded (disabled in bios)
Computer #1 - The application runs as intended. I have had no problems with the stuttering performance. I’ve run the application on this computer when overclocked at 4.5GHz, and also with the overclocking switched off (running at normal 3.2GHz). The application works fine in both cases.
Computer #2 – The performance varies here. Some of the time the application runs as intended, without any sign of the stuttering performance. However, on some occasions when the application is run, the performance of the animations will stutter. I cannot determine the reason for the variation.
Computer #3 - The application runs as intended, but at a slightly lower framerate, most likely due to the lower spec of this older computer. I have had no problems with the stuttering performance.
Computer #4 – The application has never run as intended. Every time it runs, the performance stutters on this computer.
Flash CC Publish Settings
Swf settings: Hardware acceleration = Level 2 – GPU
AIR 18.104.22.1680 for Desktop
Render mode = Direct
I’ve started to use Adobe Scout to investigate the problem, and have read through the following article.
‘Waiting for GPU’ seems to be an issue, from what I can determine in Scout. The above article says…
“Here's a great tip: If your content shows excessive Waiting for GPU time in Scout, try temporarily disabling hardware acceleration in Flash Player (right-click and select Settings). This will cause Flash Player to fall back to software rendering, and the waiting time will vanish, so you can confirm that your problem is GPU-related.”
… I followed the advice above, and the oscillating performance issue was gone on the intended installation computer, but the screen redrawing performance was really bad (due to the CPU rendering the app). I believe this confirms my issue is related to using the GPU. However, upgrading the intended installation computer from it’s onboard Intel card to an Nvidia GTX650 has made no difference.
One option might be to replace the installation computer with a specification that is identical to my developer computer (#1), but I don’t think my client will have the budget for this.
Googling the problem hasn’t provided much help so far, but I’ve seen a few other people mention ‘waiting for GPU’ and ‘synchronization between CPU and GPU’?
Can anyone provide any clues, or a way forward to help me resolve this?
Common thing and they keep silent on this. I had seen extremely bad cases where it would take up to several seconds to render the frame. I 1st started to see the issue about a year ago and made short post on subject but I suspect things have changed a lot since then.
I was reading your post and was going to say turn off the hardware acceleration but then saw you tried it and it worked. In general, that should tell you that your app is just using too much cpu. It's requiring a lot to run so that's why you see some machines working and others not working. I'm sure that with the right optimization your app can easily run on those machines unless you're just trying to do something crazy with videos.
Are you working with bitmaps? If not, learn to use bitmaps. It's how all the games and and mobile apps are done (or should be done) to get the best performance.
gotoandlearn.com has good intro videos. Getting mobile apps to run smoothly is the hardest because the devices are the weakest. So look to air for ios and android coding for the best optimization tips.
Click Here to Expand Forum to Full Width