gujjwal00 / avnc

VNC Client for Android
GNU General Public License v3.0
680 stars 60 forks source link

Not working with x11vnc's -ncache flag #227

Closed fishBone000 closed 6 months ago

fishBone000 commented 6 months ago
-ncache n

              Client-side caching scheme.  Framebuffer memory n (an integer) times that of the full
              display is allocated below the actual framebuffer to cache screen contents for  rapid
              retrieval.   So  a  W x H frambuffer is expanded to a W x (n+1)*H one.  Use 0 to dis‐
              able.

Connecting AVNC to -ncache flag enabled x11vnc server will...well say the scale of shared area over VNC is 1600x900, on AVNC it will look like a 1600x9000 screen, with the first 1600x900 area on top the shared desktop, while the rest 1600x8100 below is black, sometimes with artifacts.

fishBone000 commented 6 months ago

Expected:

+-------------+
|             |
|  1600x900   |
|             |
+-------------+

Actual:

+-------------+
|             |
|  1600x900   |  <- Screen being shared
|             |
+-------------+
|             |
|  1600x900   | <- Black, sometimes there's artifacts, like frozen windows
|             |    |
+-------------+    |
|             |    |
|  1600x900   | <- |
|             |    |
+-------------+    |
...
+-------------+    |
|             |    |
|  1600x900   | <- |
|             |
+-------------+
gujjwal00 commented 6 months ago

This is working as expected. Please see x11vnc FAQ.

Relevent portion: A drawback of the "-ncache n" method is that in the VNC Viewer you can scroll down and actually see the cached pixel data. So it looks like there is a bug: you can scroll down in your viewer and see a strange "history" of windows on your desktop. This is working as intended. One will need to try to adjust the size of his VNC Viewer window so the cache area cannot be seen.

fishBone000 commented 6 months ago

Oh, alright. RealVNC's VNC Viewer automatically adjusts the window, so I thought it's a bug of AVNC.

But, AVNC doesn't adjust the window automatically like VNC Viewer, I think VNC Viewer is better at this matter.
Plus I actually can't adjust the window in AVNC to suit the screen. I have to zoom in to let the top "real" screen fit the size of my physical screen, but AVNC stops me doing so at some point, as if there's a threshold of zooming.

fishBone000 commented 6 months ago
 +--+-------------+--+
 |  |             |  |
 |  |  1600x900   |  |  <- AVNC is not zooming in furthur!
 |  |             |  |     
 |  +-------------+  |
 +--|.............|--+
    |  1600x900   | 
    |             |
    +-------------+
         ....
gujjwal00 commented 6 months ago

You can try increasing Maximum zoom in Settings => Viewer

fishBone000 commented 6 months ago

Oh I see that setting, thanks.
I still hope that AVNC can auto adjust the window though, for better user experience.

gujjwal00 commented 6 months ago

The problem with this option is that its transparent to VNC clients like AVNC, even though that's an explicit goal. From AVNC's perspective, ther is no difference between a real 1600x9000 screen and a 1600x900 screen with -ncache = 9.

AVNC tries to fit the entire remote screen at 100% zoom, and that works well for the "normal" aspect ratios.

So my advice is to zoom-in to appropriate size and than save that zoom so you don't have to do it repeatedly. You can also lock the zoom so that it doesn't change in response to pinch gestures.

fishBone000 commented 6 months ago

I see, advice taken. Thanks!