Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
olejpoland
Posts: 10
Registered: ‎07-05-2012
My Device: BlackBerry 10 Dev Alpha

Performance fluctuations in OpenGL applications.

Hey,

 

After returning to Dev Alpha OpenGL Native apps development after 3 months we have a weird issue. Performance on different builds with no changes in code is different, eg. one day after compiling I have steady 60fps, day after that it is about 10-20fps. We have two versions of build: one is pure OpenGL ES 2.0 app in Native SDK based on ES 2.0 example, the second is the same app based on Cascades + foreign window ES 2.0. In the latter we are moving openGL window to Z = 1 so it will be above Cascades (z = 0) which granted (at first) a great performance boost making it run in 60fps just as the pure ES 2.0. Now, however, sometimes it works perfectly in 60fps on both builds, other time it is as bad as I mentioned above (though pure ES 2.0 is probably working a little bit better). 

 

Sudden spikes in execution time are occuring usually only on eglSwapBuffers (swap interval is set to 1) and while streaming ogg (using alSource(un)QueueBuffers), so that leads me to belive that maybe implementation/drivers/dev alpha issues.

 

Anyone has run into a similar problem? Any suggestions/solutions?

New Contributor
hexage
Posts: 4
Registered: ‎05-24-2012
My Device: PlayBook

Re: Performance fluctuations in OpenGL applications.

We've experienced a similar problem after updating the Dev Alpha to 10.0.09.1675. The frame rate is considerably lower after the update with no changes in code. Switching between ES1 and ES2 has no effect (as well as turning off the background music).
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: Performance fluctuations in OpenGL applications.

if you bring up the diagnostic overlay (swipe from upper-left), is the CPU pegged by any chance?  Can you compare between the 2 implementations.

New Contributor
hexage
Posts: 4
Registered: ‎05-24-2012
My Device: PlayBook

Re: Performance fluctuations in OpenGL applications.

In Robotek on Dev Alpha the diagnostics overlay shows:

 

CPU is usually around 20, sometimes going up to 30-32

FPS is usually between 19-20 but ocasionaly goes up to 25-28

 

the other fields (not sure about the actual meaning):

 

MEMORY 8 563

EVENTS 142 2301

API between 300-350

DRAW between 35-40

TRIANGLES between 400-500

 

We've used SWAP_INTERVAL=2 on PlayBook and Dev Alpha to hit our target FPS (30) and it has been working flawlessly (no tearing with smooth animations) before the new update.

 

New Contributor
hexage
Posts: 4
Registered: ‎05-24-2012
My Device: PlayBook

Re: Performance fluctuations in OpenGL applications.

Still getting ~20 fps after updating to 10.0.09.2320 with SWAP_INTERVAL set to 2.

Another observation -- when the SWAP_INTERVAL is set to 1 then the frame rate goes up to 30 in some games, and 60 fps in others. None of the games seem to be CPU bound.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: Performance fluctuations in OpenGL applications.

[ Edited ]

Have you tried inserting some profiling logs using CLOCK_MONOTONIC to try and determine where time is being lost in the loop?

 

If you can provide the bar file, I can forward it to the graphics guys to investigate.

 

As I understand it, this sort of thing is usually indicative of 2 swap operations happening per frame.. eg. one for the opengl, and one for the Cascades UI.

 

Cheers,

Sean

New Contributor
hexage
Posts: 4
Registered: ‎05-24-2012
My Device: PlayBook

Re: Performance fluctuations in OpenGL applications.

It definitely looks like a swap-interval related issue. It'd be great to have the graphics guys to investigate. Here is the link to the BB10 version of the game:

 

http://s3.hexage.net/partners/rim/RobotekBB10.bar

 

Also, here a link to the PlayBook version (which is using identical code base):

 

http://s3.hexage.net/partners/rim/RobotekBB2.bar

 

Interestingly, PlayBook, despite being a lower-specs device, has a rock-stable frame rate with absolutely no stuttering.

BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: Performance fluctuations in OpenGL applications.

thanks.. I will grab those bar files and pass along to graphics team.

You might want to delete the files afterwards in case you don't want them unnecessarily downloaded (or are they free?)

Cheers,

Sean

Developer
step_jac
Posts: 89
Registered: ‎05-31-2012
My Device: BlackBerry Playbook

Re: Performance fluctuations in OpenGL applications.

Hi Hexage,

 

We experienced a similar problem in both post 2.1 PBOS as wellas on 10.0.9+ on Dev Alpha. In our case, the issue was related to changes in the internal behaviour of the Swap Interval. We also had things pegged at 30FPS using a swap interval of 2. We ended up falling back to the default swap interval of 1 and throttling the frame rate manually on the CPU.

 

Best,

 

Stephane

BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: Performance fluctuations in OpenGL applications.

Hexage -- I've been trying to get in touch with you to help debug this issue.  check your private messages.