MeadeUser
Posts: 9
Joined: Sat Jul 13, 2019 6:13 pm

New rpi4 issues with 4k

Sat Jul 13, 2019 6:19 pm

Hello all,
I am new here and recently bought an rpi4, 4gb version, for my use I need to use headless over VNC, which works well..... BUT, the 4K does not work this way, HD 1920x1080 is the Max when in headless mode, it works when there is a monitor attached to the pi, and on the computer with VNC viewer on...but in total headless mode, HD is max :(
So this is a complete deal breaker for me, and it’s of no use...
Any ideas...

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 292
Joined: Thu Jun 21, 2018 4:30 pm

Re: New rpi4 issues with 4k

Sat Jul 13, 2019 7:41 pm

It's not very elegant but applying theses changes to config.txt should force the legacy framebuffer to run at 4K. No idea how well VNC will support this though. There's some improvements in the pipeline for forcing display modes with FKMS enabled.

#dtoverlay=vc4-fkms-v3d
hdmi_group=1
# Fake 4Kp30
hdmi_mode=95
hdmi_force_hotplug=1
max_framebuffer_width=3840
max_framebuffer_height=2160

MeadeUser
Posts: 9
Joined: Sat Jul 13, 2019 6:13 pm

Re: New rpi4 issues with 4k

Sat Jul 13, 2019 9:36 pm

Thanks for the reply,
So what setting should I have in raspi.config, as the default is to use the monitors preferred res, (auto) and I have tried it set on number 95 as you mention, and the best I get is full HD..
Is the code you posted, a change to the file, or to be all added...as I am not a coder.. :)
Cheers :)

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 292
Joined: Thu Jun 21, 2018 4:30 pm

Re: New rpi4 issues with 4k

Sat Jul 13, 2019 10:17 pm

Sorry, the changes apply to a file called /boot/config.txt. Make a backup first but none of these settings are dangerous.

Comment out the fkms line and add the other values to the [rpi4] section.

But yes, I'm saying tell the firmware what the preferred resolution is in order to force it to allocate a framebuffer of the required size. If you run 'tvservice -s' it will indicate what mode it is running in.

MeadeUser
Posts: 9
Joined: Sat Jul 13, 2019 6:13 pm

Re: New rpi4 issues with 4k

Sun Jul 14, 2019 8:58 am

Well, I do all that and leave the setting in the raspi config file set as “preferred resolution of monitor” rather than choosing a resolution, I get a black screen through VNC with a message on it saying “cant show desktop”, so don’t I have to choose a resolution in the raspi config pages for it to work..??

MeadeUser
Posts: 9
Joined: Sat Jul 13, 2019 6:13 pm

Re: New rpi4 issues with 4k

Sun Jul 14, 2019 9:15 am

No, that does not work, still the same
If I get the rpi all connected with mouse, keyboard and monitor, and get It running in 4K it works well, then I connect via VNC from another PC while still having the rpi connected to a monitor, it comes up on the PC in VNC in 4K....

BUT as soon as I do the same with no monitor connected to the rpi, all I get is a black screen in VNC with message saying can’t show to desktop at this time...

So, if I set the resolution in raspi config to 95 then try it all again, VNC will now show the rpi desktop but in a really low resolution, and when I try and change it through VNC all the 4K settings have gone, and it’s also very difficult to change the res at all, and when I can 1920x1080 is the highest it will go, but even that is hard to change, it seems to want to stay at about 1200x720 or something like that..

I don’t understand why it will work with monitor connected to rpi but not without, have even tried a dummy HDMI plug...

The problem is that on a 28” 4K monitor even HD res is rubbish..for my needs...

So this rpi4 is no use for my astro set up which requires it to be outside on a telescope, and controlled via VNC from a laptop indoors. ☹️☹️

Any more ideas as how to get this to work via VNC..??

MeadeUser
Posts: 9
Joined: Sat Jul 13, 2019 6:13 pm

Re: New rpi4 issues with 4k

