PDA

View Full Version : Setting Monitor Refresh Rate Permanently



frap1
19th December 2015, 07:22 AM
Hello,

I am running Fedora 23. I have a Del U3415W monitor that supports 3440x1440@60Hz. Unfortunately, my video card is only HDMI 1.4 and will only support that resolution at 50Hz. This causes the monitor to remain blank after boot. I get no login screen or anything else after I blindly login.

Now, if I plug in a second monitor (1280x1024) and open a terminal, xrandr gives:


$ xrandr
Screen 0: minimum 320 x 200, current 4720 x 1440, maximum 16384 x 16384
HDMI-3 connected primary 3440x1440+0+0 (normal left inverted right x axis y axis) 798mm x 335mm
3440x1440 59.97*+ 49.99 29.99
2560x1440 59.95
2560x1080 60.00
1720x1440 60.00
1920x1080 60.00 60.00 50.00 59.94
1920x1080i 60.00 50.00 59.94
1600x1200 60.00
1280x1024 75.02 60.02
1280x800 59.91
1152x864 75.00
1280x720 60.00 50.00 59.94
1024x768 75.08 60.00
800x600 75.00 60.32
720x576 50.00
720x576i 50.00
720x480 60.00 59.94
720x480i 60.00 59.94
640x480 75.00 60.00 59.94
720x400 70.08
DVI-0 connected 1280x1024+3440+0 (normal left inverted right x axis y axis) 376mm x 301mm
1280x1024 60.02*+ 75.02
1152x864 75.00
1024x768 75.08 70.07 60.00
832x624 74.55
800x600 72.19 75.00 60.32 56.25
640x480 75.00 72.81 66.67 60.00 59.94
720x400 70.08
VGA-1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)


Then, I can run


$ xrandr --output HDMI-3 --mode 3440x1440 -r 50


And the large display comes to life.

Now, what is the best way to tell the login screen (Wayland? GDM?) as well as Gnome (X?) that it needs to ignore the 60Hz option?

I tried adding the HDMI-3 xrandr command to /etc/gdm/init/Default and ~/.xinitrc. I tried setting the refresh rate to 50 in .config/monitors.xml. Nothing works. The system boots relatively fast, so even if I'd be happy even if I have to login "blind" before the xrandr setting executes.

I am using the radeon free software driver. The proprietary has never been installed.

Any suggestions would be appreciated. Right now, it looks like I'll have to buy a new video card with Display Port in order to support 60Hz.

Thanks!

-frap

PabloTwo
19th December 2015, 04:05 PM
I'm not sure if this is the best way, but you could try placing that xrandr command in your /etc/rc.d/rc.local file. You will have to create that file if you already haven't. It must be in standard bash script format, that is, the first line must be "#!/bin/bash" and the file made executable. Commands in the rc.local file should be executed prior to getting to the login screen.

The xrandr man page on F23 tells me the "-r" option is valid for version 1.1 and one should be using the "--rate" option on newer versions, but that seems to work for you non the less.

frap1
21st December 2015, 04:56 AM
Thanks for the reply. I've tried adding the xrandr command to rc.local and to .xsession. It's really frustrating because I know the answer is simple, but it's been so long that since I've had to adjust the video settings in Fedora that I've lost touch with the current best practices.

It looks like Fedora 23 is using Wayland and I'm not sure how this changes anything. I can't find any documentation on the right way to do this. I really need to be able to adjust settings for gdm as well so I can login, but changing the files in /etc/gdm/ does not seem to help.

I'll post back to this thread if I eventually figure it out.

frap1
21st December 2015, 06:18 AM
Ok, I had some success using the Gnome 3.x autostart folder:



$ cd .config/autostart

Once there, create a file named xrandr.desktop that contains:


