imtiaz
Posts: 1
Joined: Tue May 05, 2020 5:09 pm

Setting Raspberry Pi screen size in using VNC server.

Tue May 05, 2020 5:17 pm

I am using Raspberry Pi 4 through VNC server. My laptop screen dimension is set to 1366x768 resolution. In the config.txt file of raspberry pi, I do the following changes.
I played with overscan values and it does not change anything. Still, the screen size is small compare to my laptop screen. I want it to be exactly equal to my laptop screen. When I maximize vnc server windows, it gets black borders on the left and right sides of the screen.
This has created a lot of problems for me because I have a GUI app which has is 1366x768, which runs fine on the laptop screen, but when I switch to vnc server to run it inside RPi, then a small portion of that GUI app always miss out.
Is there any solution to fix this issue?

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
overscan_left=60
overscan_right=60
overscan_top=60
overscan_bottom=60

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=1366
framebuffer_height=768

iwestbury
Posts: 2
Joined: Fri Jun 05, 2020 5:15 pm

Re: Setting Raspberry Pi screen size in using VNC server.

Sun Jun 07, 2020 9:11 am

Hi. I have a 1366 x 768 laptop monitor and had the same problem. I set:

hdmi_force_hotplug:0=1
hdmi_group:0=2
hdmi_mode:0=81

in config.txt. I also needed to set the default for the screen size in screen preferences. It's not perfect but got rid of the black border.

Reading through these forums I see that this particular resolution, 1366 x 768 is an issue with Pi4 because of the hardware timing. Hope fully they will find a software fix. It is very odd though. I installed mine with NOOBS and it worked fine. I only had the problem after updating the software??

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5590
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Setting Raspberry Pi screen size in using VNC server.

Sun Jun 07, 2020 5:59 pm

If you can login via SSH (eg. using PuTTY or similar on the laptop) why not try using vncserver's virtual mode** to generate a 1366x768 display (for VNC) - I've just tested it with a P4B connected to a 1400x900 physical display and VNC'd with a 1366x768 "display size" from another P4B connected to a 1920x1080 physical (TV) display.

Code: Select all

pi@raspiP4B4d-32GbV:~ $ vncserver -geometry 1366x768
VNC(R) Server 6.7.1 (r42348) ARMv6 (Jan 30 2020 15:13:47)
Copyright (C) 2002-2020 RealVNC Ltd.
RealVNC and VNC are trademarks of RealVNC Ltd and are protected by trademark
registrations and/or pending trademark applications in the European Union,
United States of America and other jurisdictions.
Protected by UK patent 2481870; US patent 8760366; EU patent 2652951.
See https://www.realvnc.com for information on VNC.
For third party acknowledgements see:
https://www.realvnc.com/docs/6/foss.html
OS: Raspbian GNU/Linux 10, Linux 4.19.118, armv7l

On some distributions (in particular Red Hat), you may get a better experience
by running vncserver-virtual in conjunction with the system Xorg server, rather
than the old version built-in to Xvnc. More desktop environments and
applications will likely be compatible. For more information on this alternative
implementation, please see: https://www.realvnc.com/doclink/kb-546

Running applications in /etc/vnc/xstartup

VNC Server catchphrase: "Fantasy canvas chamber. Modest Arthur vitamin."
             signature: ae-60-b5-13-0a-6e-a9-79

Log file is /home/pi/.vnc/raspiP4B4d-32GbV:1.log
New desktop is raspiP4B4d-32GbV:1 (192.168.0.52:1)
pi@raspiP4B4d-32GbV:~ $ tvservice -s
state 0x6 [DVI CUSTOM RGB full unknown AR], 1440x900 @ 60.00Hz, progressive

Code: Select all

pi@raspiP4B4b-32GbP:~ $ tvservice -s
state 0xa [HDMI CUSTOM RGB full 16:9], 1920x1080 @ 60.00Hz, progressive
Trev.
** https://www.cpmspectrepi.uk/raspberry_p ... uster.html
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Return to “Troubleshooting”