Can't add custom resolution with xrandr

Screen resolution, 3D Acceleration, nVidia, ATI
Forum rules
Before you post please read this
GraphX
Level 1
Level 1
Posts: 4
Joined: Mon Jul 31, 2017 4:21 pm

Can't add custom resolution with xrandr

Postby GraphX » Mon Jul 31, 2017 4:34 pm

Hello
I tried for few days and can't find a solution for my problem.
I'm trying to add custom resolution which isn't supported by monitor by default, I'm overclocking it to 75hz on Windows with no problem.
This is what I get:

Code: Select all

graphx@GraphX-Lin ~ $ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080     60.00*+  59.94    50.00 
   1680x1050     59.95 
   1600x900      60.00 
   1440x900      59.89 
   1280x1024     75.02    60.02 
   1280x800      59.81 
   1280x720      60.00    59.94    50.00 
   1152x864      75.00 
   1024x768      75.03    70.07    60.00 
   800x600       75.00    72.19    60.32    56.25 
   720x576       50.00 
   720x480       59.94 
   640x480       75.00    72.81    59.94 
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)

graphx@GraphX-Lin ~ $ cvt 1920 1080 75
# 1920x1080 74.91 Hz (CVT 2.07M9) hsync: 84.64 kHz; pclk: 220.75 MHz
Modeline "1920x1080_75.00"  220.75  1920 2064 2264 2608  1080 1083 1088 1130 -hsync +vsync


graphx@GraphX-Lin ~ $ xrandr --newmode 1920x75 220.75  1920 2064 2264 2608  1080 1083 1088 1130 -hsync +vsync
graphx@GraphX-Lin ~ $ xrandr --addmode HDMI-0 1920x75
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  18 (RRAddOutputMode)
  Serial number of failed request:  45
  Current serial number in output stream:  46


System info:

Code: Select all

Mint Sonya 64bit
Inxi:
CPU~Quad core Intel Core i7-4790K (-HT-MCP-) speed/max~2219/4600 MHz Kernel~4.8.0-53-generic x86_64 Up~1:10 Mem~1555.2/7928.7MB HDD~3151.4GB(9.8% used) Procs~252 Client~Shell inxi~2.2.35
Nvidia GeForce GTX 980
Samsung LS22E391HS


I hope i've provided enough info
This resolution is not supported normally, it's overclocked and i think that's the problem, is there a way to override it?

Thanks for any help

User avatar
roblm
Level 8
Level 8
Posts: 2353
Joined: Sun Feb 24, 2013 2:41 pm

Re: Can't add custom resolution with xrandr

Postby roblm » Wed Aug 02, 2017 11:11 am

GraphX wrote:This resolution is not supported normally, it's overclocked and i think that's the problem, is there a way to override it?

You can with the Nvidia driver, but do so at your own risk. You may get a message about the resolution being unsupported.
You need to provide some additional info. Use this command in the Terminal and post the output: inxi -SGx

GraphX
Level 1
Level 1
Posts: 4
Joined: Mon Jul 31, 2017 4:21 pm

Re: Can't add custom resolution with xrandr

Postby GraphX » Wed Aug 02, 2017 6:17 pm

Code: Select all

System:    Host: GraphX-Lin Kernel: 4.8.0-53-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.4.3 (Gtk 3.18.9-1ubuntu3.3)
           Distro: Linux Mint 18.2 Sonya
Graphics:  Card: NVIDIA GM204 [GeForce GTX 980] bus-ID: 01:00.0
           Display Server: X.Org 1.18.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau)
           Resolution: 1920x1080@60.00hz, 1920x1080@60.00hz
           GLX Renderer: GeForce GTX 980/PCIe/SSE2
           GLX Version: 4.5.0 NVIDIA 375.66 Direct Rendering: Yes

User avatar
roblm
Level 8
Level 8
Posts: 2353
Joined: Sun Feb 24, 2013 2:41 pm

Re: Can't add custom resolution with xrandr

Postby roblm » Wed Aug 02, 2017 7:44 pm

Use this command to create a xorg.conf file:

Code: Select all

gksudo xed /etc/X11/xorg.conf

In the opened empty file, add these lines:

Code: Select all