Mon Jul 15, 2019 9:23 am

Ok, I have it sorted for now, it works fine with XRDP from a windows machine, and Remote Desktop...But not sure how I can run from my Linux laptop...

noggin
Posts: 99
Joined: Sun Feb 21, 2016 1:55 pm

Re: New rpi4 issues with 4k

Mon Jul 15, 2019 9:36 am

MeadeUser wrote:
Mon Jul 15, 2019 9:23 am
Ok, I have it sorted for now, it works fine with XRDP from a windows machine, and Remote Desktop...But not sure how I can run from my Linux laptop...
If it works OK with 4K on some VNC clients and not others, then it suggests that not all of your clients handle 4K? (Or do those clients work OK in 4K from other devices they VNC into ?)

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7906
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: New rpi4 issues with 4k

Mon Jul 15, 2019 10:19 am

RealVNC clones the existing desktop.
Within the updated graphics stack (FKMS) it reads the EDID from the monitor to work out what resolutions are supported. If you don't have a monitor connected then the answer is none, and it won't create a framebuffer. No framebuffer means RealVNC has nothing to clone.

My understanding is that if you use xvnc then it will create a virtual desktop for your session, so your client can set the resolution on that.

Timg236's instructions disable the updated graphics stack (therefore no 3D), and tell the older stack to force a framebuffer mode of 3840x2160. If that isn't happening then I suspect you haven't added the # to the start of "dtoverlay=vc4-fkms-v3d", and the new stack is still being loaded.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

MeadeUser
Posts: 9
Joined: Sat Jul 13, 2019 6:13 pm

Re: New rpi4 issues with 4k

Mon Jul 15, 2019 10:34 am

noggin wrote:
Mon Jul 15, 2019 9:36 am
MeadeUser wrote:
Mon Jul 15, 2019 9:23 am
Ok, I have it sorted for now, it works fine with XRDP from a windows machine, and Remote Desktop...But not sure how I can run from my Linux laptop...
If it works OK with 4K on some VNC clients and not others, then it suggests that not all of your clients handle 4K? (Or do those clients work OK in 4K from other devices they VNC into ?)
Not sure have not tried..

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7906
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: New rpi4 issues with 4k

Mon Jul 15, 2019 1:36 pm

6by9 wrote:
Mon Jul 15, 2019 10:19 am
RealVNC clones the existing desktop.
Within the updated graphics stack (FKMS) it reads the EDID from the monitor to work out what resolutions are supported. If you don't have a monitor connected then the answer is none, and it won't create a framebuffer. No framebuffer means RealVNC has nothing to clone.

My understanding is that if you use xvnc then it will create a virtual desktop for your session, so your client can set the resolution on that.
Reading RealVNCs website, they document how to create a virtual desktop for when running headless.
https://www.realvnc.com/en/connect/docs ... pi-virtual
To do this:

On your Raspberry Pi, run the command vncserver. Make a note of the IP address/display number printed to the console, for example 192.167.5.149:1.
On the device you will use to take control, enter this information in VNC Viewer.

Stopping a virtual desktop

A virtual desktop persists until you explicitly destroy it. Run the following command when you are sure it is no longer needed:

vncserver -kill :<display-number>

Note this command will terminate any current connections without warning to those users.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

MeadeUser
Posts: 9
Joined: Sat Jul 13, 2019 6:13 pm

Re: New rpi4 issues with 4k

Mon Jul 15, 2019 8:15 pm

All ok for HD connections, but does not work for 4K....so looks like I am back to a windows desktop to control rpi... :(

MeadeUser
Posts: 9
Joined: Sat Jul 13, 2019 6:13 pm

Re: New rpi4 issues with 4k

Tue Jul 16, 2019 9:00 pm

Ok all sorted, had to use XRDP on the pi, and either Remote Desktop on windows PC or a Remote Desktop programme called Remmina on ububtu to control pi, both work superb in 4K and no lag at all, ether than any VNC I have ever used.. :)

Return to “General discussion”