Logo

HP t630: Display 

Configuring X

Background

Today is very much a plug-and-play world but occasionally it goes wrong. The occasion met here by Sander was when using Linux Mint on an HP t630 thin client with an oldish monitor. The display port on the t630 was connected to the VGA input of the monitor via various adapters. Thanks to either the adapters used or the age of the monitor the 'Display Identification Data' from the monitor did not make it to the t630 Display Port interface in an intelligible form - if at all. The net result of this was that Linux Mint had no idea what monitor was connected and so defaulted to a low resolution 640 x 480 display. Such a low resolution is close to unusable with modern GUIs.

Handing over to Sander:

It did take me a little while to work out that the problem lay in the lack of communication between the t630 and the monitor and was not a fundamental driver issue.

This is not something that is exclusive to Linux Mint and the t630. It could happen with other versions of Linux and other hardware.

The Solution

So the solution to this problem is to hand configure the graphics driver to match the monitor. This is what is described below.

To do this we need four things:

  1. Knowledge of the ideal resolution to suit the monitor.
  2. Knowledge of the port to which the monitor is connected.
  3. The utility cvt - a utility for calculating VESA Coordinated Video Timing modes.
  4. The utility xrandr (short for "X Resize, Rotate and Reflect Extension").

You also need some basic familiarity of working at a command line.

In this example my monitor supports a resolution of 1368 x 768 so we start by opening a terminal and then using cvt to generate the various timing parameters we need to configure X to match the monitor.

~$ cvt 1368 768
# 1368x768 59.88Hz (CVT) hsync: 47.79 kHz; pclk 85.25 MHz
modeline "1368x768_60.00"   85.25 1368 1440 1576 1784  768 771 781 798 -hsync +vsync
~$

Next run xrandr to find the video port name:

~$ xrandr
Screen 0: minimum 320 x 200, current 1440 x 900, maximum 16384 x 16384
DisplayPort-0 connected 640x480+0+0 (normal left inverted right x axis y axis) 408mm x 255mm
DisplayPort-1 disconnected primary (normal left inverted right x axis y axis)
   640x480       75.00    72.81    66.67    59.94  
~$

[David: Note the above is from my re-creation of the event but not strictly accurate as my monitor was recognised by Linux Mint - but you get the idea...]

From the above we can see what we need is DisplayPort-0

Now we can put it all together and create a script that can be run to to configure X to match our monitor. Lets call the script resolution.sh.

To save some typing we can create the file and auto fill it with some of the content we need:

~$ cvt 1368 768 >resolution.sh
~$

This gets all the mode and timing parameters in. Now open the file in your preferred editor and do the following:

Replace the top line with

[ "$XDG_SESSION_TYPE" = x11 ] || exit 0

This is just a simple check that we are running the expected GUI.

Next edit the start of the second line so that it reads:

xrandr --newmode "1368x768_60.00"   85.25  1368 1440 1576 1784  768 771 781 798 -hsync +vsync

This adds the mode we need for our monitor.

Finally add two lines to tell the driver to associate the mode with our port and to use it.

xrandr --addmode DisplayPort-0 1368x768_60.00
xrandr --output DisplayPort-0 --mode 1368x768_60.00

So the file should now look like:

[ "$XDG_SESSION_TYPE" = x11 ] || exit 0
xrandr --newmode "1368x768_60.00"   85.25  1368 1440 1576 1784  768 771 781 798 -hsync +vsync
xrandr --addmode DisplayPort-0 1368x768_60.00
xrandr --output DisplayPort-0 --mode 1368x768_60.00

Save the file and mark it as executable.

Finally add it to the list of startup applications which run after login. You need to browse to the location the script is saved, give it a name and description and possibly a delay time. I did not use any delay but if you find the resolution did not set properly you may need to. 10 or 20 second should suffice in that case.

Reminder

If you are following this guide you will need to adjust things to suit your environment, in particular the screen resolution and the video port you are using.

 


Any comments? email me. Added October 2022