-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
screen corruption with fedora40 display client #4300
Comments
For completenes: these are the versions of the packages in which the problem is already
|
None of these libraries are used by xpra. This type of visual corruption makes me think that perhaps there is some race condition between the application painting the screen and xpra capturing the screen updates from the X11 server. |
Good. That narrows it down.
It is actually libmpv that does the drawing, through a callback in user code. Basically, when mpv has a new frame ready, it calls a callback functio.
Also worth noting: the opengl context is created per thread. |
OK, so you're drawing with OpenGL. At this point, I think it's likely that something is going awry there, not in xpra. Especially when this type of visual artifacts has never been reported. To verify this, can can dump the virtual screen contents at two points, before they are sent to the client:
If these images are also corrupted, then xpra is only compressing what it is receiving. |
I am not using VirtualGL. I have tried a few things
Additional information: server.log shows one error: Also: when I run neumodvb on the native Xserver and then use xpra shadow, also everything works fine. The type of distortion (vertical lines, pixels, triangles) seems to be specific per channel (always the same So, following your analysis, I think it is safe to assume that the corruption happens before xpra starts processing From the point of view of wxwidgets, mpv, and my code everything seems to work fine, which does of course From the point of view of xpra, also everything seems fine, except that it reads corrupted data. How does xpra read the data from the screen in case some openGL is displayed on it? Any ideas for further debugging? It would already be nice to be able to pinpoint where exactly the problem is. Although probably unrelated: I also noticed some background colour flashes. These go away when I force |
It is not meant to.
This was meant to be used on the server, not the client.
Please include the full details of the error
Looks like it.
Same as non-opengl: using XShm: xpra/xpra/x11/bindings/ximage.pyx Line 617 in 3c39850
These would likely be opengl |
So how does one actually start the server command manually in this case? About the "unmanaged x11 context error": the server log was attached to my message above. You can check |
Login to your server via ssh, then run |
I don't think this properly works:
The server runs the expra debug version. The client the non-debug version. xpra info :99 |grep SAVE shows that the variable is set. |
It is, just not where you're looking, add
Any errors in the server log / output or client output?
There are no debug versions, do you mean beta? |
Ok. with --no-daemon the saved pictures appear. They show exactly what is appearing client side
For the experiment of today, it seems the log is not written to server.log but to the terminal. The most noteworthy is the "unmanaged X11 context", which has a python stack trace.
which could well be related to the problem. Here is the log:
|
So it looks like the X11 server is giving xpra these same pictures and the visual corruption is happening before xpra.
Yes, that's how it works.
This is unrelated and fixed in eb50717 |
In summary I will see if I can somehow downgrade mpv_lib to earlier versions by recompiling it. It seems Another strange thing is that I can get one of the TV channels to work perfectly after I try a few times to |
Perhaps.
What screenshots? Did you use a screenshot tool with If it was me I would:
Both options are documented here: |
Yes. They just show the same corruption as what is displayed on screen.
I have never used virtualgl, and whatever I do needs to be compatible with mpv-libs. I would not even A quick inspection of Virtual-GL does not really explain how to use it. I also fail to see the benefits. All that is rendered is
Well yes, I have done that many times before without any problems.
|
From within the xpra session:
With xpra as window manager? That's surprising as it is not easy to setup.
One more thing worth trying is to run your server with: XPRA_XSHM=0 xpra start .. This will make the server's pixel capture code much slower, it may have an effect on your visual corruption, one way or the other. |
I wish to would explain that better on their main page.
No a shadow display: on the client
Yes, that is what I thought.
I tested. Screen corruption is also there. |
I made some further experiments, which involve ONLY selecting a different version of libmpv (everything else I have now found two versions that differ in exactly one line of code. The older one works without All this commit does is changing a default scaler to another one:
`- {{"mitchell", .params={NAN, NAN}}, {.params = {NAN, NAN}},
` I have tried reverting this patch on master, but then screen corruption still occurs. In general I have found that the number of occurrences of screen corruption drops to quite low levels Of course it is possible that the one liner triggers some kind of memory corruption, but that seems unlikely. Also, I have noticed with some versions of mpv (especially the newer ones) screen corruption in textual areas, That too points to "each program separately is working as it should but because of differences in when things are The fact that the corruption remains constant over time also points to decision that is made somewhere and One last hypothesis is that there is something specific about framebuffer formats in XDummy versus |
I also found an example of an other program that shows screen corruption when run under xpra as seamless: The code requires some minor adjustments to compile (remove the last nullpt in When running this demo multiple times
If I try the older mpv version, it seems to work always without distortion |
How odd, perhaps this changes how the application paints the screen and reports it to the X11 server - you can see this with the server's
It certainly looks that way, but we get the buffers with the XShm calls I had linked to previously, these have been unchanged for ~12 years or so and have never caused problems with any libraries. Another idea: do you have speaker forwarding enabled? |
I did not try that yet, but I did try -d encoding and -d regiondetect
It is almost certainly used by mpv-libs
If the (dummy) server renders things differently now than 10 years ago (because of newer libraries) then XShm
Do you mean audio? Yes, using pipewire. It is worth a try. |
Again, I'm not sure if / how that accesses the GPU from an Xvfb context.
That's why I had suggested using
No, xpra has its own audio forwarding switch, when enabled it will try to sync screen updates with the audio. |
vglrun does not work Here is a log file file obtained during corruption. The video showed a hige number of black regions and for comparison also a log file without distortion (exact same code). So far I have not self compiled xpra, so the test of the patch will be for later |
And here are some results with the videocube program. Now another run shows a good result (although it is not entirely good: black rectangles appear You may wish to try this videocube example yourself to see if you can reproduce. It does require a recent |
This could well be a broken vgl downstream package: VirtualGL/virtualgl#139
Nothing stands out.
You don't need to compile from source, you can just patch your existing installation. |
I managed to run it like this So far I cannot reproduce screen corruption with this. Also the "channel remains black when attached are two (debug damage) log files
|
Right, so this is not an xpra bug but a problem with the software opengl renderer used with Xvfb / Xdummy. You may want to switch to xpra/fs/etc/xpra/conf.d/55_server_x11.conf.in Lines 30 to 47 in 9d980f5
|
I just tried Xvfb. It is running as: It also has screen corruption and "video not playing at start" problems
My guess is that xpra makes some wrong decision at an early stage of The wrong decision may be triggered by something external of course. |
That's some really weird visual artifacts!
Again, the problem is very likely to be caused by the opengl software rendering.
Every frame is grabbed in exactly the same way, and each frame is independent of the ones before it. BTW, I've just released xpra 6.1.0, it includes some the fixes discussed here. |
Quite pleased to see that the bug is not in xpra and that I had the correct suspicions 5 days ago: #4300 (comment) I am closing this issue as "invalid" because there is no bug in xpra, but do keep us posted on the opengl issues with the software renderer - many users rely on it and it would be great to know what is going wrong with it! |
virtualgl was a good recommendation after all. Hopefully there will be some progress on the |
The ticket tracking |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
server command
neumodvb.py
This is program I created myself. It scans satellite transmissions and displays video broadcast channels.
The program works as expected when run natively on the server
see https://github.com/deeptho/neumodvb
client command
ssh://tuf.mynet/99 --dpi=157 --start='terminator -p tuf'
or variants without the --dpi
specific action to trigger the bug
The above client commands start a terminal. Start neumodvb.py from that terminal:
neumodvb.py
and start playing a broadcast channel.The results depend on the channel and on window size (the window can be resized).
First,, the screenshot "good" shows what the correct output would be. On the left and bottom there is some
text. On the right a video is playing (in the example in a very old broadcast format). This screenshot was captured
using older versions of xpra (see below for details)
Some channels display nothing at all, although there is audio.
Other channels display almost correct video but with some vertical lines of black pixels.
See "lines"
Othe channels show sever distortion with some pixels present but most black. See "pixels"
The weirdest case shows pixels in a triangular region, with most other pixels black. See "triangle"
Note that the precise details of the corruption vary: the same channel sometimes works better
than other times. Also, at the start of the video I notice some colour flashing of the background of
the text regions.
System Information (please complete the following information):
Additional context
The "neumodvb.py" program works as follows. The video is rendered by libmpv and then possibly
overlaid with some graphics (not used in the examples) using the opengl interface of libmpv.
After a lot of experimentation with different xpra versions on different clients, I came to the conclusion
that only the server xpra version matters: the corruption occurs on older and newer client xpra versions
on older and newer fedora versions (38, 39,40).
Also, I tried two different computers for the server, and the problem occurs on both.
Both computers use intel embedded GPUs. One is quite old and another one is brand new.
It only occurs when the server is on fedora40, but it seems to depend on libraries used by xpra
and not on xpra itself: the stated xpra version can be made to work by downgrading libraries and
keeping the xpra version as stated above, By carefully downgrading various packages (not in a very orthodox way
as I had to override some dependencies to other packages, to narrow the list of suspect packages),
I found that one or more of the following libraries causes the problem when upgrading
to fedora40, whereas I get a good result if I use the fedora39 versions)
I also observed the xpra server logs with the "compress" debug option and I noticed that when the
problem was at its worst, almost no lines were added to the log file. On the other hand, the lines that were
there seemed normal (similar to those on a working system): using vp8, x265 etc... I did not keep the server logs...
I suspect it may be either a bug in the encoder code, or in the detection of the content type.
WIth the above downgrades, I have a working system, but of course this is not a permanent solution.
Also, with this working system, there are still a few minor problems which are probably unrelated and started
appearing in the more recent fedora39 versions:
-at the start of video playback the while window flashes in colour (black becomes some dark almost black colour 2 or three times and then things work fine)
-sometimes when moving the cursor over a window, the content turns briefly slightly green and then later goes back to
normal.
I can do some more testing if needed.
The text was updated successfully, but these errors were encountered: