We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

22 posts • Page 1 of 1
BenScarb
Posts: 16
Joined: Thu Jul 19, 2012 10:14 pm

Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Sun Oct 06, 2024 8:06 pm

Hello all,

I'm currently away from home with a Pi 5 and a I'm having issues.

Seems my video connection isn't 100% and it's trying to run at 1278x768 (I think, it only shows up for a moment!), which the TV doesn't like!

I can't see the GUI but I can get a Shell connection, through a series of hops and the internet.

So I tried adding a "video=" statement to the config.txt in the /boot/firmware folder. This worked to the extent the boot console showed up! The desktop didn't change (which I realise wasn't going to happen!)

I tried the "WAYLAND_DISPLAY="wayland-1" wlr-randr --output <OUTPUTNAME> --mode <WIDTH>x<HEIGHT>@<REFRESHRATE>Hz" command but nothing seemed to change, although no error messages were shown.

I've also tried editing the ~/.config/wayfire.ini file of the user I have it booting into, again no change right away (wasn't expecting one) and nothing after a reboot.

I've tried on the "HDMI-A-1" Output name, as that's what showed up listing the screen resolutions (using just the wlr-randr command) so I'm hoping I've got that part right.
(With HDMI-A-1 being the port closest to the USB C power connection, is my assumption)

Can anyone tell me what I'm doing wrong?

Cheers,
Ben

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

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Mon Oct 07, 2024 4:15 am

Video mode line goes into kernel command line - cmdline.txt - and not into config.txt
There is documentation on that https://www.raspberrypi.com/documentati ... ne-options

Your Pi running at 1280x768pixels is typ caused by bad HDMI cables and or monitors not providing valid EDID. Remove the uSD card, power up the Pi, post a picture of the boot diagnostics screen.

BenScarb
Posts: 16
Joined: Thu Jul 19, 2012 10:14 pm

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Mon Oct 07, 2024 6:48 am

You're right, it was the cmdline.txt I'd edited.

As for the cabling, I'm pretty convinced that's the issue, but being away from all my "stuff" means no replacements.

Hence the reason I want to force a screen resolution, not have it negotiate with the TV.

The Pi is inside a case, booting off an NVME hat. So no easy way to remove the boot media and get a shot of the diag screen. I'll see what I can do when I get where I'm going.

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

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Mon Oct 07, 2024 6:56 am

Add below to the beginning of cmdline.txt, make sure all remains on a single line.

Code: Select all

video=HDMI-A-1:1920x1080M@60D
screen needs to be connected to HDMI next to USB-C.

As said, make sure you've not added any useless stuff to config.txt.

BenScarb
Posts: 16
Joined: Thu Jul 19, 2012 10:14 pm

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Fri Oct 11, 2024 4:28 pm

As I thought, I had added it to the right file. Nothing added to the wrong one.
Connected to the correct HDMI port.

So, what do I put where, to tell the desktop to use a specific resolution?

The reason for for it not negotiating is most likely the cable, but that's not replaceable at the moment.

BenScarb
Posts: 16
Joined: Thu Jul 19, 2012 10:14 pm

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Fri Oct 11, 2024 7:44 pm

Did a little more experimenting, seems the HDMI plug to plug is working fine (used on another device).
Which leaves the mini-HDMI plug to Standard size HDMI socket as the probable issue.

Saying that, I can't rule out the Pi itself yet.

Kali-777
Posts: 9
Joined: Fri Aug 23, 2024 4:35 pm

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Sat Nov 02, 2024 10:17 pm

I had similar problem but ONLY my RPI3, another RPI400/RPI5 are working "fine" with SAME Monitor/Cable SO i was pretty sure it's configuration miss-match?! :?

I running wayland/labwc on ALL 3x RPI, tricky was kanshi-config :P

Code: Select all

~/.config/kanshi/config
profile {
 output HDMI-A-1 mode [email protected] position 0,0 transform normal
}
systemctl restart lightdm.service

terribleted
Posts: 2022
Joined: Tue Oct 06, 2020 8:07 pm

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Sun Nov 03, 2024 2:41 pm

OP said "Which leaves the mini-HDMI plug to Standard size HDMI socket as the probable issue."

Yep. Some Adapters do not pass data in both directions, which means the EDID data from the monitor never makes it to the PI.
recommend the correct cable (as long as you are buying something)

