How can I make a custom resolution for VGA monitor in Wayland

I knew Xorg and the everyone mentions xrandr but I’m not using Xorg but Wayland so

xrandr --output DP-1 --mode 640x480 --rate 60

Does nothing. What would be the appropiate way to wayland this one?

Using latest Manajaro Gnome stable. Thanks for reading and the support.

One of these, perhaps:

[Sloved]Does a programe on Wayland can instead xrandr / Laptop Issues / Arch Linux Forums

wl-randr

GitHub - csicar/wrandr: ARandR for Wayland (Sway)

I just googled, I do not have used or tested it nor have a need for it since I do not use Wayland.

Ty for the quick responce!
Tried wl-randr and wlr-randr and nada. command not found.

Have you installed wlr-randr? It is in Manjaro’s repos:

pamac info wlr-randr
Name                  : wlr-randr
Version               : 0.5.0-1
Description           : Utility to manage outputs of a Wayland compositor
URL                   : https://gitlab.freedesktop.org/emersion/wlr-randr
Licenses              : MIT
Repository            : extra
Installed Size        : 29.1 kB
Groups                : --
Depends On            : wayland glibc
Optional Dependencies : --
Provides              : --
Replaces              : --
Conflicts With        : --
Packager              : Robin Candau <antiz@archlinux.org>
Build Date            : Thu 13 Feb 2025 19:14:08
Validated By          : MD5 Sum  SHA-256 Sum  Signature

take a pick

 $ pamac search wlr-randr --aur
gnome-randr-rust  0.1.1.44.g688e0c2-1                              AUR
    xrandr for Gnome/wayland, on distros that don't support
    wlr-randr
wlr-randr-git  0.3.0+1+gb9fad41-1                                  AUR
    Utility to manage outputs of a Wayland compositor (latest git
    version)
wlr-randr  0.5.0-1                                               extra
    Utility to manage outputs of a Wayland compositor

1 Like

Sorry I was kind of lost checking

https://wiki.archlinux.org/title/GDM

Summary

###4.3 Setup default monitor settings

Some desktop environments store display settings in ~/.config/monitors.xml. xrandr commands are then generated on the base of the file content. GDM has a similar file stored in /var/lib/gdm/.config/monitors.xml.

If you have your monitors setup as you like (resolution, refresh rate, orientation, scaling, primary and so on) in ~/.config/monitors.xml and want GDM to honor those settings:

cp ~/.config/monitors.xml /var/lib/gdm/.config/

To automatically re-configure the monitor setup on each boot, use a drop-in file for gdm.service:

/etc/systemd/system/gdm.service.d/override.conf

[Service] ExecStartPre=/bin/cp /home/user/.config/monitors.xml /var/lib/gdm/.config/monitors.xml

The relevant parts of monitors.xml for screen rotation and scaling are:

… 2 … right no …

Changes will take effect on logout. This is necessary because GDM does not respect xorg.conf.

Note:

  • If you use GDM under Wayland, you must also use a monitors.xml that was created under Wayland. See GDM bug 224 for more info. Alternatively, you can force GDM to #Use Xorg backend, and use a monitors.xml that was created under Xorg.
  • If you use fractional scaling, you need to enable it for user gdm,

[gdm]$ dbus-launch gsettings set org.gnome.mutter experimental-features “[‘scale-monitor-framebuffer’]”

Let me try wlr-randr again. Pamac feels the need to update when installing new packages so I’m currently building some packages. Will take a while.

Done. Installed but

compositor doesn't support wlr-output-management-unstable-v1

Will reboot and see if that fixes it.


Did not work. I also tried the Arch Linux Wiki and didn’t work.
Found rando Youtube video says that adding video=DP-1:640x480@60 as a kernel boot parameter using systemd-boot might work. However…

Summary

Not guaranteed (tested), so I’m going to test it! Editing GRUB…

Didn’t work or I don’t know how to add boot parameters to GRUB.

