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

VNC Server Not Optimized Due to Ommissions in 'config.txt' #27

Open
JeffHochberg opened this issue Jun 10, 2020 · 0 comments
Open

VNC Server Not Optimized Due to Ommissions in 'config.txt' #27

JeffHochberg opened this issue Jun 10, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@JeffHochberg
Copy link

The default VNC Server configuration is set to a very low resolution which is next to impossible to use.

There are two different VNC Server services for RealVNC. One is for headless devices (vncserver-virtuald.service), the other is for devices with a display connected (vncserver-x11-serviced.service).

HamPi is currently running vncserver-x11-serviced.service which expects an HDMI interface to be connected to the Pi. If one is not connected, then the GUI interface will fail to start, and vncserver-x11-serviced.service will fail to launch which will prevent people from connecting to it with VNC Viewer.

I still prefer using the X11 version of the VNC Server as it's a lot easier to manage than the headless version, but there are changes required in order to ensure that it runs optimally.

The default /boot/config.txt file should be modified in several ways to account for this:

Allow X11 to start without an HDMI interface connected by enabling:

hdmi_force_hotplug=1

  1. Provide several pre-defined options in /boot/config.txt so users can SSH into the Pi, or use an existing VNC session to modify the file to comment/uncomment the desired/undesired resolutions. I have the config.txt file configured as follows:

uncomment to force a specific HDMI mode (this will force VGA)

hdmi_group=2

#1920x1080
hdmi_mode=82

#1280x720
#hdmi_mode=85

#1360x768 - 60 Hz
#hdmi_mode=39

#1360x760 - 120 Hz
#hdmi_mode=40

The hdmi_group=2 should be enabled in all cases. The hdmi_mode values can be modified based on the desired resolution for the VNC session.

When I want to run in 1920x1080 resolution, I simply uncomment hdmi_mode=82 and ensure any other resolutions are commented out. If I want to run in 1360x768 resolution, I comment out the other hdmi_mode and uncomment hdmi_mode=39. The hdmi_mode=40 is likely not needed as 120 Hz won't make a difference through a VNC session.

It's possible to create a menued interface for this, but given the timeframe to deliver the new image, that may or may not be possible. That's for you to determine.

My list of hdmi_mode values is a small selection based on the devices I use to connect to the VNC server. The complete list of HDMI modes is documented:

https://www.raspberrypi.org/documentation/configuration/config-txt/video.md

  1. Lastly, the Raspberry Pi 4 comes with an option enabled by default that will also cause issues with RealVNC Server and should be commented out:

#dtoverlay=vc4-fkms-v3d

@dslotter dslotter self-assigned this Jun 10, 2020
@dslotter dslotter added the enhancement New feature or request label Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants