bk138 / droidVNC-NG

VNC server app for Android that does not require root privileges.
GNU General Public License v2.0
1.33k stars 191 forks source link

Wrong resolution on external Display (1920x1080 landscape) #188

Closed 5A52 closed 1 day ago

5A52 commented 8 months ago

Describe the bug Runing droidVNC-NG on external display reports wrong resolution to viewer

To Reproduce Needs external monitor

Ill try to explain with screenshots. Screenshots are from RVNC on another android phone because RVNC reports server resolution, but behavior is the same on any viewer, even on PC

Viewer in portrait mode Screenshot_20240128-125550_RVNC Viewer

Viewer in landscape Screenshot_20240128-125616_RVNC Viewer

Viewer with server resolution Screenshot_20240128-125626_RVNC Viewer

Different VNC server for android No idea why it scales down resolution (both, client and server are FullHD) but aspect ratio is correct. Screenshot_20240128-125714_RVNC Viewer

P.S. Input works, but sends touches to main phone display

bk138 commented 8 months ago

Thanks for reporting! Two thoughts:

5A52 commented 8 months ago

1 - yes, bVnc on android and reminna arch on a PC. I mentionned up there, screenshotst are from RVNC only because RVNC reports server resolution. 2 - I believe yes, if emulator emulates "secondary displays". It is also possible to simulate it from android Developer options, but simulating on a main display is a real mess. My screen is a HDMI attached to samsung note 9 phone.

bk138 commented 8 months ago

I don't have an MHL cable so if ever can only repro this w/ the emulator. Detailed steps of how one is able to reproduce this w/ the emulator would help a lot!

5A52 commented 8 months ago

Sorry Im not using emulator, unfortunatelly not a developer at all, but may be this will help: https://innovorder.dev/multi-screen-management-within-android-56ef9052f066 or this https://source.android.com/docs/setup/create/cuttlefish-multi-display Also I dont know how droidVNC-NG code gets display resolution/aspect ratio/etc, but I can provide any logs or other information from a physical hardware if you need. Like for example android reports my displays as:

#wm size -d 0
Physical size: 1440x2960
#wm size -d 2
Physical size: 1920x1080

And here is some ifo about input methods: https://source.android.com/docs/core/display/multi_display/ime-support

bk138 commented 8 months ago

Maybe you can try and download Android Studio which includes an emulator and try to reproduce. I can't fix this as I don't have the MHL/HDMI hardware and need another reproduce case.

5A52 commented 8 months ago

Sorry, I can not install android studio on an android phone (im using a phone as a kind of desktopPC). I believe you will easely reproduce the bug with emulator, chose landscape aspect ratio for secondary display. Detailed steps in the first link are:

Click on the 3 dots in the toolbar to open Extended Controls Choose Displays on the vertical menu Click on the button Add secondary display You could choose a pre-defined resolution or set a custom one (1920x1080 or 960x540 here) Click on Apply Changes

As I mentioned on 4th screenshot "Alpha VNC Lite" which is Android VNC server also, does not have this bug.

RaulMerelli commented 6 months ago

I'm not using an external Display, but I have some resolution issue. The screen is vertical 800x480 px, but seems to appear almost a square (800x768), with a black band on right. Tried with RealVNC and UltraVNC as viewers. When the screen is horizontally rotated, the black band on the right is smaller (resolution 832x480). Looking on ADB is correctly reporting the original screen resolution: Display DisplayDeviceInfo{"droidVNC-NG": uniqueId="virtual:net.christianbeier.droidvnc_ng,10230,droidVNC-NG,0", 480 x 800, modeId 4, defaultModeId 4, supportedModes [{id=4, width=480, height=800, fps=60.0, alternativeRefreshRates=[]}], colorMode 0, supportedColorModes [0], hdrCapabilities null, allmSupported false, gameContentTypeSupported false, density 240, 240.0 x 240.0 dpi, appVsyncOff 0, presDeadline 16666666, touch NONE, rotation 0, type VIRTUAL, deviceProductInfo null, state ON, committedState UNKNOWN, owner net.christianbeier.droidvnc_ng (uid 10230), frameRateOverride , brightnessMinimum 0.0, brightnessMaximum 0.0, brightnessDefault 0.0, FLAG_PRIVATE, FLAG_PRESENTATION, installOrientation 0}

bk138 commented 6 months ago

@RaulMerelli i think you're experiencing #145 actually?

RaulMerelli commented 6 months ago

@bk138 Sorry, I didn't see that there was this specific issue. Seems exactly the same problem.

bk138 commented 6 months ago

@bk138 Sorry, I didn't see that there was this specific issue. Seems exactly the same problem.

But you're seeing an extreme form...

RaulMerelli commented 6 months ago

@bk138 Sorry, I didn't see that there was this specific issue. Seems exactly the same problem.

But you're seeing an extreme form...

Quite a big margin in fact: image

480x800 could be a particular screen resolution.

bk138 commented 1 week ago

@5A52 I have a customer with a similar problem. Which Android version are you using?

5A52 commented 3 days ago

@5A52 I have a customer with a similar problem. Which Android version are you using?

Android 12,13,14. But all of them samsung oneui (4.1,5.1,6.1,6.1.1). Issue does not hurt me, as input does not work anyway on second display. But if you need I can collect logs, or any other information.

bk138 commented 1 day ago

@5A52 As the the issue does not hurt you and the situation w/ my customer turned out to be an OEM bug, I'll document secondary display support and close this.