You are not logged in.

#1 2016-05-03 12:06:46

freaxtux
Member
Registered: 2012-07-17
Posts: 37

[SOLVED]xrandr fails to set resolution

Hello, I'm trying to use three monitors at a time on my laptop
Apart from the default monitor, I have one on HDMI and the other on VGA
This is the output of xrandr

$ xrandr
Screen 0: minimum 8 x 8, current 4864 x 1080, maximum 32767 x 32767
eDP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080     60.01*+  40.01  
   1400x1050     59.98  
   1600x900      60.00  
   1280x1024     60.02  
   1280x960      60.00  
   1368x768      60.00  
   1280x720      60.00  
   1024x768      60.00  
   1024x576      60.00  
   960x540       60.00  
   800x600       60.32    56.25  
   864x486       60.00  
   640x480       59.94  
   720x405       60.00  
   640x360       60.00  
HDMI1 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 521mm x 293mm
   1920x1080     60.00*+  50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1680x1050     59.88  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x960      60.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.08    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  
VGA1 connected 1024x768+3840+312 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768      60.00* 
   800x600       60.32    56.25  
   848x480       60.00  
   640x480       59.94  
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

The one on VGA supports up to 1680x1050 but xrandr doesn't detect so as you see.
I followed "Adding undetected resolutions" on xrandr and this is how it went:

$ cvt 1680 1050
# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
$ xrandr --newmode "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
$ xrandr --addmode VGA1 "1680x1050_60.00"
$ xrandr --output VGA1 --mode "1680x1050_60.00"

and then the screen goes black for a moment and reverts back to original 1024x768 resolution.
In ~/.local/share/xorg/Xorg.0.log it just shows the resolution changing back and forth

[  2093.805] (II) intel(0): resizing framebuffer to 4864x1080
[  2093.844] (II) intel(0): switch to mode 1024x768@60.0 on VGA1 using pipe 1, position (3840, 312), rotation normal, reflection none
[  2100.337] (II) intel(0): resizing framebuffer to 5520x1362
[  2100.393] (II) intel(0): switch to mode 1680x1050@60.0 on VGA1 using pipe 1, position (3840, 312), rotation normal, reflection none
[  2100.532] (II) intel(0): resizing framebuffer to 4864x1080
[  2100.560] (II) intel(0): switch to mode 1024x768@60.0 on VGA1 using pipe 1, position (3840, 312), rotation normal, reflection none
[  2107.669] (II) intel(0): resizing framebuffer to 5520x1362
[  2107.743] (II) intel(0): switch to mode 1680x1050@60.0 on VGA1 using pipe 1, position (3840, 312), rotation normal, reflection none
[  2107.865] (II) intel(0): resizing framebuffer to 4864x1080
[  2107.892] (II) intel(0): switch to mode 1024x768@60.0 on VGA1 using pipe 1, position (3840, 312), rotation normal, reflection none

when I try xrandr with --verbose there's nothing much to see

$ xrandr --output VGA1 --mode 1680x1050_60.00 --verbose
screen 0: 5520x1362 1461x360 mm  95.92dpi
crtc 1: 1680x1050_60.00-1  60.00 +3840+312 "VGA1"

I've tried a few different modelines, including gtf, cvt, cvt -r, 60Hz, 59Hz, but nothing has worked so far
Can someone give any advice on this?
Thank you in advance

Last edited by freaxtux (2016-05-03 17:09:03)

Offline

#2 2016-05-03 17:08:46

freaxtux
Member
Registered: 2012-07-17
Posts: 37

Re: [SOLVED]xrandr fails to set resolution

FINALLY!

After hours of being lost I found this link which explains it.

Somewhere around version 3.14 gnome added a feature where it remembers the configurations of previously plugged-in monitors. Unfortunately, this feature sometimes prevents gnome from allowing a monitor's proper resolution to be set. Common symptoms are xrandr failing to change the resolution and providing no error as to why, as well as monitors exhibiting the correct resolution at a tty console, but not in gnome.

The configurations are stored in an undocumented file in ~/.config/monitors.xml. You can poke through this file to see if you can identify the offending entry and remove it. Or you can regain control over your monitors entirely and delete this file altogether.

After changing the file, you may need to reboot or restart gnome before you can set the correct resolution with xrandr.

So in short, this occurs in GNOME(around >=3.14) you should delete ~/.config/monitors.xml and then reboot. After that, you can freely set the resolution via xrandr

Offline

Board footer

Powered by FluxBB