[Desktop Entry]
Type=Application
Exec=/usr/bin/xrandr --output HDMI-3 --mode 3440x1440 -r 50
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=xrandr50hz
Name=xrandr50hz
Comment[en_US]=set u3415w display to 50hz
Comment=set u3415w display to 50hz


This runs the xrandr command when I login. Can anyone explain to me why adding the xrandr command to my .xsession and .xinitrc did not work? Maybe due to Wayland changes? I couldn't find any document describing what exactly is deprecated with the recent fedora changes.

Note that I still can't get GDM to execute the command, so I don't get a login screen and have to login "blind." I will update this thread once I get GDM working. I have tried disabling wayland in /etc/gdm/custom.conf, but that did not help.

Thanks again for all the help.

PabloTwo
21st December 2015, 04:00 PM
I don't use Gnome, and haven't since fc6. It's my understanding that the newest Gnome3 Desktop by default uses Wayland for the login screen, then switches to X for the desktop session. Xrandr works under X, so logically would not have any effect on Wayland (Wayland does not run under X, it replaces X).

I have seen several threads here on how to disable Wayland and thus make the login screen run under X, but you'll have to did that info up yourself. Perhaps doing so will resolve your issue.

frap1
22nd December 2015, 07:01 AM
I finally got things working on F23. I'm not excited about my approach, but it works.



Disable Wayland for GDM by opening /etc/gdm/custom.conf and uncommenting the "WaylandEnable=false" line.
Create a new file in /etc/X11/xorg.conf.d/ called "01-dellmonitor.conf" that contains:
Section "Monitor"
Identifier "dell"
Modeline "3440x1440@50" 265.25 3440 3520 3552 3600 1440 1461 1471 1474 +hsync -vsync
Option "monitor-HDMI-3" "dell"
Option "PreferredMode" "3440x1440@50"
EndSection


Section "Device"
Identifier "XFX R7250"
Driver "radeon"
Option "Monitor-HDMI-3" "dell"
EndSection

Section "Screen"
Identifier "MainScreen"
Device "XFX R7250"
EndSection

Section "ServerLayout"
Identifier "MainLayout"
Screen "MainScreen"
EndSection
Reboot and you will now see GDM in full 3440x1440@50Hz!


Notes:


I found it useful to also enable debugging in custom.conf and view the gdm log by running
$ journalctl -b |grep gdm
My xorg.conf.d directory already had a 00-keyboard.conf file that I left alone.
You will need to modify 01-dellmonitor.conf to match your system. If you have never edited a X11 config file, here are some tips:

The Identifier options are arbitrary text you can define to be whatever you choose. You must use the exact Identifier when you refer to that section.
The driver option is the X11 driver used by your video card. If you examine your journalctl -b output you should be able to figure out the driver being used for your video card.
In the Device section, "Monitor-HDMI-3" was chosen because HDMI-3 is the identifier used by xrandr for the HDMI output of my video card. You may need to change this.
I obtained the Modeline option values by viewing the GDM debug messages which printed out the various modelines suggested by the driver. These modelines correspond to the resolution and refresh rate options shown by xrandr. The first part of the Modeline option "3440x1440@50" is an arbitrary text identifier.




This was a huge disappointment and should have been much easier. I could not find any practical documentation for Wayland+GDM.

Even after I disabled Wayland, I figured I could add the xrandr command to /etc/gdm/Init/Default, but that did not work. The GDM reference manual seemed to suggest that approach: https://help.gnome.org/admin/gdm/stable/configuration.html.en


Helpful references that helped me solve this issue:


fedoraforum.org
https://wiki.ubuntu.com/X/Config/Resolution
http://zeroset.mnim.org/2013/01/07/dual-head-monitor-setup-on-ubuntu-linux-with-xorg-and-radeon/
https://bugzilla.redhat.com/show_bug.cgi?id=851769

PabloTwo
22nd December 2015, 05:34 PM
Thanks for posting the comprehensive and informative solution to your problem above. I'm sure it will help others searching for a solution to the same issue.