PocketMatrix forums

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

HP rx5900 series firmware issues cause display problems

The PocketTV Team · 08 Feb 2007, 12:28 UTC
Users have reported incorrect / garbled display when running PocketTV on the new HP Ipaq rx5900 series.

Since PocketTV uses the same technique used by many games and video application for direct access to the frame buffer, it is likely that other applications and games will experience similar problems.

We don't have actual information about the problem on this device, but apparently it is caused by one of the following:

- The orientation returned in incorrect (orientation 0 should always correspond to Portrait orientation on Pocket PC devices)

- The frame buffer data returned by GETRAWFRAMEBUFFER or by GAPI is not in the Portrait orientation (on Pocket PC, GETRAWFRAMEBUFFER and GAPI should always return data corresponding to a Portrait-oriented buffer).

Please let us know if you have more information regarding those firmware issues on the HP Ipaq rx5900 series.

Thanks!
The PocketTV Team · 09 Feb 2007, 06:18 UTC
see report about the firmware bugs we found here: http://www.modaco.com/index.php?showtop ... ntry804775
In looking at the HP website, this device appears to be a native landscape device (320x240).

I was under the impression that GAPI and GETRAWFRAMEBUFFER would return the memory address of pixel (0, 0) when the display is in its native orientation. I take "native orientation" on this device to be a width of 320 and height of 240 pixels.

Are you saying that GETRAWFRAMEBUFFER isn't returning these values?

I'd be interested to know what's returned in the DDSURFACEDESC struct when you create a DDraw primary surface and lock it. I'm done with using that GAPI/GETRAWFRAMEBUFFER nonsense and I only use DDraw now.
The PocketTV Team · 09 Feb 2007, 09:17 UTC
> In looking at the HP website, this device appears to be a native landscape device (320x240).

it it correct that the device is meant to be used mostly in Landscape, based on its design and of the position of the buttons. and it probably uses Landscape orientation after a reset.

but what is your definition of a "native Landscape" Pocket PC?

there are a number of HTC devices that have a keyboard and when the keyboard is opened, the device displays in Landscape orientation automatically.

as far as i know there is no official definition of what a "native Landscape" Pocket PC is, and more importantly, there is no API that would tell an application if a Pocket PC is "native Landscape" or "native Portrait".

All you can get is the current UI orientation, which can be either Portrait or Landscape. And i'm quite certain you can set the screen orientation of this device to Portrait with Settings > Screen, if you want to.

until this device, raw frame buffer data returned by GAPI or by GETRAWFRAMEBUFFER was always assuming Portrait orientation on Pocket PCs (except on various devices like early iPaqs that had completely bogus display firmware).

> I was under the impression that GAPI and GETRAWFRAMEBUFFER would return the memory address of pixel (0, 0) when the display is in its native orientation.

I would have no problem with that if there was an un-ambiguous definition of what you call "native orientation" of a device, and if there was an API to determine what is the "native orientation" of the device. but as far as i know, there is no such API.

> I take "native orientation" on this device to be a width of 320 and height of 240 pixels.

That appears to be the default orientation after a reset.

What API do you use to determine what is the "native orientation" of the device? (which may be different from the "current" UI orientation, as you know, on Pocket PCs).

When I ask the current UI orientation, the system tells me it is rotated 90 degres to the right, based on the "zero-degre" orientation. So if the "zero degre" orientation, i.e. the reference, is what you call the "Native orientation", then the native orientation of this device is "Portrait" like every other Pocket PCs.

> Are you saying that GETRAWFRAMEBUFFER isn't returning these values?

GETRAWFRAMEBUFFER is not implemented on this particular device. and on the device where GETRAWFRAMEBUFFER is implemented, it returns a frame buffer, and horizontal/vertical pitch and dimentions, but it does not tell you what is the "native orientation" of the device.

> I'd be interested to know what's returned in the DDSURFACEDESC struct when you create a DDraw primary surface and lock it. I'm done with using that GAPI/GETRAWFRAMEBUFFER nonsense and I only use DDraw now.

please try and let us know.
This is one of the reasons why I use DirectDraw for frame buffer access instead of one of the older deprecated methods.

DDraw will return the correct memory address, width, height, X-pitch, and Y-pitch values based on the current display mode/orientation. These returned values change as the orientation changes. My game therefore knows that the memory address returned by IDirectDrawSurface::Lock is going to be at the upper-left pixel location (0, 0) no matter what the current display mode/orientation is.
The PocketTV Team · 22 Feb 2007, 03:50 UTC
another Rx5900 thing that we noticed:

This is the first Pocket PC where orienting the screen in "Portrait" orientation causes the display to be in fact oriented in "Up-side-down" orientation, i.e. causing ChangeDisplaySettingsEx to return DMDO_180. All the other Pocket PC use DMDO_0 when set in "Portrait" orientation.

This issue can cause problems with applications that do things differently depending on the screen orientation. Many such applications have never been tested with DMDO_180 and might not work correctly in that case.

In fact, i remember asking a MSFT engineer at the last MEDC conference if we should worry about making sure that applications should run in the DMDO_180 orientation, and the answer i got was: don't worry about it, the Settings only allow 3 orientations: Portrait (DMDO_0) and Landscape right and left, but not "up-side-down" DMDO_180. That was true at the time, but the advice given proved to be wrong, he should have said: "yes, some device will run in DMDO_180 orientation, so make sure you support it."


also, users have reported problems with several applications and games on the Rx5900 series (not a surprise indeed), including issues with MSFT's own Nine Hole Golf provided for free on Microsoft WM website.

it's funny that MSFT did not even test their own game on the device!
joshbu [MSFT] · 28 Feb 2007, 18:06 UTC
The PocketTV Team wrote:another Rx5900 thing that we noticed:

also, users have reported problems with several applications and games on the Rx5900 series (not a surprise indeed), including issues with MSFT's own Nine Hole Golf provided for free on Microsoft WM website.

it's funny that MSFT did not even test their own game on the device!


Well, AFAIK, no device should be able to return DMDO_180. The fact that HP was able to get away with it seems to indicate that something’s up. I'll look into it.

In the meantime, it's also worth noting: we don't test every device by every OEM. We produce a test suite and a logo program to assist the OEMs in QA. In many cases OEMs add third party applications and code that we do not have licenses for.

Now, in this particular case, there may be an issue in the Nine Hole Golf game, or elsewhere. If you PM me more information about the issues, we'll look into it.
The PocketTV Team · 28 Feb 2007, 22:56 UTC
> Well, AFAIK, no device should be able to return DMDO_180. The fact that HP was able to get away with it seems to indicate that something’s up. I'll look into it.

that was our impression, too - unless of course if a third-party application did set the orientation to DMDO_180, which is not disallowed, but can cause all sorts of problems, since manufacturer's drivers generally do not rotate the D-pad key correctly in this case. another questionable situation...

but we have the proof that this happens on this device (when the orientation is set to portrait with the standard Setting screen applet), because it triggers a fail-safe test on DMDO_180 in our code!

> In the meantime, it's also worth noting: we don't test every device by every OEM. We produce a test suite and a logo program to assist the OEMs in QA.

i know, but unfortunately there are some important things that are not correctly tested by the platform test suite. the latest example is the very serious "spurious private messages" bug that is described here: http://www.modaco.com/Motorola-Q-Spurio ... 42539.html

we discovered yesterday that this bug is present on the new O2 Xda Zinc. It was first reported 8 months ago (on the Motorola Q) and confirmed by Motorola engineers, and we have reported it numerous times to make sure MSFT knows about it, but ne never got any feedback that it got on the MSFT radar, and the fact that new O2 Xda Zinc has the bug probably indicates that no-one at MSFT is aware of this issue.
joshbu [MSFT] · 01 Mar 2007, 17:28 UTC
OK, so I spoke with one of our low level GDI guys, and basically here's what he said:

The return value from ChangeDisplaySettingsEx is allowed to be any of the orientation values for Windows Mobile. The reason is that it represents both the way the screen is installed in the device and the way the OS is currently set.

He did seem to indicate that DirectDraw should still always be providing the correct data for screen buffer iteration.

I'll still look into this golf game. Maybe it is an app issue?
The PocketTV Team · 01 Mar 2007, 23:17 UTC
the problems that we reported are not DirectDraw related.

see our detailed posting here: http://www.modaco.com/index.php?showtop ... ntry804775

basically GETGXINFO (and therefore GAPI) return a buffer that is landscape oriented.

the buffer returned by GETGXINFO should always be Portrait oriented.

this is not explicitely defined in any MSFT documentation, but unless it is the case, GAPI will not work correctly.

so it is a bug caused by a fuzzy / ambiguous MSFT specification. if a call (like GETGXINFO or GETRAWFRAMEBUFFER) returns a buffer that is un-related to the current UI orientation (which is the case for theos two calls), then the orientation of this buffer should be "absolute" i.e. related to DMDO_0 (the "native" orientation of Pocket PC's, which is portrait).

also, "The return value from ChangeDisplaySettingsEx is allowed to be any of the orientation values for Windows Mobile" might be true, but it contradicts what MSFT engineers told developers at the last MEDC conference:

i remember asking a MSFT engineer at the last MEDC conference if we should worry about making sure that applications should run in the DMDO_180 orientation, and the answer i got was: don't worry about it, the Settings only allow 3 orientations: Portrait (DMDO_0) and Landscape right and left, but not "up-side-down" DMDO_180. That was true at the time, but the advice given proved to be wrong, he should have said: "yes, some device will run in DMDO_180 orientation, so make sure you support it."

Another interesting fact regarding "The return value from ChangeDisplaySettingsEx is allowed to be any of the orientation values for Windows Mobile": if you set most other devices to a DMDO_180 orientation (using third-party software), the D-pad keys either won't work or will not be rotated correctly. this means that most OEM drivers do not support DMDO_180 orientation. this indicates that OEM's are not aware that they should support DMDO_180 orientation in their drivers.

it also indicates that the MSFT platform tests does not test that OEM's D-pad drivers supports DMDO_180 orientation correctly (on all versions of the OS where ChangeDisplaySettingsEx is implemented, i.s. 2003SE and upper).

> I'll still look into this golf game. Maybe it is an app issue?

this golf game uses GAPI, and because of the problem in GETGXINFO, GAPI returns a landscape-oriented buffer. and since GAPI is supposed to always returned a Portait oriented buffer, it can confuse many GAPI-based applications and games.
joshbu [MSFT] · 02 Mar 2007, 00:49 UTC
The PocketTV Team wrote:<snip>


So, we're trying to keep GAPI limping along for backwards compatability, but new code should really use DirectDraw, precisely becuase GAPI is not fully defined and not uniformly supported in display drivers.

For the ChangeDisplaySettingsEx concern: did the device report that it supported DMDO_180? I'll speak to our test guys. It sounds like there might be a hole in our suite here. (Set the device into all display orientations it claims to support and test display and dpad)

As far as the engineer at MEDC, I'm sorry you got bad information. I know how frustrating it is to get two different stories from two different people. If you PM or email me the presenter's name, we can straighten this out.
The PocketTV Team · 02 Mar 2007, 01:02 UTC
> So, we're trying to keep GAPI limping along for backwards compatability, but new code should really use DirectDraw, precisely becuase GAPI is not fully defined and not uniformly supported in display drivers.

we are aware of that. we try not to use GAPI, and since we have not implemented support for DirectDraw yet, we tend to rely on GETRAWFRAMEBUFFER in the mean time.

unfortunately the Rx5900 series does not implement GETRAWFRAMEBUFFER - they could have implemented it, there is no technical reason for not having it, but apparently they chose not to.

> For the ChangeDisplaySettingsEx concern: did the device report that it supported DMDO_180?

yes (it returns no error), and the display will rotate up-side-down, so it is clearly supported on all the 2003SE (and later) devices that we tested. but on some devices (e.g. Dell Axim x30) the D-pad does not work when the display is set with DMDO_180.

> I'll speak to our test guys. It sounds like there might be a hole in our suite here. (Set the device into all display orientations it claims to support and test display and dpad)

i think the test currently tests all the orientations except DMDO_180, even though it is supported by the device. but the Settings>Systen>Screen applet usually does not allow setting it to DMDO_180. only a direct call to the API can set to DMDO_180 (except for the Rx5900 series, of course).

> As far as the engineer at MEDC, I'm sorry you got bad information. I know how frustrating it is to get two different stories from two different people. If you PM or email me the presenter's name, we can straighten this out.

i don't recall the name, but at the time, changing orientation was quite new, and they told us what they thought was the correct information. since no device would use DMDO_180 (in normal operation) at the time, most OEM and ISV developers figured that it was not necessary to spend time testing applications (and drivers) with DMDO_180.
We got so sick of devices not implementing Raw frame buffer and/or GAPI correctly that we just the GDI now. It is slower, but the devices are so much faster now it doesn't make any differences. So if the device is old (not WM 5.x) we use GAPI and everything else is GDI. DirectDraw is not an option for use as we want full backward compat all the way to PPC 2002. ie; we want one SKU. For more advanced graphics we are using OpenGL-ES or D3DM, so the performance of GDI is pretty much a non-issue.