Linux – Cannot add new mode in xrandr for external monitor

arch linuxawesomenvidiaxorgxrandr

Today I was trying to connect my second monitor to my notebook. I have:

  • nvidia graphic card
  • 304.43 drivers [support xrandr 1.2]
  • archlinux [up-to-date]
  • awesome wm
  • xrandr 1.3

My problem is with bigger resolution than 640×480 for my external monitor (VGA).
xrandr -q:

Screen 0: minimum 8 x 8, current 1920 x 800, maximum 8192 x 8192
VGA-0 connected 640x480+1280+0 (normal left inverted right x axis y axis) 0mm
   640x480        59.9*+
   320x240       120.1  
LVDS-0 connected 1280x800+0+0 (normal left inverted right x axis y axis) 331m
   1280x800       59.9*+
HDMI-0 disconnected (normal left inverted right x axis y axis)

As we can see the is no higher resolution fo VGA, so I add new mode:

xrandr --newmode $(gtf 1280 1024 70.4 | grep Modeline | sed s/Modeline\ // | tr -d '"')

I checked avaible resolution and refresh rate under windows: one of them was 1024x768x70 (OSD of my monitor said that it is 70.4HZ). After create new mode, I wanted to add it:

xrandr --addmode VGA-0 1280x1024_70.40

And… It failed:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  153 (RANDR)
  Minor opcode of failed request:  18 (RRAddOutputMode)
  Serial number of failed request:  29
  Current serial number in output stream:  30

From google I learned that in older xrandr / nvidia drivers was problem with list of avaible modes, but now with support of xrandr 1.2 by nvidia drivers it should be better. I also try with lower resolution and refresh rate (eg. 1024x768x50), but I've got the same error.
I'm out of ideas what to do with this problem…

Best Answer

I am not sure if you have created the string following xrandr --newmode by yourself or have you copied it from somewhere else, but it won't work in its current form.

I recommend to do it step by step.

First, you need to generate the new mode. I recommend using 60Hz with LCD or 85Hz with CRT monitor

gtf 1280 1024 60

You will get something like:

 # 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 present this mode to xrandr using --newmode (copy-paste the line starting with 'Modeline'.

 xrandr --newmode "1280x1024_60.00"  108.88  1280 1360 1496 1712  1024 1025 1028 1060  -HSync Vsync

Then add this mode to VGA-0:

xrandr --addmode VGA-0 "1280x1024_60.00"

And finally you can use this new mode:

 xrandr --output VGA-0 --mode 1280x1024_60.00
Related Question