saw this myself. If you remove the SD card, and power up, the diagnostic display has a "display" line, which should say "ok"
if not, the adapter isn't passing data.
The only people that don't make mistakes are people that don't do anything.

Pi5_User
Posts: 142
Joined: Wed Aug 28, 2024 3:49 pm

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Sun Nov 03, 2024 4:29 pm

This may be a similar problem that I had. Was this pi updated to labwc rather than a fresh install? If so I fixed mine by:
sudo apt purge arandr

sudo apt install raindrop

and set the screen resolution via raindrop. (preferences, screen configuration, screens)

That worked for me, and survives shutdowns etc. Sorry if yours is a different problem

photoberry4B
Posts: 7
Joined: Tue Jan 16, 2024 5:47 am

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Wed Nov 06, 2024 10:23 am

Pi5_User wrote:
Sun Nov 03, 2024 4:29 pm
and set the screen resolution via raindrop. (preferences, screen configuration, screens)
How do you set a custom resolution that way? If I open that dialog it just shows a list of resolutions, no option to set custom.

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

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Wed Nov 06, 2024 10:32 am

photoberry4B wrote:
Wed Nov 06, 2024 10:23 am
How do you set a custom resolution that way? If I open that dialog it just shows a list of resolutions, no option to set custom.
No, it doesn't support custom modes, only modes reported by your display.
You should fix the underlying issue of no edid being reported by the display (likely by using a working hdmi cable).

Pi5_User
Posts: 142
Joined: Wed Aug 28, 2024 3:49 pm

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Wed Nov 06, 2024 10:53 am

Sorry if I added to the confusion, but what I was trying to say was that, for me, the purge and install raindrop was essential to allow me to set the resolution manually, in addition to the cmdline.txt. If someone had fresh installed the previous release of bookworm, upgraded since, and cant get the gui to work, then adding raindrop in the documented way may help.

My monitor correctly EDID reports 1920x1080@60 which was ok without the AV:link device. But with it I presume it either doesnt return correct EDID results (or none) so that could be similar to the OPs question but not for the resolution he wants. I seem to have seen the ability to add custom elsewhere on this forum (but dont know if it works) eg:

viewtopic.php?p=2266160&hilit=custom+wayfire#p2266160

labwc is totally ignoring wayfire.ini --> that's why this no longer works.

Try adding a custom modeline to ~/.config/labwc/autostart

Code: Select all

wlr-randr --output NOOP-1 --custom-mode 800x400@60Hz &

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

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Wed Nov 06, 2024 12:37 pm

Pi5_User wrote:
Wed Nov 06, 2024 10:53 am
Sorry if I added to the confusion, but what I was trying to say was that, for me, the purge and install raindrop was essential to allow me to set the resolution manually, in addition to the cmdline.txt. If someone had fresh installed the previous release of bookworm, upgraded since, and cant get the gui to work, then adding raindrop in the documented way may help.

My monitor correctly EDID reports 1920x1080@60 which was ok without the AV:link device. But with it I presume it either doesnt return correct EDID results (or none) so that could be similar to the OPs question but not for the resolution he wants. I seem to have seen the ability to add custom elsewhere on this forum (but dont know if it works) eg:

viewtopic.php?p=2266160&hilit=custom+wayfire#p2266160

labwc is totally ignoring wayfire.ini --> that's why this no longer works.

Try adding a custom modeline to ~/.config/labwc/autostart

Code: Select all

wlr-randr --output NOOP-1 --custom-mode 800x400@60Hz &
You should think first before trying to repost 'cool looking stuff'.

Look at the documentation https://www.raspberrypi.com/documentati ... splay-mode on how to force video modes.

The above is - and was - a special use case!

cjan
Posts: 1192
Joined: Sun May 06, 2012 12:00 am

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Wed Nov 06, 2024 8:28 pm

aBUGSworstnightmare wrote:
Mon Oct 07, 2024 6:56 am
Add below to the beginning of cmdline.txt, make sure all remains on a single line.

Code: Select all

video=HDMI-A-1:1920x1080M@60D
screen needs to be connected to HDMI next to USB-C.

