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

Scroll encoder works incorrectly if the speed is <100% #4440

Open
GUAN-Xihao opened this issue Dec 13, 2024 · 10 comments
Open

Scroll encoder works incorrectly if the speed is <100% #4440

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

Comments

@GUAN-Xihao
Copy link
Contributor

GUAN-Xihao commented Dec 13, 2024

Describe the bug
Part of the rendering area has not been updated while scrolling. (I can reproduce it on other software, but firefox is the most commonly used one.)

To Reproduce
Steps to reproduce the behavior:

  1. xpra start :zz -d video
  2. xpra attach ssh://xx:yy/zz
  3. Currently, the speed should be Fixed Speed: Auto, Minimum Speed: 1% (default settings from GUI)
  4. Open a Firefox (129.0.2), and then scroll up and scroll down the page very fast use mouse wheel.
  5. The following is the incorrect rendering.
    image
    And we found this is H264.
2024-12-13 15:22:35,097 video_encode('auto', XShmImageWrapper(BGRX: 0, 0, 1095, 554), typedict({'quality': 70, 'speed': 80, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'av-delay': 0, 'window-size': (1095, 554), 'damage-time': 1560201.408667398, 'process-damage-time': 1560201.446648618, 'depth': 24})) image size: 1095x554 , encoder/csc size: 1094x554
2024-12-13 15:22:35,098 video_encode x264 encoder: h264 1094x554  result is     165 bytes,   682 MPixels/s, client options={'frame': 2, 'pts': 1163, 'csc': 'YUV420P', 'full-range': True}
  1. No error was found around the operation logs. (note: with -d video)
  2. The following combination is tested, all quality settings are auto.
    a . Encoding: Auto, Fixed Speed Auto, Result: incorrect. (effected encoder: H264)
    b . Encoding: H264, Fixed Speed Auto, Result: incorrect.
    b1. Encoding: H264, Fixed Speed Lowest Lentency (100%), Result: Looks good.
    b2. Encoding: H264, Fixed Speed Lowest Bandwidth (1%); Average (50%), Low lentency(70%) ( Result: Incorrect.
    c . Encoding: JPEG, Fixed Speed Auto, Result: Looks good.
    c2. Encoding: JPEG, Fixed Speed Lowest Bandwidth (1%), Result: Looks good.
    d . Encoding: VP8, Fixed Speed Auto, Result: Looks good.
    d2. Encoding: VP8, Fixed Speed Lowest Bandwidth (1%), Result: Looks good.

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

  1. NVENC is disabled on the server side.
  2. It seems like I can reproduce it since at least 6.1.x. (To be double confirmed)
  3. Not tested on NVGPU (TBD)'
  4. It looks like if the window of Firefox is larger, it is easier to trigger the behaviour. (Most time I maximize Firefox to test)
  5. The incorrect rendering will auto-recover while moving the mouse over the page and wiggling it a couple of times.
@GUAN-Xihao GUAN-Xihao added the bug Something isn't working label Dec 13, 2024
@totaam
Copy link
Collaborator

totaam commented Dec 13, 2024

@GUAN-Xihao can you reproduce with / without opengl enabled? (--opengl=no|force)

This sounds like what 775d435 was meant to fix?
Do you have any desktop scaling enabled?
Can you change the scaling settings?

@GUAN-Xihao
Copy link
Contributor Author

GUAN-Xihao commented Dec 13, 2024

Retested with the following options:

  1. Disconnect multiple monitors, only use one. Change the Windows Scale (HiDPI setting) to 100%, and sign off the PC, then relogin.
  2. Run the following commands to verify if it is related to opengl or desktop scaling.
Xpra_cmd.exe attach ssh:// -d video --opengl=force --encoding=h264 --speed=1
Xpra_cmd.exe attach ssh:// -d video --opengl=no --encoding=h264 --speed=1
Xpra_cmd.exe attach ssh:// -d video --opengl=no --encoding=h264 --speed=1 --desktop-scaling=off
Xpra_cmd.exe attach ssh:// -d video --opengl=force --encoding=h264 --speed=1 --desktop-scaling=off

Result: all can reproduce the issue. This issue can not be workaround by opengl options or desktop scaling.

@totaam
Copy link
Collaborator

totaam commented Dec 13, 2024

Please try --encodings=no-scroll.

@GUAN-Xihao
Copy link
Contributor Author

Please try --encodings=no-scroll.

Yep, you've got it. All the following looks good. --encodings=no-scroll is the workaround.

Xpra_cmd.exe attach ssh:// -d video --opengl=force --encoding=h264 --speed=1 --encodings=no-scroll
Xpra_cmd.exe attach ssh:// -d video --opengl=no --encoding=h264 --speed=1 --encodings=no-scroll
Xpra_cmd.exe attach ssh:// -d video --opengl=no --encoding=h264 --speed=1 --desktop-scaling=off --encodings=no-scroll
Xpra_cmd.exe attach ssh:// -d video --opengl=force --encoding=h264 --speed=1 --desktop-scaling=off --encodings=no-scroll

@totaam
Copy link
Collaborator

totaam commented Dec 13, 2024

FYI: as per the docs, you should never need to set --encoding=.
Use speed and quality instead.

@GUAN-Xihao
Copy link
Contributor Author

FYI: as per the docs, you should never need to set --encoding=. Use speed and quality instead.

Got it, I just want to make sure it is H264 encoding. It would be equivalent if I set it via GUI Picture -> Encoding -> H.264, am I correct?

BTW, I tried the following is working well.

-d video --opengl=force --speed=1 --encodings=no-scroll

@totaam
Copy link
Collaborator

totaam commented Dec 13, 2024

Got it, I just want to make sure it is H264 encoding.

Best to leave it to the xpra server, it usually knows best.

@GUAN-Xihao
Copy link
Contributor Author

Got it, I just want to make sure it is H264 encoding.

Best to leave it to the xpra server, it usually knows best.

Thanks for clarifying it. Xpra server will choose the best encoding and mix using multiple encoding.
The reason why I try to force using H264 is due to test for this issue. It can only reproduce on H264 encoding (includes auto encoding if server uses H264). So, forcing H264 is for testing purposes.

Normal daily usage I will leave it as auto. (Maybe --no-scroll as for now?)

@totaam
Copy link
Collaborator

totaam commented Dec 13, 2024

Makes sense!

@GUAN-Xihao GUAN-Xihao changed the title H264 encoder works incorrectly if the speed is <100% Scroll encoder works incorrectly if the speed is <100% Dec 17, 2024
@GUAN-Xihao
Copy link
Contributor Author

Makes sense!

Hi totaam, I have edited the title from H264 to scroll. It should beklongs to the scroll encoding issue.

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