Wlroots: Getting blank images from screencopy

Created on 10 Aug 2018  Â·  7Comments  Â·  Source: swaywm/wlroots

With the latest git master of both wlroots and sway, screencopy is giving me images that are the correct dimensions, but fully transparent. This occurs with both the wlroots screencopy example, and with grim.
First noted at emersion/grim#17
My graphics card is a GeForce GTX 970 and I use nouveau, which I guess could be a significant part of the problem! (Yep, I know it's a bad card to use with Wayland, but I bought it about a year before I started using sway.)

bug

Most helpful comment

All right, good news! This line in the log says that the format used is 1, aka xrgb8888 according to the docs:

[email protected](1, 1920, 1080, 7680)

This means that (contrary to argb8888) the alpha channel isn't meaningful and should be discarded. Some drivers might fill it with 1, some with 0, some with garbage, which explains why this isn't reproducible an all setups. Also some other setups might use argb8888 (or another format).

So in the end this is a client issue: we need grim and the example screencopy client to discard the alpha channel if necessary.

All 7 comments

Thanks. Can you try the old screenshot example?

That gives me display doesn't support screenshooter…

Oh, right, of course, it has been removed from sway. Can you try with rootston?

Well this is odd. On rootston, all three work, screenshot, screencopy and grim. So I guess it's a sway issue…

This makes me think, maybe there's an alpha channel trick involved. Maybe the image data is there but alpha is set to 0. Can you upload your transparent screenshot?

That did cross my mind, but I didn't get around to checking. But I just opened one in GIMP, and you're absolutely right! The image is there, it's just the alpha channel set to zero!

All right, good news! This line in the log says that the format used is 1, aka xrgb8888 according to the docs:

[email protected](1, 1920, 1080, 7680)

This means that (contrary to argb8888) the alpha channel isn't meaningful and should be discarded. Some drivers might fill it with 1, some with 0, some with garbage, which explains why this isn't reproducible an all setups. Also some other setups might use argb8888 (or another format).

So in the end this is a client issue: we need grim and the example screencopy client to discard the alpha channel if necessary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ddevault picture ddevault  Â·  5Comments

maletor picture maletor  Â·  4Comments

emersion picture emersion  Â·  5Comments

acrisci picture acrisci  Â·  5Comments

m01 picture m01  Â·  3Comments