Section "ServerLayout"
   Identifier   "Layout0"
   Screen   0 "Screen0" 0 0
EndSection

Section "Monitor"
   Identifier    "Monitor0"
   HorizSync       24.0 - 94.0      
   VertRefresh     24.0 - 76.0
   Modeline "1920x1080_74.97"  174.50  1920 1968 2000 2080  1080 1083 1087 1119  +HSync -VSync
EndSection

Section "Device"
   Identifier   "Device0"
   Driver   "nvidia"            
   Option "UseEdidFreqs" "false"
EndSection

Section "Screen"
   Identifier   "Screen0"
   Device   "Device0"
   Monitor   "Monitor0"
   DefaultDepth   24
   Option "ModeValidation" "AllowNonEdidModes"
   Option "MetaModes" "HDMI-0:1920x1080_74.97 +0+0"
EndSection

Log out and back in. Use the xrandr command to check if the correct refresh rate is being used. If not, go to Preferences > Display and check for a second 1920x1080 resolution listed. Cinnamon doesn't have a setting for refresh rates. If nothing is listed, then use this command:

Code: Select all

xrandr --output HDMI-0 --mode 1920x1080 --rate 75


If those methods don't work, then use this xorg.conf file:

Code: Select all

Section "ServerLayout"
   Identifier   "Layout0"
   Screen   0 "Screen0" 0 0
EndSection

Section "Monitor"
   Identifier    "Monitor0"
   HorizSync       24.0 - 94.0      
   VertRefresh     24.0 - 76.0
   Modeline "1920x1080_74.97"  174.50  1920 1968 2000 2080  1080 1083 1087 1119  +HSync -VSync
EndSection

Section "Device"
   Identifier   "Device0"
   Driver   "nvidia"            
   Option "UseEdidFreqs" "false"
EndSection

Section "Screen"
   Identifier   "Screen0"
   Device   "Device0"
   Monitor   "Monitor0"
   DefaultDepth   24
   Option "ModeValidation" "NoXserverModes, NoVesaModes, NoEdidModes, AllowNonEdidModes"
   Option "MetaModes" "HDMI-0:1920x1080_74.97 +0+0"
EndSection

There will be only the 1920x1080 at 75 Hz resolution listed.

GraphX
Level 1
Level 1
Posts: 4
Joined: Mon Jul 31, 2017 4:21 pm

Re: Can't add custom resolution with xrandr

Postby GraphX » Thu Aug 03, 2017 4:37 pm

Previous options didn't work, the last one with making xorg with your values made changes. Not good tho.
I logged out after that and screen went all black with white underscore blinking, and screen restarting repetitively, now Linux won't load.
I assumre resetting xorg file will work, how do I do it with recovery mode?
I will try same thing but with my own created modeline from cvt, because the ones you gave me were different.

User avatar
roblm
Level 8
Level 8
Posts: 2353
Joined: Sun Feb 24, 2013 2:41 pm

Re: Can't add custom resolution with xrandr

Postby roblm » Thu Aug 03, 2017 8:20 pm

I forgot to give these instructions:

If there is a problem getting back to the desktop, then press Ctrl+Alt+F1 to enter the virtual console tty1. Login and then type this command to remove the xorg.conf file:

Code: Select all

sudo rm /etc/X11/xorg.conf

Then type: sudo reboot

GraphX wrote:I will try same thing but with my own created modeline from cvt, because the ones you gave me were different.

That Modeline is a reduced blanking mode, which is better for digital displays, which need a lower pixel clock and timing values. The Modelines created with the cvt tool, such as cvt 1920 1080 75 were designed for the older CRT monitors, however they often will work with digital displays. The cvt tool can also create reduced blanking modes with the command
cvt 1920 1080 -r, but only for refresh rates using 60 Hz or multiples of it. I used umc (universal modeline calculator), which can create reduced blanking modes with other refresh rates: umc 1920 1080 75 --rbt

You can try using this Modeline created with cvt, which is the one you tried using in your first post:

Code: Select all

Modeline "1920x1080_75.00"  220.75  1920 2064 2264 2608  1080 1083 1088 1130 -hsync +vsync

Here are the two xorg.conf files, using that Modeline:

Code: Select all

