Old title - "change resolution to 1280x1024 using xrandr gives: X Error of failed request: BadValue (integer parameter out of range for operation)"
I have installed a fresh Ubuntu 17.10 and have a monitor with 5:4 resolution. settings has no resolution higher than 1024x768. But I need the resolution 1280x1024 (5:4). I use the default motherboard graphics card:
# lspci|grep VGA
00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03)
Also xrandr gives the following:
$ xrandr
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192
XWAYLAND0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 59.92*+
I tried to add the 1280x1024 resolution using xrandr. so first created the resolution information using gtf:
$ gtf 1280 1024 60
# 1280x1024 @ 60.00 Hz (GTF) hsync: 63.60 kHz; pclk: 108.88 MHz
Modeline "1280x1024_60.00" 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync
Then added to resolutions:
xrandr --newmode "1280x1024_60.00" 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync
then again did the command: xrandr --addmode XWAYLAND0 1280x1024_60.00
Then nothing changed. When I tried to change it using xrandr --output XWAYLAND0 --mode 1280x1024_60.00 --rate 60
But an error occurred:
$ xrandr --output XWAYLAND0 --mode 1280x1024 --rate 60
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 7 (RRSetScreenSize)
Value in failed request: 0x0
Serial number of failed request: 21
Current serial number in output stream: 22
I don't know what did I do wrong. Or how to change resolution to the correct one: 1280x1024
You can try to set a custom resolution with wayland with some effort and mixed results.
You should probably start by filing a bug report, including your graphics card and monitor(s), against wayland
How do I report a bug?
https://help.ubuntu.com/community/ReportingBugs
Adding a Custom Resolution
xrandr
will NOT work with Wayland !!You can try to add a custom resolution using your modline similar to how you would with xrandr, but with a few additional steps.
First, I am not sure if this works with secure boot, so I advise you start by Disabling secure boot
From https://ask.fedoraproject.org/en/question/99867/how-to-add-a-custom-resolution-to-weyland-fedora-25/ and https://wiki.archlinux.org/index.php/Kernel_mode_setting#Forcing_modes_and_EDID
First, you'll need to clone edid-generator. Then you can pass it your modeline (with the same arguments you gave
xrandr --newmode
From https://github.com/akatrevorjay/edid-generator
Install requirements
Download & extract
The binary is in ~/edid-generator-master as
modeline2edid
Run
modeline2edid
with your modline, using the example in askfedora link,Modify that command to your desired resolution.
See How to set a custom resolution? for details (if needed)
Then generate the edid binary with make
You will now have your new .bin ,
3840x2160.bin
in this case.Now, from The Arch wiki enable your custom resoulution
Change
3840x2160.bin
to your custom resolution.Note: There are already some custom .bin included, you can see them with
ls *.bin
I am not sure if you can use them without make or not.Test by rebooting
When you reboot, edit the kernel line in grub, adding
See How do I add a kernel boot parameter? and https://wiki.ubuntu.com/Kernel/KernelBootParameters
Go down to the line starting with
linux
and adddrm_kms_helper.edid_firmware=edid/3840x2160.bin
at the end of the line afterro quiet splash
Assuming all that works, make it permanent
Add in the custom resolutoin
Save your edit Ctrl+x
update grub
Reboot and enjoy your custom resolution
Find
GRUB_CMDLINE_LINUX_DEFAULT
line, add in quotes at the end (usually aftersplash
):Replace
VGA-1
with your X output (i.e.HDMI-1
,DVI-0
,DP-1
, etc.), save, exit editor, then:After reboot your
grub
will tell your kernel that whatever is connected toVGA-1
supports 1920x1080 at 60Hz. Both Xorg and Wayland get this information from the kernel. Worked for me to run old Samsung SyncMaster 2343NW as a 2nd screen through DVI to D-SUB adapter.