Ultrawide monitor on Linux

After some fiddling around, I managed to get 2560x1080 output on my Linux laptop hooked to a LG 29WK600 21:9 UltraWide Monitor.

Motivation

I carefully unboxed my new LG 29WK600, connected the HDMI cable to the monitor but discovered that the output was limited to 1920x1080. Black bars padded left and right of the screen with my display being no more than a regular 23” monitor. This was on my Dell Studio XPS 1645 with Mobility Radeon 5730 which is old but capable of outputting more pixels than that.

Diagnosis and solution

HDMI cable was not faulty

The cable was not faulty because I managed to get the ultrawide to display 2560x1080 on another laptop with Intel HD Graphics on Windows. According to Wikipedia, HDMI version 2.0 is required to support 21:9 aspect ratio.

Gave DisplayPort a try

Considering my laptop has DisplayPort output, I decided to give it a try. 21:9 ratio appeared! I was ecstatic but that feeling faded seconds later when the display showed “Out of Range”. The screen seems to output just fine; it was sharp and flicker free. I thought perhaps it was just a frequency issue so I tried 75, 60 and then 50. At 75, display appeared but was showing “Out of Range”. At 60 and 50, the display went to sleep.

Contacted LG

I contacted LG Malaysia support. They came back telling me to ensure FreeSync option was disabled but that was the default which I did not toggle on.

Searched for a solution

I stumbled upon a post on Ask Ubuntu, How to set a custom resolution. Now that I know the commands required to run, I needed to identify the proper frequency.

Determining the correct frequency

According to LG’s website, the supported H-Frequency range is between 30 and 90KHz and V-Frequency is between 56 and 75Hz. The number of interest to us is the V-Frequency. I tried several numbers in between and including 56 and 75 until I stumbled upon a frequency that works, 68. Here is how I found out.

Firstly, use the cvt command to generate a Modeline:

cvt 2560 1080 68

Then the following output will appear:

# 2560x1080 67.91 Hz (CVT) hsync: 76.46 kHz; pclk: 264.25 MHz
Modeline "2560x1080_68.00"  264.25  2560 2736 3008 3456  1080 1083 1093 1126 -hsync +vsync

Next, we need to feed this information into xrandr:

xrandr --newmode "2560x1080_68.00"  264.25  2560 2736 3008 3456  1080 1083 1093 1126 -hsync +vsync

Then make this option available to the list of selectable options for DisplayPort:

xrandr --addmode DisplayPort-0 2560x1080_68.00

To see a list of selectable options, just type xrandr without parameters:

Screen 0: minimum 320 x 200, current 2560 x 1080, maximum 8192 x 8192
LVDS connected (normal left inverted right x axis y axis)
   1920x1080     59.93 +
   1680x1050     60.00  
   1400x1050     60.00  
   1280x1024     59.95  
   1440x900      59.99  
   1280x960      59.99  
   1280x854      59.95  
   1280x800      59.96  
   1280x720      59.97  
   1152x768      59.95  
   1024x768      59.95  
   800x600       59.96  
   848x480       59.94  
   720x480       59.94  
   640x480       59.94  
DisplayPort-0 connected primary 2560x1080+0+0 (normal left inverted right x axis y axis) 798mm x 334mm
   2560x1080     59.98 +  74.99    50.00  
   1920x1080     74.98    60.00    50.00    59.94  
   1680x1050     59.95  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1152x864      75.00    59.97  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    60.00  
   832x624       74.55  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    60.00    59.94  
   2560x1080_68.00  67.91* 
HDMI-0 disconnected (normal left inverted right x axis y axis)
VGA-0 disconnected (normal left inverted right x axis y axis)

The LVDS is my laptop’s display which I deliberately turned off and the DisplayPort-0 is my ultrawide. Noticed that 2560x1080_68.00 option is now available at the tail end?

Before we select the new option that we just added, it is good to execute the command that sets the current resolution into the terminal. This should be the resolution that your display will show up albeit with “Out of Range” message. Do note that from the xrandr output above, the preferred rate for my display’s 2560x1080 resolution is 59.98Hz. At that rate, nothing will show up. Neither will 50. 74.99 will get the screen to appear but as mentioned, with the error message. The command to select that output rate is:

xrandr --output DisplayPort-0 --mode 2560x1080 --rate 74.99

The reason for executing that is to allow reverting back to that rate in case the rate that we are trying fails. In case you do not already know, pressing the up arrow key will bring back the last executed command and pressing enter will execute it. This is simple enough to be performed without a working display.

To try the new rate, in my case 68:

xrandr --output DisplayPort-0 --mode 2560x1080_68.00

If the display fails to show up, press the ‘up arrow key’ twice then enter to revert back to the previous state. Twice because the once would repeat the same command and another ‘up arrow key’ press to repeat the command before that. Hope I explained this well enough. In case you struggle to get the display to reappear, unplugging the DisplayPort should reactivate the laptop’s LCD. Otherwise, reboot the machine. The xrandr commands entered above do not persist past reboot.

Oddity

Strangely, I could not get 1920x1080 resolution to work on my ultrawide. Nevertheless, if 2560x1080 works, there is no reason to bother with 1920.

Persisting and restoring the correct settings on startup

Once the correct rate has been identified, the next step is to make this customisation permanent.

Initially, I attempted to setup the above commands to run on startup via profile. The problem I faced was only the laptop screen was active up to and including the login screen. This makes sense given that my ~/.profile is located in my home directory for which I have encryption enabled. The directory’s contents will only be made available after successful login. I tried to put the commands into /etc/profile.d/ but the result was the same.

Then I came across How can I make xrandr customization permanent?. I created a config file at /usr/share/X11/xorg.conf.d/10-ultrawide.conf. Please note that I have only tested this on Linux Mint 19.1. The folder location may vary depending on your distribution. The file’s content:

Section "Monitor"
  Identifier "DisplayPort-0"
  Modeline "2560x1080_68.00"  264.25  2560 2736 3008 3456  1080 1083 1093 1126 -hsync +vsync
EndSection

Section "Screen"
  Identifier "Screen0"
  Device "Card0"
  Monitor "DisplayPort-0"
  SubSection "Display"
    Modes "2560x1080_68.00"
  EndSubSection
EndSection

Section "Device"
  Identifier "Card0"
  Driver "radeon"
EndSection

Do remember to substitute Modeline and Modes as per your configuration. Note that my Driver has been set to “radeon”. To identify your display driver, use the following command:

lshw -class display | grep "driver"

Closing words

I hope that this tutorial helped you in extending the lifespan of your old computer. If this had not succeeded for me, I would have purchased a new machine.

In case you were wondering how I make use of the ultrawide, here is a screenshot:

Cinnamon UltraWide

Dragging the application window to the left most will dock the window to utilise the left half of the screen. Similarly, dragging to the right most will dock on the other half.