Engage. Your Community

[SOLVED] Custom resolution - How to save it to xrandr ?

Hey,

I have 4K display, but gaming I need to do in wtih 1920x1080 resolution from Performance reasons. Most of the games this is no problem, but seems that some games do check the available resolutions from xrandr. Some reason my laptop does not have 1920x1080 resolution listed so I have to add it manually. I do it this way:

  1. cvt 1920 1080
  2. sudo xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
  3. sudo xrandr --addmode eDP-1-1 1920x1080_60.00

This method works perfectly, but when I reboot then its gone. How do I make this permanent?

I'm using Xorg with Nvidia with proprietary drivers.

Thank you.

When you installed the nvidia drivers you should have also got nvidia settings. You can set the resolution there.

I do have Nvidia settings, but there is no place where I can add new resolutions. Normally 1920x1080p is very common resolution, but for some case this my Dell laptop do not have it. I have to add it manually each time I restart my PC.

xrandr --verbose

eDP-1-1 connected primary 3840x2160+0+0 (0x45) normal (normal left inverted right x axis y axis) 346mm x 194mm
	Identifier: 0x42
	Timestamp:  31663
	Subpixel:   unknown
	Gamma:      1.0:1.0:1.0
	Brightness: 1.0
	Clones:    
	CRTC:       0
	CRTCs:      0 5 6
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	_MUTTER_PRESENTATION_OUTPUT: 0 
	EDID: 
		00ffffffffffff004d10501400000000
		24190104a52313780ede50a3544c9926
		0f505400000001010101010101010101
		0101010101014dd000a0f0703e803020
		35005ac2100000184dd000a0f0706882
		30203500000000000000000000fe004b
		59394a48804c51313536443100000000
		0002010323001100000b010a20200054
	PRIME Synchronization: 0 
		supported: 0, 1
	scaling mode: Full aspect 
		supported: None, Full, Center, Full aspect
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	audio: auto 
		supported: force-dvi, off, auto, on
  3840x2160 (0x45) 533.250MHz -HSync -VSync *current +preferred
        h: width  3840 start 3888 end 3920 total 4000 skew    0 clock 133.31KHz
        v: height 2160 start 2163 end 2168 total 2222           clock  60.00Hz
  3840x2160 (0x46) 533.250MHz -HSync -VSync
        h: width  3840 start 3888 end 3920 total 4000 skew    0 clock 133.31KHz
        v: height 2160 start 2163 end 2168 total 2776           clock  48.02Hz
  2048x1536 (0x47) 266.950MHz -HSync +VSync
        h: width  2048 start 2200 end 2424 total 2800 skew    0 clock  95.34KHz
        v: height 1536 start 1537 end 1540 total 1589           clock  60.00Hz
  1920x1440 (0x48) 234.000MHz -HSync +VSync
        h: width  1920 start 2048 end 2256 total 2600 skew    0 clock  90.00KHz
        v: height 1440 start 1441 end 1444 total 1500           clock  60.00Hz
  1856x1392 (0x49) 218.300MHz -HSync +VSync
        h: width  1856 start 1952 end 2176 total 2528 skew    0 clock  86.35KHz
        v: height 1392 start 1393 end 1396 total 1439           clock  60.01Hz
  1792x1344 (0x4a) 204.800MHz -HSync +VSync
        h: width  1792 start 1920 end 2120 total 2448 skew    0 clock  83.66KHz
        v: height 1344 start 1345 end 1348 total 1394           clock  60.01Hz
  1600x1200 (0x4b) 162.000MHz +HSync +VSync
        h: width  1600 start 1664 end 1856 total 2160 skew    0 clock  75.00KHz
        v: height 1200 start 1201 end 1204 total 1250           clock  60.00Hz
  1400x1050 (0x4c) 122.000MHz +HSync +VSync
        h: width  1400 start 1488 end 1640 total 1880 skew    0 clock  64.89KHz
        v: height 1050 start 1052 end 1064 total 1082           clock  59.98Hz
  1280x1024 (0x4d) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1280x960 (0x4e) 108.000MHz +HSync +VSync
        h: width  1280 start 1376 end 1488 total 1800 skew    0 clock  60.00KHz
        v: height  960 start  961 end  964 total 1000           clock  60.00Hz
  1024x768 (0x4f) 133.475MHz -HSync +VSync DoubleScan
        h: width  1024 start 1100 end 1212 total 1400 skew    0 clock  95.34KHz
        v: height  768 start  768 end  770 total  794           clock  60.04Hz
  1024x768 (0x50) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  960x720 (0x51) 117.000MHz -HSync +VSync DoubleScan
        h: width   960 start 1024 end 1128 total 1300 skew    0 clock  90.00KHz
        v: height  720 start  720 end  722 total  750           clock  60.00Hz
  928x696 (0x52) 109.150MHz -HSync +VSync DoubleScan
        h: width   928 start  976 end 1088 total 1264 skew    0 clock  86.35KHz
        v: height  696 start  696 end  698 total  719           clock  60.05Hz
  896x672 (0x53) 102.400MHz -HSync +VSync DoubleScan
        h: width   896 start  960 end 1060 total 1224 skew    0 clock  83.66KHz
        v: height  672 start  672 end  674 total  697           clock  60.01Hz
  800x600 (0x54) 81.000MHz +HSync +VSync DoubleScan
        h: width   800 start  832 end  928 total 1080 skew    0 clock  75.00KHz
        v: height  600 start  600 end  602 total  625           clock  60.00Hz
  800x600 (0x55) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x56) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz
  700x525 (0x57) 61.000MHz +HSync +VSync DoubleScan
        h: width   700 start  744 end  820 total  940 skew    0 clock  64.89KHz
        v: height  525 start  526 end  532 total  541           clock  59.98Hz
  640x512 (0x58) 54.000MHz +HSync +VSync DoubleScan
        h: width   640 start  664 end  720 total  844 skew    0 clock  63.98KHz
        v: height  512 start  512 end  514 total  533           clock  60.02Hz
  640x480 (0x59) 54.000MHz +HSync +VSync DoubleScan
        h: width   640 start  688 end  744 total  900 skew    0 clock  60.00KHz
        v: height  480 start  480 end  482 total  500           clock  60.00Hz
  640x480 (0x5a) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
  512x384 (0x5b) 32.500MHz -HSync -VSync DoubleScan
        h: width   512 start  524 end  592 total  672 skew    0 clock  48.36KHz
        v: height  384 start  385 end  388 total  403           clock  60.00Hz
  400x300 (0x5c) 20.000MHz +HSync +VSync DoubleScan
        h: width   400 start  420 end  484 total  528 skew    0 clock  37.88KHz
        v: height  300 start  300 end  302 total  314           clock  60.32Hz
  400x300 (0x5d) 18.000MHz +HSync +VSync DoubleScan
        h: width   400 start  412 end  448 total  512 skew    0 clock  35.16KHz
        v: height  300 start  300 end  301 total  312           clock  56.34Hz
  320x240 (0x5e) 12.587MHz -HSync -VSync DoubleScan
        h: width   320 start  328 end  376 total  400 skew    0 clock  31.47KHz
        v: height  240 start  245 end  246 total  262           clock  60.05Hz

