TomEilers
Posts: 36
Joined: Mon Nov 08, 2021 3:04 pm

Bullseye vncserver is very slow without display

Mon Nov 08, 2021 3:24 pm

My Buster vncserver and or client was running very well.
My Buster and Bullseye config.txt display setting are:
framebuffer_width=1024
framebuffer_height=768

hdmi_group=2
hdmi_mode=16

In Buster I also had to run raspi-config to make vncserver working with:
Advanced Options-> Resolution->resolution->dmt mode 16 1024&768
Otherwise my vncclient cann't connect to desktop.

In Bullseye I don't have and cann't change display setting, but vncserver is very slow.

Also option display settings resolution is not available any more in Bullseye raspi-config.

What do i do wrong ?

Thank you very much.

klricks
Posts: 8552
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 12:54 am

Verified VNC is so slow it is unusable when booted without a HDMI monitor and with the now default KMS driver.
To fix you can revert back to old driver by 'commenting out' the KMS driver in /boot/config.txt like this:

Code: Select all

#dtoverlay=vc4-kms-v3d
reboot
Now you can apply a fixed resolution with sudo raspi-config or GUI Config tool.
reboot
VNC will then work normally.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

TomEilers
Posts: 36
Joined: Mon Nov 08, 2021 3:04 pm

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:01 am

Thank you very much, this solved my problem.

I nice thing to remark :
If a display is connected but powered off, vncserver also works at normal speed.
The vc4-kms-v3d driver hdmi output seems to be looking for some resitance or something like that.

klricks
Posts: 8552
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 12:33 pm

TomEilers wrote:
Tue Nov 09, 2021 8:01 am
Thank you very much, this solved my problem.

I nice thing to remark :
If a display is connected but powered off, vncserver also works at normal speed.
The vc4-kms-v3d driver hdmi output seems to be looking for some resitance or something like that.
As long as the AC Mains are connected to the monitor, it is really in a standby mode and not powered off..... So the RPi or whatever device can still communicate with the monitor and negotiate the best screen resolution etc.
Last edited by klricks on Tue Nov 09, 2021 6:24 pm, edited 1 time in total.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

user_13ad24
Posts: 3
Joined: Tue Nov 09, 2021 12:00 am

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 5:22 pm

I have / had the same problem and posted at approximately the same time about it, but the post hasn't been approved until later as it seems.

Anyway the workaround/solution works for me too.

It is interesting though that even with the KMS driver, if you start a secondary virtual vnc desktop (with "vncserver") and the accessing it at IP:1 for example, it works at normal speed, but the window frames and controls are not drawn correctly, hence you can't operate with windows normally. Maybe this bypasses the KMS driver, but still....the VNC virtual desktop should still work; maybe it's a problem with GTK+3.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6231
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 7:08 pm

Rather than disabling the kms overlay, can you try disabling mutter?

In /usr/bin/startlxde-pi, edit '$TOTAL_MEM -ge 2048' to, say '$TOTAL_MEM -ge 20480' and reboot.
That should disable mutter and may help VNC performance.

VNC are looking into a more permanent solution.

RonR
Posts: 2958
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 7:38 pm

dom wrote:
Tue Nov 09, 2021 7:08 pm
Rather than disabling the kms overlay, can you try disabling mutter?

In /usr/bin/startlxde-pi, edit '$TOTAL_MEM -ge 2048' to, say '$TOTAL_MEM -ge 20480' and reboot.
That should disable mutter and may help VNC performance.

That improves performance, but the resolution still cannot be set in raspi-config (missing option) or desktop settings (greyed out).

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6231
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 7:47 pm

RonR wrote:
Tue Nov 09, 2021 7:38 pm
That improves performance, but the resolution still cannot be set in raspi-config (missing option) or desktop settings (greyed out).
If you are running headless, then I'd suggest adding:

Code: Select all

video=HDMI-A-1:1920x1080@60D
to cmdline.txt to force a display resolution with kms.

aBUGSworstnightmare
Posts: 6048
Joined: Tue Jun 30, 2015 1:35 pm

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:01 pm

dom wrote:
Tue Nov 09, 2021 7:47 pm
RonR wrote:
Tue Nov 09, 2021 7:38 pm
That improves performance, but the resolution still cannot be set in raspi-config (missing option) or desktop settings (greyed out).
If you are running headless, then I'd suggest adding:

Code: Select all

video=HDMI-A-1:1920x1080@60D
to cmdline.txt to force a display resolution with kms.
Confirmed working on a CM4 2GB
content of my cmdline.txt (for reference)

Code: Select all

console=serial0,115200 console=tty1 root=PARTUUID=9c48fee6-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash video=HDMI-A-1:1920x1080@60D plymouth.ignore-serial-consoles
Last edited by aBUGSworstnightmare on Tue Nov 09, 2021 8:19 pm, edited 1 time in total.

aBUGSworstnightmare
Posts: 6048
Joined: Tue Jun 30, 2015 1:35 pm

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:04 pm

RonR wrote:
Tue Nov 09, 2021 7:38 pm
dom wrote:
Tue Nov 09, 2021 7:08 pm
Rather than disabling the kms overlay, can you try disabling mutter?

In /usr/bin/startlxde-pi, edit '$TOTAL_MEM -ge 2048' to, say '$TOTAL_MEM -ge 20480' and reboot.
That should disable mutter and may help VNC performance.

That improves performance, but the resolution still cannot be set in raspi-config (missing option) or desktop settings (greyed out).
have you installed latest arandr package? Should be reported as available download viewtopic.php?p=1935699#p1935661
2021-11-09-210933_1920x1080_scrot.jpg
Screen Configuration editor before the update
2021-11-09-210933_1920x1080_scrot.jpg (69.25 KiB) Viewed 17594 times
2021-11-09-211134_1920x1080_scrot.jpg
Screen configuration editor after arandr package update - rotation no longer disabled
2021-11-09-211134_1920x1080_scrot.jpg (70.73 KiB) Viewed 17594 times
Last edited by aBUGSworstnightmare on Tue Nov 09, 2021 8:23 pm, edited 2 times in total.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6231
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:10 pm

aBUGSworstnightmare wrote:
Tue Nov 09, 2021 8:01 pm
have you tested this? Did not work for me as HDMI was still reported as unconnected (by xrandr) when I've tested this in the afternoon.
Will retest tomorrow for sure.
Not with VNC, but I have used that line with HDMI disconnected before. Did you test with the "D" at the end?

aBUGSworstnightmare
Posts: 6048
Joined: Tue Jun 30, 2015 1:35 pm

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:21 pm

dom wrote:
Tue Nov 09, 2021 8:10 pm
aBUGSworstnightmare wrote:
Tue Nov 09, 2021 8:01 pm
have you tested this? Did not work for me as HDMI was still reported as unconnected (by xrandr) when I've tested this in the afternoon.
Will retest tomorrow for sure.
Not with VNC, but I have used that line with HDMI disconnected before. Did you test with the "D" at the end?
did not had the trailing "D" when testing this afternoon. Works fine now, thanks for pointing out correct syntax.

BTW: what's that D good for?

RonR
Posts: 2958
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:28 pm

dom wrote:
Tue Nov 09, 2021 7:47 pm
RonR wrote:
Tue Nov 09, 2021 7:38 pm
That improves performance, but the resolution still cannot be set in raspi-config (missing option) or desktop settings (greyed out).
If you are running headless, then I'd suggest adding:

Code: Select all

video=HDMI-A-1:1920x1080@60D
to cmdline.txt to force a display resolution with kms.

That appears to be a work-around. I had tried that yesterday with no success, but maybe the new arandr package that arrived today made a difference.

I hope there's a more elegant solution forthcoming.

aBUGSworstnightmare
Posts: 6048
Joined: Tue Jun 30, 2015 1:35 pm

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:32 pm

RonR wrote:
Tue Nov 09, 2021 8:28 pm
dom wrote:
Tue Nov 09, 2021 7:47 pm
RonR wrote:
Tue Nov 09, 2021 7:38 pm
That improves performance, but the resolution still cannot be set in raspi-config (missing option) or desktop settings (greyed out).
If you are running headless, then I'd suggest adding:

Code: Select all

video=HDMI-A-1:1920x1080@60D
to cmdline.txt to force a display resolution with kms.

That appears to be a work-around. I had tried that yesterday with no success, but maybe the new arandr package that arrived today made a difference.

I hope there's a more elegant solution forthcoming.
Yes, a better solution should be used. Seems to be a good one for the moment though.

Just to notice: trying to rotate that display to portrait fails; get's reverted to landscape immediately. Yes, another workaround would be adding a new mode which is 1080x1920 ... I know ...

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6231
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:38 pm

aBUGSworstnightmare wrote:
Tue Nov 09, 2021 8:21 pm
BTW: what's that D good for?
D means assume the display is connected. Something like hdmi_force_hotplug=1 with firmware driver.

RonR
Posts: 2958
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:41 pm

dom wrote:
Tue Nov 09, 2021 7:08 pm
Rather than disabling the kms overlay, can you try disabling mutter?

In /usr/bin/startlxde-pi, edit '$TOTAL_MEM -ge 2048' to, say '$TOTAL_MEM -ge 20480' and reboot.
That should disable mutter and may help VNC performance.

FWIW...

This change appears to be unnecessary with the addition of 'video=HDMI-A-1:1920x1080@60D' to cmdline.txt and the new arandr package.

aBUGSworstnightmare
Posts: 6048
Joined: Tue Jun 30, 2015 1:35 pm

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:46 pm

dom wrote:
Tue Nov 09, 2021 8:38 pm
aBUGSworstnightmare wrote:
Tue Nov 09, 2021 8:21 pm
BTW: what's that D good for?
D means assume the display is connected. Something like hdmi_force_hotplug=1 with firmware driver.
what? That sounds like the answer to my question here viewtopic.php?t=323281&start=100#p1935437

Was looking for such as my kernel command line in the afternoon failed for unknown (by that time) reasons.

Thanks for sharing that info!

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

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 8:53 pm

dom wrote:
Tue Nov 09, 2021 7:47 pm
RonR wrote:
Tue Nov 09, 2021 7:38 pm
That improves performance, but the resolution still cannot be set in raspi-config (missing option) or desktop settings (greyed out).
If you are running headless, then I'd suggest adding:

Code: Select all

video=HDMI-A-1:1920x1080@60D
to cmdline.txt to force a display resolution with kms.
I'm guessing that this approach may also fix the desktop icon placement issue, possibly also linked to the use of RealVNC's virtual mode as reported here: viewtopic.php?t=323281&start=100#p1935462
and clarified here viewtopic.php?t=323281&start=125
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B, B+, and a A+) but Buster on the P3B+, P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

aBUGSworstnightmare
Posts: 6048
Joined: Tue Jun 30, 2015 1:35 pm

Re: Bullseye vncserver is very slow without display

Tue Nov 09, 2021 9:04 pm

FTrevorGowen wrote:
Tue Nov 09, 2021 8:53 pm
dom wrote:
Tue Nov 09, 2021 7:47 pm
RonR wrote:
Tue Nov 09, 2021 7:38 pm
That improves performance, but the resolution still cannot be set in raspi-config (missing option) or desktop settings (greyed out).
If you are running headless, then I'd suggest adding:

Code: Select all

video=HDMI-A-1:1920x1080@60D
to cmdline.txt to force a display resolution with kms.
I'm guessing that this approach may also fix the desktop icon placement issue, possibly also linked to the use of RealVNC's virtual mode as reported here: viewtopic.php?t=323281&start=100#p1935462
and clarified here viewtopic.php?t=323281&start=125
Trev.
yes. Look at the screenshots here viewtopic.php?t=323294&p=1935762#p1935714

TomEilers
Posts: 36
Joined: Mon Nov 08, 2021 3:04 pm

Re: Bullseye vncserver is very slow without display

Wed Nov 10, 2021 3:35 pm

Thanks for your very fast updated raspi-config(s)
I enabled dtoverlay=vc4-kms-v3d again , and set the new headless resolution to my display type.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6231
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Bullseye vncserver is very slow without display

Wed Nov 10, 2021 3:52 pm

There should be some updates propagating (to raspberrypi-ui-mods, raspi-config, rc-gui) that improve VNC server behaviour:

If VNC is enabled, it should now switch back to openbox rather than mutter on the next reboot. This should make the lag a lot better.

If no monitor is connected, then the new Headless Resolution combo box on the Display tab of Raspberry Pi Configuration and the corresponding VNC Resolution item in the Display menu of raspi-config can be used to set the size of the virtual desktop.

