Musings from kb8ojh.net

Sat, 13 Dec 2014

X server tricks: I learn something new every day

by on :

I've been using X11 for a couple of decades now, through several brandings and incarnations of the X server, but it's a sufficiently huge and complicated stack that there's always room to learn something new. Today I had an eye-straining contrast problem with an Intel i915 graphics chipset, and learned a bit about the xrandr tool that I hadn't known before — it can control color profiles and configuration.

TL;DR: The fix is here.

I just installed an IOGEAR HDMI KVM Switch on my primary workstation, because I have a whole pile of PCs and PC-like devices sitting here that I almost never need a console for, but when I do I don't want to have to dig all around under the desk to get them hooked up. This necessitated moving my primary workstation's video output from DVI to HDMI; since it had a built-in HDMI port, I didn't bother to buy a DVI-to-HDMI adapter for it, I just plugged it in and went with it. When I first got everything set up, I didn't notice any particular effects, and I used it for a while. After some time, I started to notice that the display was too bright and washed out, and that it was giving me eye fatigue. It looked like the backlight was set too high.

Uh oh. When you spend a lot of time in front of a computer, decent display quality is an absolute must. This situation wasn't going to be acceptable. The first thing I did is hook up the old DVI-D connection to make sure that it really was better — and it was. The second thing to do was ...

I really had no idea. I had some vague idea that xrandr might be able to let me set the backlight, but I'd never used it for that, and the manual page said that the xrander --backlight option was a software-only change, and wouldn't affect the actual brightness of the monitor. It suggested xbacklight, which it turns out does not work on this chipset/monitor/something.

So I did what any computer user worth his or her salt would do — I asked Google. Which had no idea. (In point of fact, I asked DuckDuckGo first, and when it didn't know, then I asked Google, which didn't know either.) This caused me to start to set about determining whether the problem was the HDMI output itself, or something to do with the KVM. A quick comparison of the four devices currently hooked to the KVM input showed that:

  • My development workstation's DVI output was much better than its HDMI output.
  • The Linux box on the second port didn't seem as washed out at the console, but it didn't have working X11. The backlight seemed tamer than port 1 or port 4 (coming up).
  • The Mac Mini on the third port seemed ... great. It was hard to tell, because I had a difficult time finding a window with high contrast and a dark background that wasn't faded, semi-transparent, dancing, or otherwise behaving stupidly.
  • The Raspberry Pi on the fourth port looked terrible. This shouldn't surprise anybody; they're really designed to hook to a TV, for crying out loud.

Being a somewhat inconclusive test, I decided that installing an X server and my basic desktop config (I use FVWM as my window manager and rxvt-unicode as my terminal, so blasting a minimal configuration to a new machine is copying one directory and one file) on the second Linux box was going to be a good comparison, since its console looked better.

To make an already long story short(er), it turns out that the second machine's Intel Haswell-based graphics chipset wasn't supported in Debian Wheezy. This led to more Googling, which turned up this gem (which is unrelated to the Wheezy-Haswell problem, but solved my original problem):

xrandr --output HDMI2 --set "Broadcast RGB" "Full"

This magical command fixed the problem. The HDMI output looked just like the DVI output! The i915 appears to support three values for the Broadcast RGB parameter: "Automatic", "Full", and "Limited 16:2". Automatic for the DVI output defaults to Full, while automatic for the HDMI output defaults to Limited 16:2. As best I understand it, this is because many TV panels don't actually support a full color space, so the graphics card can squash the colors into a color space supported by those limited panels. On the HDMI output it defaults to doing so, so that if you hook a TV up to the HDMI port the colors will be usable. What had appeared to be a backlight problem was really light leaking through not-quite-black pixels.

I learn something new every day.

tags: debian, fatigue, x11
path: / | permalink | Comments

[ | | ]