Hi there Faults,

I edited your post and put the output between code blocks so it's easier for others to read. If you're posting a reply with a output or code, please click on the questionmark on the right of the reply box which opens the Engage Markdown Syntax. It shows the available format options for code, italic & bold etc.. :)

The reference I found to nvidia settings having that option must be out of date. I suspect the problem is that the nvidia driver sets the the available resolutions to those it supports. I don't have access to test anything with nvidia drivers.

I'll ask on irc for you. There a couple of regulars there who are familiar with the proprietary drivers.

Thank you! I take look into IRC.

There has been no replies on irc yet but I'll ask again.

However maybe you can put the commands you need to run in a script and then add that to the autostart applications. That way the resolution should be available at every reboot. It isn't a perfect solution but is the best I've got at the moment.

The post got a response today.

Have you tried running the commands without sudo? If they work without sudo you could add them to .xsession, if you don't have it just create it and make it executable.

Hey,

I actually tried a make Startup application. But so far I have failed...

I put it in ~/.config/autostart/ and my 1080p.desktop looks like this:

[Desktop Entry]
Name=1080p
GenericName=Full HD Resolution
Comment=Adds Full HD resolution to xrandr
Exec=/home/vs/Scripts/1080p.sh
Terminal=false
Type=application/x-shellscript
X-GNOME-Autostart-enabled=true

Doesn't work... however if I run 1080p.sh manually it works.

Faults wrote:
Hey,

I actually tried a make Startup application. But so far I have failed...

I put it in ~/.config/autostart/ and my 1080p.desktop looks like this:

[Desktop Entry]  
Name=1080p  
GenericName=Full HD Resolution  
Comment=Adds Full HD resolution to xrandr  
Exec=/home/vs/Scripts/1080p.sh  
Terminal=false  
Type=application/x-shellscript  
X-GNOME-Autostart-enabled=true  

Doesn't work... however if I run 1080p.sh manually it works.

Did you try adding the script, not the desktop file, to autostart?

Or try the other suggestion, to use .xsession.

nvidia only displays supported modes from the monitors edid, you can use nvidia-settings to acquire the edid from the monitor tab and parse it with the edid-decode package to confirm.

$ edid-decode edid.bin
Extracted contents:
header:          00 ff ff ff ff ff ff 00
serial number:   26 cd 04 71 01 01 01 01 ff 18
version:         01 04
basic params:    b5 3e 22 78 3a
chroma info:     08 a5 a2 57 4f a2 28 0f 50 54
established:     bf ef 80
standard:        d1 c0 e1 c0 d1 00 a9 40 a9 c0 d1 40 b3 00 81 80
descriptor 1:    4d d0 00 a0 f0 70 3e 80 30 20 35 00 6d 55 21 00 00 1a
descriptor 2:    56 5e 00 a0 a0 a0 29 50 30 20 35 00 6d 55 21 00 00 1a
descriptor 3:    00 00 00 fd 00 17 4c 1e 88 37 01 0a 20 20 20 20 20 20
descriptor 4:    00 00 00 fc 00 50 4c 32 38 38 38 55 48 0a 20 20 20 20
extensions:      01
checksum:        6f

