Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RGB24/32 encoding will rendering black background as transparent #4446

Open
GUAN-Xihao opened this issue Dec 17, 2024 · 6 comments
Open

RGB24/32 encoding will rendering black background as transparent #4446

GUAN-Xihao opened this issue Dec 17, 2024 · 6 comments
Labels
bug Something isn't working encoding

Comments

@GUAN-Xihao
Copy link
Contributor

GUAN-Xihao commented Dec 17, 2024

Describe the bug
RGB24 encoding will render black background as transparent

To Reproduce
Steps to reproduce the behavior:

  1. xpra start -d video,compress
  2. xpra attach --encodings=rgb24 xpra attach --encodings=rgb32 (Note for readers: Please do not use the encodings option in normal use, as this will prevent xpra's heuristic automatic encoding selection, it is only used here for testing. )
  3. run xeyes
    image

Let's re-run xpra client without --encoding ; run xpra attach
image
It's black.

System Information (please complete the following information):

  • Server OS: RockyLinux 8
  • Client OS: Windows 11 with Intel 12th Gen iGPU only.
  • Xpra Server Version 6.2.2
  • Xpra Client Version 6.2.2 (Full build)

Additional context
If you do not use --encodings=rgb24, it can still be triggered, but you have to wait for the heuristic automatic encoding selection to pick rgb24.

Workaround as of now
Use --encodings=no-rgb24,no-rgb32 for now to disable these two encodings.

@GUAN-Xihao GUAN-Xihao added the bug Something isn't working label Dec 17, 2024
@totaam
Copy link
Collaborator

totaam commented Dec 17, 2024

That's odd, I will have to check this.
Normally, windows with transparency are sent using webp - which handles transparency just fine.
rgb24 should never be selected for windows with transparency as it will drop the alpha channel.
rgb32 should always work, as it doesn't modify the data in any way.

@GUAN-Xihao
Copy link
Contributor Author

I have a question, what is the expected behavior for Xeyes on Xpra?
Should the Xeyes window be transparent on Xpra or not?

@totaam
Copy link
Collaborator

totaam commented Dec 17, 2024

Yes, it should work just fine.
Must be a recent regression.

I just remembered, xeyes uses xshape and not an alpha channel.
But it should still work.

@totaam
Copy link
Collaborator

totaam commented Dec 17, 2024

I just remembered that this is only implemented for X11:

def set_shape(self, shape) -> None:
shapelog("set_shape(%s)", shape)
if not HAS_X11_BINDINGS or not XSHAPE:
return

This is a duplicate of: #893.

I'm a bit confused by your comments on encoding=rgb24.
rgb24 and rgb32 are not valid options for the encoding switch.

@totaam totaam closed this as completed Dec 17, 2024
@GUAN-Xihao
Copy link
Contributor Author

I'm a bit confused by your comments on encoding=rgb24. rgb24 and rgb32 are not valid options for the encoding switch.

Typo, it is encodings=rgb24 to force the Xpra use rgb24.

Understandably, XShape is not valid, and that’s fine. However, I’m curious—why do different encodings result in different renderings?

The reason I noticed this issue is that I came across a rendering problem in some closed-source software. Most of the time, it uses H264, but occasionally, small area updates outside the XShape area seem to rely on rgb24/32 for the update region. This results in inconsistent rendering. Given that XShape isn’t supported at the moment, it would be ideal if all encodings produced similar behavior.

For now, to help future readers, I think the workaround --encodings=no-rgb24,no-rgb32 is sufficient.

@totaam
Copy link
Collaborator

totaam commented Dec 17, 2024

why do different encodings result in different renderings?

This looks like a bug to me.

For now, to help future readers, I think the workaround --encodings=no-rgb24,no-rgb32 is sufficient.

Turning off all rgb encodings is very wasteful, they are order of magnitudes more efficient for small areas.
Keeping just one might be enough.

@totaam totaam reopened this Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working encoding
Projects
None yet
Development

No branches or pull requests

2 participants