Raspberry-Pi-OS-64bit icon indicating copy to clipboard operation
Raspberry-Pi-OS-64bit copied to clipboard

Maximized window does not fill Desktop in Headless Config VNC server 1080p resolution Pi OS 64bit

Open mv4manishverma opened this issue 2 years ago • 36 comments

Using "Linux raspberrypi 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux"

OS: Pi OS Bullseye Release 11.

I am using CM4 ioboard carrier board with 4GB RAM and 32GB eMMC compute module 4. I set the headless resolution to 1920x1080 from the Menu while on the external monitor connected to HDMI. After that I removed the external monitor and rebooted the board. Then I connected to the board from VNC viewer. The Desktop appeared in 1920x1080 resolution but if I open any window or terminal and try to maximize it, it does not fill the whole desktop.

mv4manishverma avatar May 06 '22 15:05 mv4manishverma

Could you attach a screenshot / photo to show what you mean please?

lurch avatar May 07 '22 17:05 lurch

@spl237 sounds like openbox is not reading the root window size correctly in that situation?

XECDesign avatar May 09 '22 08:05 XECDesign

not_maximized maximized

Here are the screen shots.

mv4manishverma avatar May 09 '22 10:05 mv4manishverma

@spl237 sounds like openbox is not reading the root window size correctly in that situation?

Not sure what is the cause of this problem !

mv4manishverma avatar May 09 '22 10:05 mv4manishverma

FYI the bottom right corner of the maximised window is at (1023,767).

pelwell avatar May 09 '22 11:05 pelwell

Thanks - based on your screenshot and @XECDesign 's comment, it seems that openbox (the window manager) thinks your screensize is 1024 x 768.

Hah, @pelwell just beat me to it :laughing:

lurch avatar May 09 '22 11:05 lurch

Thanks - based on your screenshot and @XECDesign 's comment, it seems that openbox (the window manager) thinks your screensize is 1024 x 768.

Hah, @pelwell just beat me to it laughing

So what is the solution for this? Do i have to manually set the desired resolution?

mv4manishverma avatar May 09 '22 11:05 mv4manishverma

I've raised the issue with RealVNC - they will investigate.

spl237 avatar May 09 '22 11:05 spl237

Thanks a lot !!

mv4manishverma avatar May 09 '22 11:05 mv4manishverma

I've had the very same problem for a couple of months now. (Actually, ever since the 64 bit OS came out of beta and was officially released.) As a result, Raspberry Pi OS 64 bit is only usable for me with a monitor attached. I run it on a Raspberry Pi 4 with 4 GB of memory. I too wondered whether it might be a VNC issue; no matter what I tried, headless access never worked properly, especially by comparison with the 32 bit version of the OS, where it works flawlessly.

jmlineb avatar May 31 '22 01:05 jmlineb

My solution has been to set the resolution, on the raspberry pi, to match that which is used by VNC.

While you're viewing the Raspberry Pi through VNC, go through:

Start -> Preferences -> Raspberry Pi Configuration -> Display -> Headless Resolution.

Where "Start" is the raspberry icon, in the upper left corner. Make sure you set this resolution so that it's the same that VNC is using.

I'm using tightvncserver. So if I start tightvncserver with "tightvncserver -geometry 1280x720", at the command line, and then set the Raspberry Pi resolution, in the above path, to 1280x720, then full screen has a chance to work properly. These changes, only have to be made, once.

Once all of this is done, the order, in which, you choose to go "full screen", is important. First, once you're viewing your Pi through VNC, you have to make VNC go full screen. After that, you can then make your application, on the raspberry pi, go full screen.

If you don't make VNC go full screen, first, the application, on the raspberry pi, may not line up correctly, when you make that application go full screen.

Obviously, this isn't a perfect solution, but it does tend to work. Hopefully, permanent fixes will soon be implemented by the 64-bit Raspberry Pi creators.

evansste12432 avatar Jun 15 '22 22:06 evansste12432

Hi. I have the same issue. Some people claimed they solved it by modifying the DRM VC4 V3D driver lines in the config.txt file. It didn’t work for me though. Any other lead?

romton843 avatar Jul 22 '22 01:07 romton843

I'm using a HDMI dummy plug... not elegant but it's working!

yvessa avatar Jul 22 '22 20:07 yvessa

@romton843, I'm so sorry that the fix you mentioned is not working for you. But it gave me the idea to search the Web for that particular solution, and I found it, and it is working for me! Here are the details, inspired both by your comment and by https://forums.raspberrypi.com/viewtopic.php?t=282380.

  1. Comment out all dtoverlay=vc4-kms-v3d lines in config.txt
  2. Comment out max_framebuffers too (but this might not be necessary)
  3. Restart the Pi headless
  4. Connect from another machine with VNC client. Best not to maximize the VNC client window but let the headless resolution that you previously set determine the window size. Otherwise you get some mouse anomalies trying to switch from window to window.
  5. Maximizing windows on the Pi should then work just fine. At least, it finally does for me.

Some people have said that SSH access gets messed up with dtoverlay=vc4-kms-v3d commented out. When I get back home I'll test that out and see what is the case for me. Some other people have said that what you need instead is the older dtoverlay=vc4-fkms-v3d entry but that it will be deprecated soon. Your mileage may vary.

jmlineb avatar Jul 22 '22 20:07 jmlineb

@yvessa, good hack!

jmlineb avatar Jul 22 '22 21:07 jmlineb

@jmlineb, When I try to uncomment dtoverlay=vc4-kms-v3d, I actually get trouble connecting through SSH indeed and even when I can, my VNC client shows the message “Cannot currently show the desktop”. That’s why I said this solution doesn’t work for me. Thank you for responding though. The only thing that works sometimes is changing the headless resolution to 1600x1200, rebooting, change the resolution back to 1024x768 and rebooting again (but doesn’t work all the time). I guess I’m gonna try a HDMI dummy plug then.

romton843 avatar Jul 28 '22 13:07 romton843

Rather than trying a dummy hdmi plug, add video=HDMI-A-1:1920x1080@60D to the end of /boot/cmdline.txt (on same line). That should have the effect of faking a connected display.

popcornmix avatar Jul 29 '22 14:07 popcornmix

Rather than trying a dummy hdmi plug, add video=HDMI-A-1:1920x1080@60D to the end of /boot/cmdline.txt (on same line). That should have the effect of faking a connected display.

I tried that but it actually made the headless stuck to that very small window. I'm guessing that a dummy hdmi plug will end up doing the same thing so I'm just going to reinstall it all. Thank you though.

romton843 avatar Aug 10 '22 00:08 romton843

For me forcing HDMI hotplug + resolution in /boot/config.txt AND adding the command to /boot/cmdline.txt fixed the issue.

I can't disable kms because of camera. RPi must have "connected" display to get the VNC work properly. You must see the display under Preferences->Screen configuration

Benik3 avatar Sep 17 '22 13:09 Benik3

For me forcing HDMI hotplug + resolution in /boot/config.txt AND adding the command to /boot/cmdline.txt fixed the issue.

I'm surprised the config.txt settings made a difference when using kms driver.

Can you report exactly which settings you added to config.txt and can you try removing them one at a time to ensure which ones are really required.

popcornmix avatar Sep 22 '22 11:09 popcornmix

@romton843, I'm so sorry that the fix you mentioned is not working for you. But it gave me the idea to search the Web for that particular solution, and I found it, and it is working for me! Here are the details, inspired both by your comment and by https://forums.raspberrypi.com/viewtopic.php?t=282380.

  1. Comment out all dtoverlay=vc4-kms-v3d lines in config.txt
  2. Comment out max_framebuffers too (but this might not be necessary)
  3. Restart the Pi headless
  4. Connect from another machine with VNC client. Best not to maximize the VNC client window but let the headless resolution that you previously set determine the window size. Otherwise you get some mouse anomalies trying to switch from window to window.
  5. Maximizing windows on the Pi should then work just fine. At least, it finally does for me.

Some people have said that SSH access gets messed up with dtoverlay=vc4-kms-v3d commented out. When I get back home I'll test that out and see what is the case for me. Some other people have said that what you need instead is the older dtoverlay=vc4-fkms-v3d entry but that it will be deprecated soon. Your mileage may vary.

Warning don't do this, it might "brick" your PI.

After trying this out, I had to:

  • Remove my SD card
  • Insert into PC
  • Manually uncomment those lines
  • Put SD card back into PI

Chippi avatar Sep 24 '22 16:09 Chippi

I'm so sorry, but what precisely bricked your Pi? Like I said, that approach worked for me.

But having said that, I'm currently a bit more nuanced in my config.txt. Here is a snippet of what I am now running with.

# Conditionally enable DRM VC4 V3D driver
[EDID=*]
# CONDITIONALLY ENABLES DTOVERLAY IF DISPLAY IS PLUGGED IN
dtoverlay=vc4-kms-v3d
# Set to number of monitors
max_framebuffers=1

jmlineb avatar Sep 26 '22 03:09 jmlineb

For me forcing HDMI hotplug + resolution in /boot/config.txt AND adding the command to /boot/cmdline.txt fixed the issue.

I'm surprised the config.txt settings made a difference when using kms driver.

Can you report exactly which settings you added to config.txt and can you try removing them one at a time to ensure which ones are really required.

I don't know why, but just editing config.txt worked for some time and after one reboot it stoped working. So I edited also the cmdline.txt and it started to work again...

@Chippi I also tried to disable kms and didn't "brick" the RPi, it must be something else...

Benik3 avatar Sep 26 '22 06:09 Benik3

This problem appears on my RPi 4GB somehow randomly after each reboot. But if logout and login back (which is faster than reboot), it may also fix itself (like 40% chance).

Isn't there a way to configure the "fallback resolution"? For me it's like 300px wide (not 1023 as mentioned above) so even logging out is pretty complicated.

Juraj-Masiar avatar Dec 02 '22 10:12 Juraj-Masiar

You can change the headless resolution from the start menu itself to some other arbitrary number (in my case I tried using 1600x1200) then tried to reboot and then again set the display resolution to 1920x1080, while not touching raspi-config.

AumPauskar avatar Dec 12 '22 16:12 AumPauskar

You can change the headless resolution from the start menu itself

Where in the menu? Setting it in the Configuration window won't work on boot, I need to logout and login back every time in order to get a proper resolution. image

This is what I get after reboot: image

The usable screen is only the small rectangle in the upper left corner :( image

EDIT: When I run screen in Firefox, it prints: availHeight: 160, availWidth: 320 So, is there a way to change the fallback 320x160 to something bigger?

Juraj-Masiar avatar Dec 19 '22 12:12 Juraj-Masiar

I use Linux raspberrypi 5.15.76-v8+ #1597 SMP PREEMPT Fri Nov 4 12:16:41 GMT 2022 aarch64 GNU/Linux

On 2 hardware versions (Pi 3B and Pi 3B+) :

  • On Model : Raspberry Pi 3 Model B Rev 1.2 => NO display problem
  • On Model : Raspberry Pi 3 Model B Plus Rev 1.3 => Display prolem

japafrite avatar Dec 23 '22 16:12 japafrite

Rather than trying a dummy hdmi plug, add video=HDMI-A-1:1920x1080@60D to the end of /boot/cmdline.txt (on same line). That should have the effect of faking a connected display.

This actually worked in my case, but looks like it only supports standard resolutions, those worked with me: 1280x720 1600x900 1920x1080

ahmedamoharram avatar Feb 03 '23 21:02 ahmedamoharram

Quick note - after plugging a dummy HDMI, setting resolution to FullHD and later removing it, it changed the fallback resolution from 320x160 to something like 1024x768. In any case, indeed, appending video=HDMI-A-1:1920x1080@60D to the end of /boot/cmdline.txt fixed the problem! Thanks!

Juraj-Masiar avatar Feb 06 '23 13:02 Juraj-Masiar

Very interested in this thread.

I've tinkered with this, and have screwed up the screen resolution, had to put it on a monitor and m/k to fix things

So I've had this exact same issue for a year now.. just the luck of the draw on a reboot or cold start if the desktop will act like the resolution it's set at, or something smaller. I've had it on a Pi3+ 32b OS, and Pi4b+ 64b OS . All via VNC. I've set the headless res to 1920x1080, even checking it in the cl config panel for VNC display option. I tried this,, video=HDMI-A-1:1920x1080@60D to the end of /boot/cmdline.txt , NG for me. About to get the HDMI dummy plug. this is really annoying,

ramit99 avatar Apr 07 '23 02:04 ramit99