Manufacturer: IVM Model 7104 Serial Number 16843009
Made week 255 of model year 24
EDID version: 1.4
Digital display
10 bits per primary color channel
DisplayPort interface
Maximum image size: 62 cm x 34 cm
Gamma: 2.20
DPMS levels: Off
Supported color formats: RGB 4:4:4, YCrCb 4:4:4, YCrCb 4:2:2
First detailed timing is preferred timing
Established timings supported:
  720x400@70Hz
  640x480@60Hz
  640x480@67Hz
  640x480@72Hz
  640x480@75Hz
  800x600@56Hz
  800x600@60Hz
  800x600@72Hz
  800x600@75Hz
  832x624@75Hz
  1024x768@60Hz
  1024x768@70Hz
  1024x768@75Hz
  1280x1024@75Hz
  1152x870@75Hz
Standard timings supported:
  1920x1080@60Hz
  2048x1152@60Hz
  1920x1200@60Hz
  1600x1200@60Hz
  1600x900@60Hz
  1920x1440@60Hz
  1680x1050@60Hz
  1280x1024@60Hz
Detailed mode: Clock 533.250 MHz, 621 mm x 341 mm
               3840 3888 3920 4000 hborder 0
               2160 2163 2168 2222 vborder 0
               +hsync -vsync 
Detailed mode: Clock 241.500 MHz, 621 mm x 341 mm
               2560 2608 2640 2720 hborder 0
               1440 1443 1448 1481 vborder 0
               +hsync -vsync 
Monitor ranges (bare limits): 23-76Hz V, 30-136kHz H, max dotclock 550MHz
Monitor name: PL2888UH
Has 1 extension blocks
Checksum: 0x6f (valid)

CEA extension block
Extension version: 3
42 bytes of CEA data
  Video data block
    VIC 16 1920x1080@60Hz 
    VIC 31 1920x1080@50Hz 
    VIC 05 1920x1080i@60Hz 
    VIC 20 1920x1080i@50Hz 
    VIC 04 1280x720@60Hz 
    VIC 19 1280x720@50Hz 
    VIC 03 720x480@60Hz 
    VIC 02 720x480@60Hz 
    VIC 18 720x576@50Hz 
    VIC 17 720x576@50Hz 
    VIC 07 1440x480i@60Hz 
    VIC 06 1440x480i@60Hz 
    VIC 22 1440x576i@50Hz 
    VIC 21 1440x576i@50Hz 
    VIC 32 1920x1080@24Hz 
    VIC 01 640x480@60Hz 
    VIC 93 Unknown mode (native)
    VIC 94 Unknown mode (native)
    VIC 95 Unknown mode (native)
  Audio data block
    Linear PCM, max channels 1
    Supported sample rates (kHz): 192 176.4 96 88.2 48 44.1 32
    Supported sample sizes (bits): 24 20 16
  Speaker allocation data block
  Vendor-specific data block, OUI 0014b9
Underscans PC formats by default
Basic audio support
Supports YCbCr 4:4:4
Supports YCbCr 4:2:2
3 native detailed modes
Detailed mode: Clock 296.700 MHz, 621 mm x 341 mm
               3840 4016 4104 4400 hborder 0
               2160 2168 2178 2250 vborder 0
               +hsync +vsync 
Detailed mode: Clock 241.500 MHz, 621 mm x 341 mm
               2560 2608 2640 2720 hborder 0
               1440 1443 1448 1481 vborder 0
               +hsync -vsync 
Detailed mode: Clock 148.500 MHz, 621 mm x 341 mm
               1920 2008 2052 2200 hborder 0
               1080 1084 1089 1125 vborder 0
               +hsync +vsync 
Detailed mode: Clock 74.250 MHz, 621 mm x 341 mm
               1920 2008 2052 2200 hborder 0
                540  542  547  562 vborder 0
               +hsync +vsync interlaced 
Checksum: 0xaf (valid)

Hey,

I managed to solve this. I think the key is to COPY one of the .desktop files and not just create a file with .desktop extension. Also "sh" was needed to add to exec.

I copied from Dropbox and little modified it. Its not perfect, but it works:

[Desktop Entry]
Name=fullhd
GenericName=Full HD Resolution to xrandr
Comment=Full HD Resolution 1920x1080 for xrandr
Exec=sh /home/vs/Scripts/1080p.sh
Terminal=true
Type=Application
Categories=Script
StartupNotify=false
X-GNOME-Autostart-Delay=10

Please Log In to participate with the community.