You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by Larry Foard <La...@watchguard.com> on 2017/05/22 22:53:24 UTC

Power PPC byte order issues?

I've encountered a 16 bit RDP pixel byte order issue on power PC.


I can manually reorder the bytes in the 16 bit color pixel and it works, but doesn't otherwise.


This is likely a build issue,  people do seem to be using guacamole on PPC and PPC64?


Can anyone confirm that 16 bit RDP graphics are indeed known to work with guacamole running on a power PC system?

If so, where is the byte ordering normally adjusted?


Thanks

-Larry

Re: Power PPC byte order issues?

Posted by Larry Foard <La...@watchguard.com>.
The issue is very low level, involving the decoding of 16 bit graphics coming from the freerdp library.


The following work around fixes the issue, but may not be the "right" way to fix it. The #if _M_PPC block is the code I added.


The actual processing of RGB pixels by guacamole is fine. If this shows up in VNC it would be an independent issue.


src/protocols/rdp/rdp_bitmap.c:80


void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap) {

    /* Convert image data if present */
    if (bitmap->data != NULL && bitmap->bpp != 32) {

#if _M_PPC == 1

        if (bitmap->bpp == 15 || bitmap->bpp == 16) {

            /* flip byte order of pixels */
            unsigned short *s = (unsigned short *)bitmap->data;
            int size = bitmap->width * bitmap->height, i;

            for(i = 0; i < size; i++) {
                unsigned short p = s[i];

                /* flip bytes */
                s[i] = ((p & 255) << 8) | (p >> 8);
            }
        }

#endif

        /* Convert image data to 32-bit RGB */


________________________________
From: Mike Jumper <mi...@guac-dev.org>
Sent: Tuesday, May 23, 2017 11:00:56 PM
To: dev@guacamole.incubator.apache.org
Cc: Nick Couchman
Subject: Re: Power PPC byte order issues?

On Tue, May 23, 2017 at 10:06 AM, Larry Foard
<La...@watchguard.com> wrote:
>
> ...
> I've not tried VNC, its a little difficult to do so.
>

This would be perhaps the most helpful thing when narrowing down
whether this is a bug in Guacamole's handling of image data or in the
FreeRDP library.

The Guacamole protocol itself does not depend on byte order, as it's
ultimately just a stream of UTF-8 characters. The places could
conceivably be affected by byte order are:

1) Guacamole-specific image processing (testing other protocols would
confirm this)
2) FreeRDP's image processing (testing other protocols might confirm
this, too, as would testing FreeRDP's own native client)
3) libpng, Cairo, or similar image-related dependencies (unlikely, as
those library are all rather mature and have no doubt been used on PPC
in the past)

Off the top of my head, I don't believe Guacamole's image processing
makes any assumptions about byte order, but verifying that this
problem occurs regardless of whether RDP is used would demonstrate
that belief to be false.

- Mike

Re: Power PPC byte order issues?

Posted by Mike Jumper <mi...@guac-dev.org>.
On Tue, May 23, 2017 at 10:06 AM, Larry Foard
<La...@watchguard.com> wrote:
>
> ...
> I've not tried VNC, its a little difficult to do so.
>

This would be perhaps the most helpful thing when narrowing down
whether this is a bug in Guacamole's handling of image data or in the
FreeRDP library.

The Guacamole protocol itself does not depend on byte order, as it's
ultimately just a stream of UTF-8 characters. The places could
conceivably be affected by byte order are:

1) Guacamole-specific image processing (testing other protocols would
confirm this)
2) FreeRDP's image processing (testing other protocols might confirm
this, too, as would testing FreeRDP's own native client)
3) libpng, Cairo, or similar image-related dependencies (unlikely, as
those library are all rather mature and have no doubt been used on PPC
in the past)

Off the top of my head, I don't believe Guacamole's image processing
makes any assumptions about byte order, but verifying that this
problem occurs regardless of whether RDP is used would demonstrate
that belief to be false.

- Mike

Re: Power PPC byte order issues?

Posted by Larry Foard <La...@watchguard.com>.
cat /proc/cpuinfo


is telling me:


cpu        : e5500
revision    : 2.1 (pvr 8024 1021)


I've not tried VNC, its a little difficult to do so.


Another possibly relevant issue, this is cross compiled. However as far as I can tell it is correctly setting architecture as big endian.


Are people using this on the PPC with colors coming out correctly? If so I'd assume its a build issue somewhere on my end likely due to cross compile, if not it may be a guacamole bug.


Thanks

-Larry

________________________________
From: Nick Couchman <ni...@yahoo.com.INVALID>
Sent: Monday, May 22, 2017 6:56:23 PM
To: dev@guacamole.incubator.apache.org
Subject: Re: Power PPC byte order issues?

Larry,Also, can you specify which PPC platform you're running on - what hardware, chip, etc.?
-Nick

    On Monday, May 22, 2017 8:23 PM, Mike Jumper <mi...@guac-dev.org> wrote:


 Can you confirm whether the other protocols like VNC are similarly affected?

I'm curious whether this issue is specific to RDP / FreeRDP.

- Mike


On May 22, 2017 15:53, "Larry Foard" <La...@watchguard.com> wrote:

> I've encountered a 16 bit RDP pixel byte order issue on power PC.
>
>
> I can manually reorder the bytes in the 16 bit color pixel and it works,
> but doesn't otherwise.
>
>
> This is likely a build issue,  people do seem to be using guacamole on PPC
> and PPC64?
>
>
> Can anyone confirm that 16 bit RDP graphics are indeed known to work with
> guacamole running on a power PC system?
>
> If so, where is the byte ordering normally adjusted?
>
>
> Thanks
>
> -Larry
>




Re: Power PPC byte order issues?

Posted by Nick Couchman <ni...@yahoo.com.INVALID>.
Larry,Also, can you specify which PPC platform you're running on - what hardware, chip, etc.?
-Nick

    On Monday, May 22, 2017 8:23 PM, Mike Jumper <mi...@guac-dev.org> wrote:
 

 Can you confirm whether the other protocols like VNC are similarly affected?

I'm curious whether this issue is specific to RDP / FreeRDP.

- Mike


On May 22, 2017 15:53, "Larry Foard" <La...@watchguard.com> wrote:

> I've encountered a 16 bit RDP pixel byte order issue on power PC.
>
>
> I can manually reorder the bytes in the 16 bit color pixel and it works,
> but doesn't otherwise.
>
>
> This is likely a build issue,  people do seem to be using guacamole on PPC
> and PPC64?
>
>
> Can anyone confirm that 16 bit RDP graphics are indeed known to work with
> guacamole running on a power PC system?
>
> If so, where is the byte ordering normally adjusted?
>
>
> Thanks
>
> -Larry
>


   

Re: Power PPC byte order issues?

Posted by Mike Jumper <mi...@guac-dev.org>.
Can you confirm whether the other protocols like VNC are similarly affected?

I'm curious whether this issue is specific to RDP / FreeRDP.

- Mike


On May 22, 2017 15:53, "Larry Foard" <La...@watchguard.com> wrote:

> I've encountered a 16 bit RDP pixel byte order issue on power PC.
>
>
> I can manually reorder the bytes in the 16 bit color pixel and it works,
> but doesn't otherwise.
>
>
> This is likely a build issue,  people do seem to be using guacamole on PPC
> and PPC64?
>
>
> Can anyone confirm that 16 bit RDP graphics are indeed known to work with
> guacamole running on a power PC system?
>
> If so, where is the byte ordering normally adjusted?
>
>
> Thanks
>
> -Larry
>