If a monitor is connected, the virtual desktop will be the same size as the connected monitor; this overrides any setting made above.

So manual changes to startlxde-pi or video= line in cmdline.txt shouldn't be needed after this.

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

Re: Bullseye vncserver is very slow without display

Wed Nov 10, 2021 4:01 pm

dom wrote:
Wed Nov 10, 2021 3:52 pm
There should be some updates propagating (to raspberrypi-ui-mods, raspi-config, rc-gui) that improve VNC server behaviour:

If VNC is enabled, it should now switch back to openbox rather than mutter on the next reboot. This should make the lag a lot better.

If no monitor is connected, then the new Headless Resolution combo box on the Display tab of Raspberry Pi Configuration and the corresponding VNC Resolution item in the Display menu of raspi-config can be used to set the size of the virtual desktop.

If a monitor is connected, the virtual desktop will be the same size as the connected monitor; this overrides any setting made above.

So manual changes to startlxde-pi or video= line in cmdline.txt shouldn't be needed after this.
W.r.t. "the new Headless Resolution combo box..." I'm guessing that method should now be used rather than via the vncserver's -geometry option. (Although it would be "nice", from the point of view of a vncserver launch via a PuTTY (SSH) or serial terminal session if it were possible for said geometry option to "invoke" the same function/method as the "HeadlessRes. Combo box" unless, of course it (now) does? )
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B, B+, and a A+) but Buster on the P3B+, P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

mjack
Posts: 11
Joined: Mon May 20, 2013 5:57 am
Location: Denmark

Re: Bullseye vncserver is very slow without display

Wed Nov 10, 2021 8:11 pm

dom wrote:
Wed Nov 10, 2021 3:52 pm
If no monitor is connected, then the new Headless Resolution combo box on the Display tab of Raspberry Pi Configuration and the corresponding VNC Resolution item in the Display menu of raspi-config can be used to set the size of the virtual desktop.
Fresh bullseye install, updste and full-upgrade on headless Zero 2.

Maybe I'm doing something wrong, but I can't get it to work as described.

1( 1280x720 set in Raspberry Pi Configuration -> Display -> Headless Resolution,
2) VNC Viewer on other machine reports 1280x720 for session.
3) Screen Configuration only has "Composite-!" screen, and 720x480 resolution.
4 neofetch via ssh reports 720x480 resolution.

I've rebooted several times during this.
Attachments
session_information.png
RealVNC session information
session_information.png (5.12 KiB) Viewed 17130 times
raspberry_pi_configuration.png
Raspberry Pi Configuration
raspberry_pi_configuration.png (21.02 KiB) Viewed 17130 times
neofetch.png
neofetch via ssh session
neofetch.png (33.83 KiB) Viewed 17130 times

sammy04
Posts: 1
Joined: Wed Nov 10, 2021 8:12 pm

Re: Bullseye vncserver is very slow without display

Wed Nov 10, 2021 8:48 pm

dom wrote:
Wed Nov 10, 2021 3:52 pm
There should be some updates propagating (to raspberrypi-ui-mods, raspi-config, rc-gui) that improve VNC server behaviour:

If VNC is enabled, it should now switch back to openbox rather than mutter on the next reboot. This should make the lag a lot better.

If no monitor is connected, then the new Headless Resolution combo box on the Display tab of Raspberry Pi Configuration and the corresponding VNC Resolution item in the Display menu of raspi-config can be used to set the size of the virtual desktop.

If a monitor is connected, the virtual desktop will be the same size as the connected monitor; this overrides any setting made above.

So manual changes to startlxde-pi or video= line in cmdline.txt shouldn't be needed after this.
I received that update & rebooted, whatever resolution i select in headless resolution, it is still not working.
Image
Image

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6231
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Bullseye vncserver is very slow without display

Wed Nov 10, 2021 9:54 pm

mjack wrote:
Wed Nov 10, 2021 8:11 pm
2) VNC Viewer on other machine reports 1280x720 for session.
3) Screen Configuration only has "Composite-!" screen, and 720x480 resolution.
The Screen Configuration describes physical displays.
Composite can't be auto-detected so is assume if hdmi is not connected.

If VNC viewer reports 1280x720 then what is wrong?
Are you saying you are not getting a 1280x720 VNC desktop?

Return to “Troubleshooting”