-
Notifications
You must be signed in to change notification settings - Fork 60
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
Stuttering and off-sync rendering when other encodings than jpeg are used #92
Comments
I haven't tested much apart from Chrome and Firefox on my local desktop. |
That's why I am smoking this now ;) |
592da90 reverts isMobile ;) Adding it back restores normal playback. Now I am going to dump packets that fail to decode so we can investigate what's wrong with them. |
Or you could just add code to the error handlers in
|
|
so it will be available in the server-side error message
Are you going through a proxy? Anyhow, I've tested with and without the proxy, with and without If you can still trigger errors, perhaps we should save the bytearray of the offending image that fails to decode so we can inspect it. |
I have no |
Easiest way is to check the client connection on the server. The proxy is the server's client. So:
|
Oh, but I forgot, you're forcing jpeg-only somehow, right? |
So, I'm taking a random Blob from your log file and doing this with it in Python:
And although it looks wrong when I open it with an image viewer (only the very top of the image is present), none of the tools complain about it:
Or even directly to pillow:
The fact that the top of the image looks OK makes me think that the jpeg data is correct (the header is correct for a start) but perhaps the packet is incomplete somehow? Can you try with a desktop browser to confirm that the problem only occurs with mobile devices? |
I do specify "JPEG" in HTML5 advanced settings "Encoding" drop-down list |
Sure! On desktop Chrome 92 there are no issues. Trying to test with Firefox inside Firefox using profiles :) |
My bet is that browser codes treat any inconsistency in untrusted input as security risk and discard the whole image. Let me check why some NAL is broken. |
FYI: you can get the server to save all screen updates to file using:
It will then save a sequence of jpeg files with the exact contents as the draw packets. |
Which image editor did you use? Mine is Eye of Mate (eom) on Debian bookworm and it displays every file properly. Same with desktop Firefox. Now I will check them on mobile Chromium that initially failed decoding them. |
Well, recent commits introduced scroll issues if decoder worker is used. Recent, I mean yesterday ones. This manifests only on decoder worker on Android tab, and does not manifest if isMobile check is in place. |
What sort of problem? Errors? Visual corruption? My guess is that there's something odd going on with your setup and the scroll packets aren't skipped as they should be here: Lines 2785 to 2792 in ad665ea
You could try logging the |
Yes, the part of scrolled-out region rendered in the visible viewport, quite occasionally. Let me capture screenshots when I get back to that network (in 3-4 hours) and log the As for images failing to decode, the strange thing that every image displays properly even in Chromium for Android whose decoder produced the error output. i.e As a last resort I can try grabbing a logcat to see if there are any line numbers preceding the image decoding error. |
As expected, visual glitches are result of image decoding errors during fast scroll. I guess I need to build a debug flavor of Chromium to see what triggers the exact error. |
Meh! Firefox 91.2.0 for Android fails to decode every image supplied, the client window rendered has only borders & header and log file is full 9f "failed to decode image". |
What can cause this error:
with xpra-html5 master using Firefox 88 for Linux? |
I don't know, but it is a good thing that we have the data, we can feed it to the decoder as a smoke test and disable the worker if it fails to process this test. |
I can collect some in the runs tonight!
|
Yes, it is still disabled. Let me monitor the situation. |
#110 works smoothly but xpra-org/xpra-html5@master stutters without any error messages in Selecting |
You could run your server with |
You are right! The root cause is the selection of available encodings. Working revision selects
while the latest revision gives all supported encodings to the server:
so that server sends a mix of encodings. Some full-screen PNGs take up to 123ms compare to 30ms for JPEG for exactly same frame size! |
I don't understand why you have Selecting |
I can investigate this.
is fine if user did it explicitly. User knows better, isnt he? |
Absolutely not. Users have zero clue which encodings are best. The encodings switch is the most misused feature ever added. It makes zero sense to only use We need to offer a different UI, one that will allow users to select |
For me ot is the only way to watch videos from a remote computer smoothly. I'd be glad if the new combination of webp + rgb delivers same encoding stability and same or better quality but for now I'd like to keep using jpeg. |
I ran the following experiment. I use auto encoding on HTML5 side but vary encodings on server side playing the same YouTube video.
|
You misunderstand: I'm not saying that we should not use
This is not implemented yet, see also Xpra-org/xpra#3337. |
|
I moved Why dont we run encoding tests on server start? ie encode a set of predefined images just like in html5 client and build the codec preference list dynamically? |
Correct.
Sort of. The check in
Are you running xpra master?
Why bother sending samples when we can just embed them in the html5 client? For what benefit? |
After extensive testing :)
Yes, built this morning
Not sending anything. Just bake image sample into server asset and try encoding parts of it of various XxY size with different available encoders to measure encoding time and size on server. |
The server already validates all of its encoders and csc modules on start.
This can't be used to ascertain the relative performance of various encoders, not reliably. |
I reverted the configuration changes introduced in Xpra-org/xpra@39c8838 and testing with |
@basilgello I would much rather not revert the changes to
|
I meant I reverted them in local config file, testing different options :)
|
Yes, my network is stable |
sorry for delay, here is compress debugging log for Xpra-org/xpra@39c8838 and trunk html5 client with |
TILs:
So the pattern seems to be that in between lots of I'm still doing lots of fixing in this area, bear with me. |
Yes, 1280x720 :) |
@basilgello is this still an issue? |
From my testing yesterday, it is. Let me grab a Right now I do use completely stock configuration (i.e no |
So that's going to be without |
Now that the decode worker is enabled on mobile again (0f51cab), you should be getting |
Should be much improved thanks to #198 |
As previously mentioned in xpra bytes and strings conversiin issue, #20 broke smooth playback of JPEG-encoded stream in HTML5 client.
On my device (Samsung Galaxy Tab S 2014 tablet running LineageOS 14.1 and Chromium for Android 92), JPEG was far tge best encoding option that allowed me to watch even Youtube videos remotely nearly as smooth as they play natively in the same browser. The last commit working properly was b28eadd and I verified that an issue started around a0f50fd (so no lz4.js was removed yet!)
Launching the HTML5 client with
draw
andnetwork
debug options, I noticed that the stutter and the following spike in the network bandwidth usage (~6000kB/sec against ~300-1200kB/sec during normal operation) spews the following in Xpra server's debug log:So the issue is that a malformed packet is sent and immediately a spinner or notification pops up.
@totaam ?
The text was updated successfully, but these errors were encountered: