raspberrypi / Raspberry-Pi-OS-64bit

Repository for containing issues on the 64 bit operating system (as distinct from the 32 bit one)
466 stars 21 forks source link

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

Open mv4manishverma opened 2 years ago

mv4manishverma commented 2 years ago

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.

lurch commented 2 years ago

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

XECDesign commented 2 years ago

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

mv4manishverma commented 2 years ago

not_maximized maximized

Here are the screen shots.

mv4manishverma commented 2 years ago

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

Not sure what is the cause of this problem !

pelwell commented 2 years ago

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

lurch commented 2 years ago

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:

mv4manishverma commented 2 years ago

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?

spl237 commented 2 years ago

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

mv4manishverma commented 2 years ago

Thanks a lot !!

jmlineb commented 2 years ago

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.

evansste12432 commented 2 years ago

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.

romton843 commented 2 years ago

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?

yvessa commented 2 years ago

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

jmlineb commented 2 years ago

@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 commented 2 years ago

@yvessa, good hack!

romton843 commented 2 years ago

@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.

popcornmix commented 2 years ago

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.

romton843 commented 2 years ago

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.

Benik3 commented 2 years ago

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

popcornmix commented 2 years ago

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.

Chippi commented 2 years ago

@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:

jmlineb commented 2 years ago

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
Benik3 commented 2 years ago

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...

Juraj-Masiar commented 1 year ago

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.

AumPauskar commented 1 year ago

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.

Juraj-Masiar commented 1 year ago

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?

japafrite commented 1 year ago

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+) :

ahmedamoharram commented 1 year ago

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

Juraj-Masiar commented 1 year ago

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!

ramit99 commented 1 year ago

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 commented 1 year ago

(Edit: on a Pi4B 64b OS) (not having the same success on the Pi3b+)

I was just doing some googling on this, and found some input, and on my 5th reboot, and all is hanging in there..

found in thread here: https://forums.raspberrypi.com/viewtopic.php?t=332327

/boot/config.txt Clipped from working config.txt... First 3 lines were in my stock config.txt , lines following are what were added just after the first 3 as shown.

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

hdmi_group=2
hdmi_mode=82

# Ignore EDID display data
hdmi_ignore_edid=0xa5000080
hdmi_force_hotplug=1
ramit99 commented 1 year ago

I started with the same lines as the Pi4B , but didn't work. Lots of adding and changing code for the resolution and rem'ing out , and so 5 reboots on a Pi3b+ 32b os.. and it's staying !

As with all, have the headless set to 1920x1080.

5 reboots and with this in the config.txt, all is good...

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=5

hdmi_group=2
hdmi_mode=82

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

Going to sleep..

Figures, I ordered the dummy hdmi's, and finally find combo's that work after hacking and wacking keys.

iRamy commented 1 year ago

Hi, for those that could find this useful. What worked for me to fix the maximizing of the windows is this :

framebuffer_width=1920 framebuffer_height=1080

I hope this helps

hystrix1 commented 1 year ago

Setting framebuffer_width=1920 and framebuffer_height=1080 in config.txt worked for me. Many thanks.

ZigaJavornik commented 1 year ago

I had the same issue, here is the solution that worked for me:

in the /boot/config.txt edit this, make sure it is uncommented - after a reboot, you will see maximized windows, for me at least it was the case : hdmi_group=2 hdmi_mode=82

MKoen commented 1 year ago

@ZigaJavornik, thank you! Setting hdmi_group=2 and hdmi_mode=82 fixed it for me.