PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

symbian 3.6 release and vertical tearing

ten foot ninja · 22 May 2006, 05:34 UTC
Hello,
I love how the display opening stuff has been simplified. But there are some differences between 3.5 and 3.6 for symbian i noticed, namely, with 3.5 when i call Flip(), the back buffer gets displayed right away (next line of code will run after the backbuffer has been flipped into the display). With 3.6 there seems to be a delay (almost as though it gets flipped async.)

As well, unrelated to 3.6 (exists on both 3.5 and 3.6), i notice on the 6670 and 6620 there is some vertical tearing where it appears as though not all of the back buffer has been flipped into the display at the same time. This doesn't happen on the 3650 nor on win32

As you probably gathered from the above two paragraphs, i don't have a tremendous grasp of how low level gfx stuff works. Would someone be kind enough to inform me as to what is really going on below my code?

Thanks in advance!
Hi!

I'm glad you like the new release. :-) Yes, updating the display after a Flip is now asynchronous, simply for maximum compliance to deal with incoming phone calls etc. GapiDraw should now behave better than ever together with other applications on Series 60 phones! The drawback is that as you said that flipping might not be as "instant" as it was before.

Regarding tearing, we use Symbian's own routines for the final blit to the display, and try to prevent tearing as much as possible. However on some devices this tearing might be more visible than others, unfortunately it's not something we can change easily.

//Johan
ten foot ninja · 23 May 2006, 18:01 UTC
I can certainly see the benefit of having an async render process with the phone. But it changes things for me because with 3.5 when my game starts up, i load a splash screen, flip it and right away load all my images and game stuff which takes a few seconds (depending on the device).

Now, the same code doesn't work well, my splash screen pops up when i'm almost done loading everything and is ineffective. How can i know when the back buffer has been flipped? How can i know when to actually start loading game stuff? if its in the active scheduler, i can call Start() but will need something within the callback (which i have no access to) that calls Stop().

any ideas? thanks again!
Can you try calling a Sleep() right after the Flip? Like modify GapiApplication and set a member bool to "true" to wait a bit after Flip?
ten foot ninja · 23 May 2006, 20:23 UTC
good idea, but it doesn't seem to work for some reason. Sleep calls User::after() which suspends the entire thread. I'm assuming the actual flipping is done outside of the CGapiApplication thread...

strange, if i take my image loading code out, the load screen gets displayed quickly, like my thread ties up the entire system or flipping happens from within the same thread.

i have another loading screen that happens before each level (loads specific tiles/bosses (which are big, as they should be). Same thing happens then too.
ten foot ninja · 14 Jul 2006, 20:06 UTC
realizing thats its better to have the better OS cooperation that comes with 3.6 rather then the non-syncronous straight-forwardness of 3.5, i spent time sorting this problem out, heres what happens:

for some reason my game thread won't get pre-empted by the window server (that gapidraw uses to copy the backbuffer to the display buffer). i tried sleeping the thread as mentioned above to no avail

instead, what i've done is just get my thread to do nothing for half a second and that seems to make the back buffer flip into the display a lot faster