Section "ServerLayout"
   Identifier   "Layout0"
   Screen   0 "Screen0" 0 0
EndSection

Section "Monitor"
   Identifier    "Monitor0"
   HorizSync       24.0 - 94.0      
   VertRefresh     24.0 - 76.0
   Modeline "1920x1080_75.00"  220.75  1920 2064 2264 2608  1080 1083 1088 1130 -hsync +vsync
EndSection

Section "Device"
   Identifier   "Device0"
   Driver   "nvidia"            
   Option "UseEdidFreqs" "false"
EndSection

Section "Screen"
   Identifier   "Screen0"
   Device   "Device0"
   Monitor   "Monitor0"
   DefaultDepth   24
   Option "ModeValidation" "AllowNonEdidModes"
   Option "MetaModes" "HDMI-0: 1920x1080_75 +0+0"
EndSection


Code: Select all

Section "ServerLayout"
   Identifier   "Layout0"
   Screen   0 "Screen0" 0 0
EndSection

Section "Monitor"
   Identifier    "Monitor0"
   HorizSync       24.0 - 94.0      
   VertRefresh     24.0 - 76.0
   Modeline "1920x1080_75.00"  220.75  1920 2064 2264 2608  1080 1083 1088 1130 -hsync +vsync
EndSection

Section "Device"
   Identifier   "Device0"
   Driver   "nvidia"            
   Option "UseEdidFreqs" "false"
EndSection

Section "Screen"
   Identifier   "Screen0"
   Device   "Device0"
   Monitor   "Monitor0"
   DefaultDepth   24
   Option "ModeValidation" "NoXserverModes, NoVesaModes, NoEdidModes, AllowNonEdidModes"
   Option "MetaModes" "HDMI-0: 1920x1080_75 +0+0"
EndSection


If those don't work, then go back to my original xorg.conf files, with a slight change:

Code: Select all

Section "ServerLayout"
   Identifier   "Layout0"
   Screen   0 "Screen0" 0 0
EndSection

Section "Monitor"
   Identifier    "Monitor0"
   HorizSync       24.0 - 94.0      
   VertRefresh     24.0 - 76.0
   Modeline "1920x1080_75.00"  174.50  1920 1968 2000 2080  1080 1083 1087 1119  +HSync -VSync
EndSection

Section "Device"
   Identifier   "Device0"
   Driver   "nvidia"            
   Option "UseEdidFreqs" "false"
EndSection

Section "Screen"
   Identifier   "Screen0"
   Device   "Device0"
   Monitor   "Monitor0"
   DefaultDepth   24
   Option "ModeValidation" "AllowNonEdidModes"
   Option "MetaModes" "HDMI-0: 1920x1080_75 +0+0"
EndSection


Code: Select all

Section "ServerLayout"
   Identifier   "Layout0"
   Screen   0 "Screen0" 0 0
EndSection

Section "Monitor"
   Identifier    "Monitor0"
   HorizSync       24.0 - 94.0      
   VertRefresh     24.0 - 76.0
   Modeline "1920x1080_75.00"  174.50  1920 1968 2000 2080  1080 1083 1087 1119  +HSync -VSync
EndSection

Section "Device"
   Identifier   "Device0"
   Driver   "nvidia"            
   Option "UseEdidFreqs" "false"
EndSection

Section "Screen"
   Identifier   "Screen0"
   Device   "Device0"
   Monitor   "Monitor0"
   DefaultDepth   24
   Option "ModeValidation" "NoXserverModes, NoVesaModes, NoEdidModes, AllowNonEdidModes"
   Option "MetaModes" "HDMI-0: 1920x1080_75 +0+0"
EndSection

GraphX
Level 1
Level 1
Posts: 4
Joined: Mon Jul 31, 2017 4:21 pm

Re: Can't add custom resolution with xrandr

Postby GraphX » Sat Nov 04, 2017 2:50 pm

After a long break i tried all (with only 1 monitor plugged to be sure), and nothing works.
Seems like "NoEdidModes" is doing something at least, but after logging out i always get black screen with white underscore blinking. While using all other options except this one does nothing.
I have been checking xrandr after doing those commands and this mode is never listed too.


Return to “Graphic Cards & Monitors”