submenu 'Advanced options for Manjaro Linux' $menuentry_id_option 'gnulinux-advanced-14607388-1c2a-43a7-b882-49de11055a09' {
	menuentry 'Manjaro Linux (Kernel: 6.12.12-2-MANJARO x64)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.12.12-2-MANJARO x64-advanced-14607388-1c2a-43a7-b882-49de11055a09' {
		video=DP-1:640x480@60
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod btrfs
		search --no-floppy --fs-uuid --set=root 14607388-1c2a-43a7-b882-49de11055a09
		linux	/@/boot/vmlinuz-6.12-x86_64 root=UUID=14607388-1c2a-43a7-b882-49de11055a09 rw rootflags=subvol=@  quiet splash apparmor=1 security=apparmor udev.log_priority=3
		initrd	/@/boot/intel-ucode.img /@/boot/amd-ucode.img /@/boot/initramfs-6.12-x86_64.img

Do I need it at the beginning or the end?

1 Like

You add it in a different place - don’t edit this file.
The file to edit is /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT= ...
some parameters are already there

sudo update-grub
afterwards

I can’t and don’t say anything about the parameter itself - whether it should or should not do what is expected.

Tried everything and nothing. It’s incredible that a while ago this was super easy with Xorg but near impossible with wayland and is specially odd because this isn’t that rare of a scenario. I want to output a TV friendly signal with my VGA to s-video/composite converter and 480p is ideal to be broken to 480i. In Windows was as easy as to open CRU, set 640x480 and restart the Windows compositor.

This is actually a very rare scenario in modern times. Nowadays, the end device specifies which resolutions are possible via EDID (e.g. a screen). Then the driver follows this instead of assuming that resolutions work and then testing via Trail&Error.

In Wayland and mode-setting drivers, user-defined resolutions are a very rare marginal phenomenon. If you need custom resolutions, Xorg would be the better solution, since it is legacy software.

As I’m still curious about this, but also unable to play around and try and test:

I do actually use a VGA connected monitor.
But my monitor is directly connected through/to a VGA connector on my (pretty old) laptop.
Not via DP (display port) like in your case.
My laptop doesn’t even have such a connector - just HDMI and VGA.

xrandr gives me info on what modes that monitor supports

I would not expect to have any mode working that is not in this output of what the monitor is capable of.
Which is in my case:

VGA-1 connected 1440x900+0+0 (normal left inverted right x axis y axis) 408mm x 255mm
   1440x900      59.89*+  74.98  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1152x864      75.00  
   1024x768      75.03    70.07    66.01    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   640x480       75.00    72.81    66.67    66.03    59.94  
   720x400       70.08  
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)

I do use Xfce4 - so: no Wayland

You seem to have your VGA monitor connected through DP (display port) - not via VGA connector directly.

Perhaps that is part of your problem.

I’d simply use what works (Xorg)
but that seems to be a matter of where you put your priorities. :man_shrugging:

Not at all. My Motherboard is a Biostar B450M and only has a VGA output and a HDMI output. Xorg and other detects it as DP-1 and that’s how it sees it.

@megavolt I fully understand the EDID issue as I had to deal a little bit with it in Windows. The use case scenario is this: CRT is way better than most current monitors specially playing 480i content and emulators for consoles up to the Wii who output 240p and/or 480i.
The ideal is to output 240p to a CRT monitor or in my case 480p to my VGA to S-Video/Composite converter to my CRT TV so the scaling and resolution is a match preventing motion flicker and down-scaling.
Unfortunately my cheap Chinese VGA converter wasn’t that accurate in their design and its recommended resolution is 1024x768 and the lowest it gets is the VGA standard of 800x600.

This was also a problem with Windows and people in the retro community went as far as to harvest old GPUs with S-Video out and mod AMD drivers to get 240p but today emulators like RetroArch on Windows can output 240p and there are a couple of apps that do the job like CRU (Custom Resolution Utility).

Yeah I get that too.

Post #5 by @linux-aarhus did also mention:

gnome-randr-rust  0.1.1.44.g688e0c2-1                              AUR
    xrandr for Gnome/wayland, on distros that don't support
    wlr-randr

Since wlr-randr is obviously not supported, did you try installing gnome-randr-rust:

pamac build gnome-randr-rust

From the gnome-randr-rust GitHub page:

gnome-randr-rust

A reimplementation of xrandr for Gnome on Wayland, especially for systems that don’t support wlr-output-management-unstable-v1 (e.g. Manjaro). Written ground-up in rust for performance. This is also my first project in rust, so any suggestions are welcome!

@scotty65 Nice find!

I was now able to run xrandr
it gave me the following output

sudo xrandr
Screen 0: minimum 16 x 16, current 3200 x 1080, maximum 32767 x 32767
DP-1 connected 1280x960+0+120 (normal left inverted right x axis y axis) 600mm x 340mm
   1280x960      59.94*+
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.29  
   1280x800      59.81  
   1152x720      59.97  
   960x600       59.63  
   928x580       59.88  
   800x500       59.50  
   768x480       59.90  
   720x480       59.71  
   640x400       59.95  
   320x200       58.14  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.27  
   640x350       59.28  
HDMI-1 connected primary 1920x1080+1280+0 (normal left inverted right x axis y axis) 510mm x 290mm
   1920x1080     59.96*+
   1440x1080     59.99  
   1400x1050     59.98  
   1280x1024     59.89  
   1280x960      59.94  
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.29  
   1680x1050     59.95  
   1440x900      59.89  
   1280x800      59.81  
   1152x720      59.97  
   960x600       59.63  
   928x580       59.88  
   800x500       59.50  
   768x480       59.90  
   720x480       59.71  
   640x400       59.95  
   320x200       58.14  
   1600x900      59.95  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.27  
   640x350       59.28  

640x480 is supported for DP-1 which is my VGA adapter so I typed

xrandr --output DP-1 --mode 640x480 --rate 59.38

and did nothing :slightly_frowning_face:

Been testing xrandr with Xorg in Gnome and looks like Gnome doesn’t like me custom resolution as opening the Display Settings and trying to arrange the desktop or change anything for the VGA adapter immediately crashes the settings window.

I won’t be able to give any help past here as I do not use Gnome, so although I can install gnome-randr-rust, I cannot run it on my Plasma system.

However, I’m just wondering why you are still trying to run xrandr, when the gnome-randr-rust package has the command gnome-randr:

pacman -Ql gnome-randr-rust
gnome-randr-rust /usr/
gnome-randr-rust /usr/bin/
gnome-randr-rust /usr/bin/gnome-randr

As far as I am aware, there is no way xrandr can work on Wayland. This is becoming quite confusing - are you using X11 or Wayland?

Sorry I wasn’t getting that invested in the solution, been dealing with some things in the way so I’m tweaking this slowly.

Yes, I used Xorg to test if 640x480 can be done and it works. Now in Wayland: got the right command which I think it is

gnome-randr modify DP-1 --mode 640x480@59.32 --persistent 

but I get this

D-Bus error: Invalid mode '640x480@59.32' specified (org.freedesktop.DBus.Error.InvalidArgs) Invalid mode '640x480@59.32' specified

Is there any way to make it a valid mode? or is my cmd wrong?

I just don’t have the knowledge to answer that. Sorry.

Perhaps a browse through Issues (open & closed) · maxwellainatchi/gnome-randr-rust might help. Sometimes users will post an issue when they can’t get a command to work, hopeful that the coder will reply with a working command.

Thanks! Already did that. So far no good. Retro content for CRT seems officially dead in Linux and Wayland.