PocketMatrix forums

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

PocketHAL + Symbian + Screen Flickering!!

Hi folks!

I'm trying PH on symbian devices.

On my 6600 my demo runs fine, on 6630 it flicker (tearing) a lot!

There is a way to have vertical sync on symbian devices?

I googled few hours and i found nothing,looks like that on s60 devices we can't have flicker free applications (??)

Is this possible?? So how commercial games did???

Update: i tried direct screen access sample from nokia and looks good also on 6630 (no tearing), so i suppose something went wrong with PocketHal :((
I don't know of any way of synchronizing the swap with the refresh on Symbian. PocketHAL therefore doesn't.

I wouldn't know how other games do it. As far as I know, this isn't possible without having access to the OS internals. Maybe using a native bitmap for the backbuffer does it? (ie: the blit is synchronized). I will experiment with this shortly.
Thierry,

i don't know if this can help you, but looks like the way you suggested is the way used by nokia sample.

Code:

CFbsBitmap* iOffScreenBmp; // offscreen bitmap for double-buffered drawing


Used later for blitting:
Code:

// blit the offscreen bitmap (if used) to screen
if(!iUseFrameBuffer) {

// wins emulator related stuff...

} else {

// some code..
// copy bitmap contents to frame buffer
Mem::Copy(iScreenAddr, iOffScreenBmp->DataAddress(), iFrameBufLen);
// some code..

}


Hope to have PH fixed soon ;)
That is exactly what PocketHAL does. So there is nothing "to fix". Unless there is something else you aren't showing with that piece of code.
Actually,
i'm looking on nokia sample:

http://sw.nokia.com/id/58d3c4b6-d059-414e-b250-bbe5c49fd4b6/Direct_Screen_Access_Example_Application_v1_1.zip

Looking on sources, i can't see anything really interesting on that code..and i suppose you already
knew it (i found only that sample from nokia)

Anyway nokia application doesn't flicker :(
Isn't the address received to the "display" in fact an address to a back buffer? If you draw something to that address you still have to trigger a redraw for the things to show? This was true for older nokia devices, but I don't know how it is with newer ones.

When I developed things for symbian, the SonyEricsson devices returned the address to the display but nokia devices did not expose the display directly, but returned an address to a back buffer.

The problem of syncing the blit with vblank is a problem that was also discussed heavily, but I think that the only official answer was that these API:s would be available in later versions of symbian. There is AFAIK no way to sync with vblank if you are using DSA.
EvilMaio wrote:Actually,
i'm looking on nokia sample:

http://sw.nokia.com/id/58d3c4b6-d059-414e-b250-bbe5c49fd4b6/Direct_Screen_Access_Example_Application_v1_1.zip

Anyway nokia application doesn't flicker :(


That is weird, because PocketHAL does exactly the same thing as this sample. What phone are you testing this one?

As far as I know, "Guest" above is 100% right.
Questions about old phones sound strange because i tested PocketHAL sample on:

Nokia 6630 -> it flickers a lot

Nokia 6600 -> no flicker

Then i tried nokia sample, and it works fine on both devices.

Thierry said the nokia samples make things like PH, so what? Nokia 6630 is newer than 6600... I'm really missing something at this point :)


There is AFAIK no way to sync with vblank if you are using DSA.


Do you mean there is no way to have a flicker free game on 6630 and PH behaviour it's normal with that phone? Well i could accept it, but again, nokia sample run fine on both phones...

Some difference between PH and nokia sample should exists...
EvilMaio wrote:Some difference between PH and nokia sample should exists...


OK, I will try to track it down.
I have added a workaround for the Nokia 6630 that will hopefully work. Can you try this version?

Thanks!
Attachments:
POCKETHAL.zip (13 KB)
Same as before :?

Perfect on 6600
Flicker on 6630

I'm trying to send sample test also to my friends with other serie60 phones.
When you say flickering, do you mean flickering or tearing? Can you descrive in more details what you see? What are you testing?

OK, this time I disabled DirectScreenAccess on the 6630. Can you give it a try? Thanks.


<TT: Deleted attachment>
Dear Thierry,

i'm sorry, but my friend made mess with .SIS installation :oops:

I forced him to try again your first fix with DSA, and in effect now it works perfect without tearing! :P

Just for curiosity there's any way to have some tech info about this workaround?

POCKETHAL.zip
Description: Potential fix for flickering on Nokia 6630. (PHAL 0.7.7 ARMI Lib)

Download
Filename: POCKETHAL.zip
Filesize: 12.72 KB
Oh it is a simple thing, but an annoying one.

Most Symbian Serie 60 phone do not actually provide direct screen access. What they do is give you access to some other buffer that gets copied to the actual display when you send a ERedraw event to UserSvr. I say "most" but I tough there were all like that.

It seems that this isn't the case of the 6630 (ie: when you draw you are actually updating the display directly). This would explain the flickering.

You will notice that the Symbian sample assumes that the buffer returned by DirectScreenAccess is the actual display.

To make things safer, I will not assume this anymore. Instead, I will enable the optimization only for phones I know are double buffered.
Well done Thierry,

i made a simbolic donation (i'm already a registered user) to thank you for your time and patience :)

Hope to have soon latest version :)

Thanks again.