Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 640x480 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...

share|improve this question

2 Answers 2

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
share|improve this answer
    
You're right, I don't create this: xrandr --newmode $(gtf 1280 1024 70.4 | grep Modeline | sed s/Modeline\ // | tr -d '"') by myself, but I put this into small pieces first to look how it work, first gtf 1280 1024 70.4, then with grep and finally with sed and tr. It give the same output which You have in Your xrandr --newmode with one diff - You have "1280x1024_60.00", I have 1280x1024_60.00` - at the end I'm using tr -d '"' to delete '"'. Unfortunatly I still have the same error. –  Borgo Sep 10 '12 at 21:42
    
Why so strange refresh rate? 70.4? Use 60Hz if it's an LCD or 85Hz in case of CRT. And do it step by step, exactly as I have written. –  gorkypl Sep 13 '12 at 17:47
    
Now I tried do it step by step, using 60Hz, and I have still the same error. –  Borgo Sep 18 '12 at 20:54
    
What is the resolution of your monitor and what mode are you trying to add? –  gorkypl Sep 19 '12 at 5:19
    
My resolution is 1280x1024, and I am trying to make (newmode) / add (addmode) this mode: "1280x1024_60.00" 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync –  Borgo Sep 20 '12 at 16:14

i had this BadMatch Error problem until i deleted a previously added "1280x1024_60.00" because it could never use the double quoted mode successfully. Eventually, realized a better name for the mode helped.

So i deleted "1280x1024_60.00" by running the following as a normal user:

$ xrandr --version 
reports 1.4.0 and 1.4
$ xrandr | grep 1280 #Do you see any 1280x1024 anywhere?  Does it have double quotes?
$ xrandr --verbose --delmode VGA1 '"1280x1024_60.00"'
$ xrandr --verbose --rmmode '"1280x1024_60.00"' 

Deleting and removing the junk in the system often did not work or would come back even though i would delete it from my account and root. It would usually come back under the output named VIRTUAL1 instead of VGA1.

Found it much easier to leave the junk and to append a letter at the end of my newly created mode and even dropped the .00, so 1280x1024_60B. Note carefully below there are double quotes around the --newmode parameter, but NOT --addmode nor --mode

$ xrandr --verbose --newmode "1280x1024_60B" 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync
$ xrandr --verbose --addmode VGA1 1280x1024_60B
$ xrandr --verbose --output VGA1 --mode 1280x1024_60B

A little screen flicker and my external 19" square monitor is running at 1280x1024.

share|improve this answer
    
This was the only solution after hours of research that worked, thanks a lot, you saved my day. Cheers –  Shanil Soni Aug 10 at 12:32
    
However setting loses after a session, any solution to make it permanent? –  Shanil Soni Aug 10 at 12:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.