As said, make sure you've not added any useless stuff to config.txt.
'video=HDMI-A-1:1920x1080M@60D' or 'video=HDMI-A-1:1920x1080M@60'
btw, can i set @100D or @100?

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

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Thu Nov 07, 2024 6:26 am

cjan wrote:
Wed Nov 06, 2024 8:28 pm
aBUGSworstnightmare wrote:
Mon Oct 07, 2024 6:56 am
Add below to the beginning of cmdline.txt, make sure all remains on a single line.

Code: Select all

video=HDMI-A-1:1920x1080M@60D
screen needs to be connected to HDMI next to USB-C.

As said, make sure you've not added any useless stuff to config.txt.
'video=HDMI-A-1:1920x1080M@60D' or 'video=HDMI-A-1:1920x1080M@60'
btw, can i set @100D or @100?
the parameters of the video mode are well documented in https://github.com/raspberrypi/linux/bl ... modedb.rst

You should be able to figure out the difference between @100D or @100 yourself.

Is your screen supporting 100Hz refresh rates?

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

Re: Forcing a Desktop Screen Resolution on latest OS non working

Thu Nov 07, 2024 6:54 am

o.k. tested this myself again this morning with an all fresh uSD image --> BROKEN AGAIN!

Video mode configured from kernel command line will only be effective when booted to CLI. GUI is AGAIN ignoring it and will switch to the preferred mode advertised by EDID.

Deja vue with more or less every new release....

My DUT:
Pi5

Code: Select all

pi@Pi5-new:~ $ uname -a
Linux Pi5-new 6.6.59-v8-16k+ #1811 SMP PREEMPT Tue Nov 5 20:06:38 GMT 2024 aarch64 GNU/Linux

video mode requested via kernel command line: video=HDMI-A-1:1440x900M@60D

Code: Select all

cmdline.txt
-----------
reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave smsc95xx.macaddr=D8:3A:DD:7D:0C:BE vc_mem.mem_base=0x3fc00000 vc_mem.mem_size=0x40000000 video=HDMI-A-1:1440x900M@60D console=ttyAMA10,115200 console=tty1 root=PARTUUID=c178ccd4-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=DE
Yes, that mode is supported on my DUT

Code: Select all

pi@Pi5-new:~ $ wlr-randr
HDMI-A-1 "Stargate Technology HDMI (HDMI-A-1)"
 Physical size: 600x340 mm
 Enabled: yes
 Modes:
 640x480 px, 59.939999 Hz
 640x480 px, 59.939999 Hz
 640x480 px, 60.000000 Hz
 720x480 px, 59.939999 Hz
 720x480 px, 59.939999 Hz
 720x480 px, 60.000000 Hz
 720x480 px, 60.000000 Hz
 800x600 px, 60.317001 Hz
 1024x768 px, 60.004002 Hz
 1280x720 px, 23.976000 Hz
 1280x720 px, 24.000000 Hz
 1280x720 px, 25.000000 Hz
 1280x720 px, 29.969999 Hz
 1280x720 px, 30.000000 Hz
 1280x720 px, 50.000000 Hz
 1280x720 px, 59.939999 Hz
 1280x720 px, 60.000000 Hz
 1280x720 px, 60.000000 Hz
 1280x960 px, 60.000000 Hz
 1440x900 px, 59.901001 Hz
 1280x1024 px, 60.020000 Hz
 1400x1050 px, 59.948002 Hz
 1920x1080 px, 23.976000 Hz
 1920x1080 px, 24.000000 Hz
 1920x1080 px, 25.000000 Hz
 1920x1080 px, 29.969999 Hz
 1920x1080 px, 30.000000 Hz
 1920x1080 px, 50.000000 Hz
 1920x1080 px, 59.939999 Hz
 1920x1080 px, 60.000000 Hz
 1920x1080 px, 60.000000 Hz
 2560x1440 px, 59.951000 Hz (preferred, current)
 Position: 0,0
 Transform: normal
 Scale: 1.000000
as one can see from the above the GUI has picked the preferred mode from the EDID table.

https://paste.debian.net/hidden/0e031b98/

Having the screen disconnected the GUI comes up correct - but that doesn't help that much ...

Code: Select all

