01-09-2013 06:43 AM
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?
01-09-2013 09:32 AM
01-09-2013 11:57 AM
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.
01-30-2013 03:31 PM
01-30-2013 11:00 PM - edited 01-30-2013 11:01 PM
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.
01-31-2013 11:14 AM
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:
Also, here a link to the PlayBook version (which is using identical code base):
Interestingly, PlayBook, despite being a lower-specs device, has a rock-stable frame rate with absolutely no stuttering.
01-31-2013 02:31 PM
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?)
01-31-2013 04:12 PM
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.