xorg Archive

Fixing a Monitor with an Identity Crisis

After today, I’m about ready for an old-man rant about the evils of modern technology. Instead I’ll write up the problem and solution I had today in case others come looking for it.

I happened to brush against my computer today and the static caused it to freeze up. Okay, that’s annoying, but not the end of the world. Reboot and start things back up. But monitor #2 came back up in a weird resolution. It’s normally 1680x1050, and it was 1280x1024 for some reason. Not just smaller, but stretched out horizontally.

Investigation found that the monitor, which is a Westinghouse LCM-22w3, started telling the video card it’s actually an Acer AL1714. It’s suddenly a trans-monitor. Next thing I know it’ll demand I call it Catelyn.

Back in the old days, you had to configure the X Window display for your monitor by hand, filling in modelines with horizontal and vertical sync values from the specs, which could be kind of a pain. Nowadays, monitors have something called EDID, which is a block of data held on a chip which is sent to the video card to tell it what the monitor is capable of. That’s very handy if it works. But suddenly mine’s EDID block says it’s an Acer with completely different specs. Other people online reported the same thing, so it must not be uncommon.

I figured there would be a database somewhere of correct EDID blocks for different monitors, the way we used to have databases of modelines. Couldn’t find one for it. So I couldn’t just override the monitor’s EDID block with a file. I tried tinkering with the Xorg config in various ways, none of which worked. Sometimes one monitor would work, sometimes the other, sometimes they’d both work and both have wrong resolutions.

One suggestion said to use xrandr to force the right mode, but that gave me a BadMatch error. It turned out that because the NVidia card was getting the bad EDID block, it thought the monitor couldn’t handle the mode I was trying to force. So the first part of the solution ended up being to add this line to the “Monitor” section for the Westinghouse in my xorg.conf (actually my /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf, but the location of yours may vary):

Option   "UseEDID"  "FALSE"

On starting X, both monitors were active (progress!) but with the wrong resolution, since the video card couldn’t use EDID to ask what it should be. So then I had to run these commands:

xrandr --newmode "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
xrandr --addmode DVI-D-0 1680x1050_60.00
xrandr --output VGA-0 --mode 1280x1024
xrandr --output DVI-D-0 --mode 1680x1050_60.00

My setup has a 1280x1024 Samsung connected via VGA on the left, and the 1680x1050 Westinghouse connected via DVI on the right. So the first line there adds the new mode the Westinghouse needs, using values I got from running cvt 1680 1050. The second line adds that new mode to the right-hand monitor, and the third and fourth lines set the correct resolution for each monitor. All is well now.

Now I’ll just add those four xrandr lines to my ~/.xinitrc, so they run each time I start up X with startx. Depending on how X starts on your system, you may need to put them somewhere else.