pi@Pi5-new:~ $ wlr-randr
HDMI-A-1 "(null) (null) (HDMI-A-1)"
 Enabled: yes
 Modes:
 640x480 px, 59.939999 Hz
 848x480 px, 60.000000 Hz
 800x600 px, 56.250000 Hz
 800x600 px, 60.317001 Hz
 1024x768 px, 60.004002 Hz
 1440x900 px, 59.991001 Hz (current)
 Position: 0,0
 Transform: normal
 Scale: 1.000000
connecting the monitor now gives the correct results --> non practicable fix!

cjan
Posts: 1192
Joined: Sun May 06, 2012 12:00 am

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Thu Nov 07, 2024 8:59 am

aBUGSworstnightmare wrote:
Thu Nov 07, 2024 6:26 am
cjan wrote:
Wed Nov 06, 2024 8:28 pm
aBUGSworstnightmare wrote:
Mon Oct 07, 2024 6:56 am
Add below to the beginning of cmdline.txt, make sure all remains on a single line.

Code: Select all

video=HDMI-A-1:1920x1080M@60D
screen needs to be connected to HDMI next to USB-C.

As said, make sure you've not added any useless stuff to config.txt.
'video=HDMI-A-1:1920x1080M@60D' or 'video=HDMI-A-1:1920x1080M@60'
btw, can i set @100D or @100?
the parameters of the video mode are well documented in https://github.com/raspberrypi/linux/bl ... modedb.rst

You should be able to figure out the difference between @100D or @100 yourself.

Is your screen supporting 100Hz refresh rates?
No, read but no clue.
Yes, monitor is 1920x1080x100 and Freesync supported as box printed.

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

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Thu Nov 07, 2024 9:37 am

'D' will force the display to be enabled and use digital output.

This is useful for outputs that have both analog and digital signals (e.g. HDMI and DVI-I). For other outputs it behaves like 'e'. If 'd' is specified the output is disabled.
got it?
what is the output of below command on your system?

Code: Select all

wlr-randr

cjan
Posts: 1192
Joined: Sun May 06, 2012 12:00 am

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Thu Nov 07, 2024 9:44 am

aBUGSworstnightmare wrote:
Thu Nov 07, 2024 9:37 am
'D' will force the display to be enabled and use digital output.

This is useful for outputs that have both analog and digital signals (e.g. HDMI and DVI-I). For other outputs it behaves like 'e'. If 'd' is specified the output is disabled.
got it?
what is the output of below command on your system?

Code: Select all

wlr-randr

1920x1080 px, 60.000000 Hz (preferred, current)
1920x1080 px, 100.086998 Hz
1920x1080 px, 84.904999 Hz
1920x1080 px, 74.973000 Hz
1920x1080 px, 60.000000 Hz
1920x1080 px, 59.939999 Hz
1920x1080 px, 50.000000 Hz

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

Re: Forcing a Desktop Screen Resolution, on Raspberry Pi OS, using Wayland

Thu Nov 07, 2024 10:54 am

cjan wrote:
Thu Nov 07, 2024 9:44 am
..
1920x1080 px, 60.000000 Hz (preferred, current)
1920x1080 px, 100.086998 Hz
1920x1080 px, 84.904999 Hz
1920x1080 px, 74.973000 Hz
1920x1080 px, 60.000000 Hz
1920x1080 px, 59.939999 Hz
1920x1080 px, 50.000000 Hz
o.k. 100Hz is shown as available so make a simple test:
1.) add below to your cmdline.txt

Code: Select all

video=HDMI-A-1:1920x1080M@100D
2.) power down the PI
3.) disconnect the monitor
4.) power up
5.) once the Pi has booted connect your monitor

-> expected result is that your OS is now running at FHD@100Hz . Confirm by running 'wlr-randr' again; should now show
...

Code: Select all

1920x1080 px, 100.086998 Hz(current)
..

cjan
Posts: 1192
Joined: Sun May 06, 2012 12:00 am

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

Re: Forcing a Desktop Screen Resolution on latest OS non working

Thu Nov 07, 2024 12:11 pm

cjan wrote:
Thu Nov 07, 2024 11:29 am
@aBUGSworstnightmare, thanks.
not for that!
to me it looks like we have an issue here as the kernel command line does not set the custom mode flag and/or GUI is ignoring it. That's why the EDID preferred mode wins over kernel command line.

22 posts • Page 1 of 1

Return to "Raspberry Pi OS"

AltStyle によって変換されたページ (->オリジナル) /