Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

Flickering on new PocketHAL and new devices?


Flickering on new PocketHAL and new devices?

Postby jaguard » Jul 18, 2008 @ 4:52pm

There was an issue with flip operation when I didn't update the whole screen, but only the small rect.
I.e. when I called say display->Update(Rect(100,100,150,150)) to only update loading progress, display would flicker on some devices. This is absolutely true for PocketHAL 0.8.x (AFAIR) and ipaq h2110.

Now I would like to have this kind of optimization in a whole game, including gameplay - for battery saving purposes and also because framerate is not sufficient.
Will it work? Will it not flicker on all devices, especially new ones?

PS: Actually, I'm not using pure PocketHAL - it's PocketFrog, but I believe this flickering is PocketHAL's issue, not PocketFrog's.
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Postby Kzinti » Jul 19, 2008 @ 12:00am

Jaguard, the rectangle you specify to Update() can be used to optimize the update, but it isn't used to clip the update. Said another way, PocketHAL might update only the specified rectangle, a bigger area or even the whole screen.

The behaviour is this way for performance reasons and also because some devices / APIs simply don't allow the updating of sub-sections of the screen.

Let me know if this explains your problem or not. If you have genuine flickering, then it might be a problem with the (newer) device. You are encouraged to use update rectangles to save on battery power and for better performances.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby jaguard » Jul 19, 2008 @ 2:48pm

Kzinti wrote:Jaguard, the rectangle you specify to Update() can be used to optimize the update, but it isn't used to clip the update. Said another way, PocketHAL might update only the specified rectangle, a bigger area or even the whole screen.


So, if I get it right, I can in fact use this kind of optimization, but:

1. I should clip the render manually using display->SetClipping() - this is actually what I was planning to do.

2. On some devices the whole screen would be updated.

But tell me, what would happen if I don't draw anything outside the clipping rectangle (I.e. I did it only once, 300 frames ago), but pocketHAL would be forced to update the whole screen? Isn't it actually how this this flickering comes into place?

Let me know if this explains your problem or not. If you have genuine


Well, in fact it doesn't. I have to be sure that I won't get flickering on all current devices, and also on future ones (ok, say 99% of them).

If I'm not, I better use a "safer" way, though it is less effective - I will "prerender" the whole screen to texture and use it as a background. It should maintain fine framerate, but hardly save enough battery power.

flickering, then it might be a problem with the (newer) device. You are encouraged to use update rectangles to save on battery power and for better performances.


Actually, this h2210 which had this flickering issue, is a pretty old one.
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Postby Kzinti » Jul 19, 2008 @ 7:44pm

Ipaq 2110 or 2210? I actually have the latter and can try to replicate your problem, but I do not have access to a 2110.

Any chance you can send me some code that exposes the problem? (Here or by email).
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Kzinti » Jul 19, 2008 @ 8:23pm

OK, if you are talking about the Ipaq 2210, then I think I know what is going on.

The 2210 has a MediaQ chip. PocketHAL's MediaQ driver provides SWAP_DISCARD semantics by default (where most devices/drivers provide SWAP_COPY semantics). When you are only updating parts of the screens, you want to have SWAP_COPY semantics, otherwise you will get flickering outside your update rectangle.

Try initializing PocketHAL's display with SWAP_COPY and let me know how it goes.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby jaguard » Jul 19, 2008 @ 9:35pm

Yes, I have misspelled the number the first time - it really was 2210. I never had it, it's just that users were telling me that they are experiencing flickering while game was loading graphics.

I don't have a code, since I have rewritten this part, and the problem's gone once I started updating the whole screen. This was more than 2 years ago, but every time the idea of partial update came into my mind, I'd then recalled this issue and threw it away.

Try initializing PocketHAL's display with SWAP_COPY and let me know how it goes.

I have no idea how it goes(since I don't have such device), and I don't even know how to initialize PocketHAL this way. I struggled through the pocketfrog sources, and it looks like there's no direct way to access this structure. Allright, I can modify the Game framework, but will it help?

The 2210 has a MediaQ chip. PocketHAL's MediaQ driver provides SWAP_DISCARD semantics by default (where most devices/drivers provide SWAP_COPY semantics). When you are only updating parts of the screens, you want to have SWAP_COPY semantics, otherwise you will get flickering outside your update rectangle.


So I'll just hardcode SWAP_COPY all the time, and it will work on all devices, right? There's no way SWAP_COPY semantics wouldn't work?

PS: I thought that I add that it's not about h2210 - it's an old device, and I don't even care if the game doesn't works there. But I do care if it works on all other 100s of WM devices. And there's no way I could test all of them, so if there's a slightest chance for unexpected behavior (i.e. flickering), I'd better stick to a safer way.
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Postby Kzinti » Jul 19, 2008 @ 10:44pm

Yes SWAP_COPY will work on all devices. If you use an update rectangle, then yes, use SWAP_COPY and you will be fine.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby jaguard » Jul 19, 2008 @ 11:18pm

Thanks a lot, Kzinti! I'll stick with partial update then.
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum