Xpra: Ticket #650: R and B colours are swapped with WebP encoding and non-opengl windows

On 0.14.1 tray icons look funny (distorted colours) when "WebP" encoding is chosen. I can see this only on tray icons and only with WebP encoding... 0.13.9 was OK.



Thu, 21 Aug 2014 04:01:42 GMT - Antoine Martin: owner changed

That's odd, I can't reproduce (..), can you try with this very simple test application: browser/xpra/trunk/src/tests/xpra/test_apps/test_system_tray.py.

It works fine here and is definitely sent as webp:

$ xpra info | egrep "tray=|total_"
client.system_tray=True
window[1].total_frames[webp]=33
window[1].total_pixels[webp]=114816
window[1].tray=True

Please also post the output of ./xpra/codecs/loader.py


Thu, 21 Aug 2014 05:26:31 GMT - onlyjob:

xpra info (on server):

client.system_tray=True
window[1].tray=False
window[2].total_frames[rgb24]=23
window[2].total_frames[webp]=11
window[2].total_pixels[rgb24]=270372
window[2].total_pixels[webp]=5596648
window[2].tray=False
window[3].tray=False
window[5].total_frames[webp]=2
window[5].total_pixels[webp]=1152
window[5].tray=True
window[6].total_frames[webp]=2
window[6].total_pixels[webp]=1152
window[6].tray=True
window[7].total_frames[webp]=2
window[7].total_pixels[webp]=1152
window[7].tray=True
window[15].total_frames[webp]=2
window[15].total_pixels[webp]=1152
window[15].tray=True

loader.py (output for server and client is identical):

codecs and csc modules found:
* PIL                  : /usr/lib/python2.7/dist-packages/PIL/__init__.pyc
* enc_vpx              : /usr/lib/python2.7/dist-packages/xpra/codecs/vpx/encoder.so
* dec_vpx              : /usr/lib/python2.7/dist-packages/xpra/codecs/vpx/decoder.so
* enc_x264             : /usr/lib/python2.7/dist-packages/xpra/codecs/enc_x264/encoder.so
* enc_x265             :
* nvenc                :
* csc_swscale          : /usr/lib/python2.7/dist-packages/xpra/codecs/csc_swscale/colorspace_converter.so
* csc_cython           : /usr/lib/python2.7/dist-packages/xpra/codecs/csc_cython/colorspace_converter.so
* csc_opencl           :
* dec_avcodec          :
* dec_avcodec2         : /usr/lib/python2.7/dist-packages/xpra/codecs/dec_avcodec2/decoder.so
* enc_webp             : /usr/lib/python2.7/dist-packages/xpra/codecs/webp/encode.so
* dec_webp             : /usr/lib/python2.7/dist-packages/xpra/codecs/webp/decode.so
codecs versions:
* PIL                  : 2.5.1
* avcodec2             : 55.34.1
* cython               : 0.3.0.20.2
* dec_webp             : 0.4.0
* enc_webp             : 0.4.0
* swscale              : 2.1.2
* vpx                  : 1.3.0
* x264                 : 142

See attached image "tray-colors.png" with screenshot of "test_system_tray.py": icon on the left is the distorted one from Xpra session with WebP encoding; icon on the right is locally running app.


Thu, 21 Aug 2014 05:26:54 GMT - onlyjob: attachment set


Thu, 21 Aug 2014 05:58:38 GMT - Antoine Martin: owner, status changed

Hah, right, by distorted you don't mean that the picture's quality is degraded but that the colours are swapped, right? I didn't think of checking the colours!

I'll be able to test that better as soon as I figure out why the systray forwarding is misbehaving on Fedora 20... (I hope I don't have to deal with #405 just yet)


Thu, 21 Aug 2014 08:06:41 GMT - Antoine Martin: attachment set

what the colour test should look like


Thu, 21 Aug 2014 08:11:02 GMT - Antoine Martin:

Another really useful test for colour mixups is this one browser/xpra/trunk/src/tests/xpra/test_apps/colors.py, it should look like this: what the colour test should look like As you can see, it looks fine here with all colour encodings - does it on yours? (and pressing a key can be used to start or pause a gradual change in colours useful for testing other things)

Another test which can be useful is this one: browser/xpra/trunk/src/tests/xpra/test_apps/transparent_colors.py - especially considering that trays are transparent. It looks similar, except the window is part transparent and there is no animation


Thu, 21 Aug 2014 11:28:55 GMT - onlyjob:

Tried those test apps -- "transparent_colors.py" demonstrated a problem: swapped RED and BLUE (with WebP). "colors.py" is OK as well as other encodings.


Thu, 21 Aug 2014 14:08:37 GMT - Antoine Martin: attachment set

transparent colours look fine on Debian Jessie


Thu, 21 Aug 2014 14:09:19 GMT - Antoine Martin:

Well, well.

First, I wasted a lot of time trying to figure out why my updated Jessie VM failed to connect. It seems that something got updated very recently that completely broke the system tray support that we use (not that it ever worked properly under gnome3.. but now it deadlocks the whole application most of the time - sometimes it will work). Wheezy I cannot test because it ships a version of libwebp which is just too old. Debian Sid worked fine every time - I tried 20 times to be sure (well gnome3 still hides the tray somewhere, but it doesn't just hang like Jessie) - I even did a full system update to see if the recent broken update also affected it, nope: still worked. I hope this gets fixed in Jessie sooner rather than later, it is pretty debilitating. That's using a package OR installing from source. Both just hang at setting up the tray.

As you can see (after patching out the code that normally tries to setup the system tray): transparent colours look fine on Debian Jessie

It worked fine for me (as usual..). I tried enabling opengl to see if it matters, but that crashes in virtualbox. Can you try disabling/enabling it? I guess you don't use gnome3 then? KDE IIRC?


Thu, 21 Aug 2014 16:04:21 GMT - onlyjob:

Of course I tried enabling/disabling OpenGL -- it makes no difference. I'm on KDE but I doubt it could be significant. The strange thing is that I'm still attached to the session where I reproduced the problem but transparent colors now OK (I run test again -- too bad I didn't take screenshot to prove that I'm not crazy) ;) Tray icons show incorrect colours very reliably -- 100% (i.e. every time I choose WebP encoding)...


Thu, 21 Aug 2014 16:16:30 GMT - onlyjob:

I got it -- I was wrong regarding OpenGL -- it makes a difference. Red and Blue are swapped in transparent_colors test only when OpenGL is disabled. As soon as I tick OpenGL in Xpra menu colours are swapping back to normal.


Fri, 22 Aug 2014 04:09:47 GMT - onlyjob:

Looks like it is R-B colour swap issue not specific to tray... I just reproduced on nouveau with "transparent_colors.py"...


Fri, 22 Aug 2014 04:23:39 GMT - onlyjob:

I built libwebp-0.3.0 from source; re-built Xpra and reproduced both issues -- this one (i.e. R-B colour swap) and vertical stripes in konsole #651.


Fri, 22 Aug 2014 04:29:03 GMT - onlyjob:

Same problems with libwebp-0.2.1 but konsole distortion pattern is slightly different: squares instead of stripes...


Fri, 22 Aug 2014 04:47:54 GMT - Antoine Martin: summary changed

I've just seen it on Debian Sid, now I can reproduce the colour problem I should be able to fix it. The konsole one on the other hand (#651).. may be a different issue, maybe I need to also run the server on Debian for that one.


Fri, 22 Aug 2014 06:01:32 GMT - Antoine Martin: owner, status changed

Bug was that we assumed that the client can upload pixels in BGRA format... which is the case for the opengl backing, but not for the plain gtk pixmap one used as fallback. Just like #651, I am amazed that no-one noticed this with opengl disabled.

Fixed in r7405, more improvements (not strictly necessary) in r7406.

Does that fix things? Will backport this fix and r7402 before releasing 0.14.2


Fri, 22 Aug 2014 06:39:31 GMT - onlyjob:

Replying to totaam:

Fixed in r7405, more improvements (not strictly necessary) in r7406.

I tested both on 0.14.1 -- fixes work, problem solved. Thank you.


Fri, 22 Aug 2014 06:52:37 GMT - Antoine Martin: status changed; resolution set

Backport in r7407.

Thanks for testing!


Sat, 23 Jan 2021 05:01:57 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/650