Screen calibration on Linux with a Spyder3

"When I was a teenager, Mom said I'd go blind if I didn't quit doing *that*. Maybe she was right — since the invention of internet porn, computer monitors keep getting bigger and bigger. !"    — Bill Ervin.
On this page:

Using a profile

If you have a Buy at Amazon.comSpyder3 from DataColor and you have generated a profile in Windows on a dual-boot machine or a past Windows install (you kept a backup, right?), you can use that profile directly by copying it to your Linux partition and issuing: $ xcalib profile.icc. As simple as that.

But if you don't have Windows anymore, it's more problematic, for instance you can't use the DataColor software from a VirtualBox install of Windows. It simply generates bogus icc profiles, probably because it doesn't have low-level access to the graphic driver.

Remember to update your profile if you change you graphic card, your graphic driver or your monitor. Or simply when you monitor ages.




[LinuxButterfly.jpg]

Creating a profile

Software

I drew on several pages to get this to work, in particular this one. Credit where credit is due.

First, install xcalib and argyll: $ sudo aptitude install xcalib argyll

Note: this doesn't seem to be necessary anymore, so just skip this step. Then download the file spyd2PLD.bin and copy it to /usr/bin/. You must respect the case. This file is a part of the Spyder2 driver and works with the Spyder3, including the background light measurement (not that I care about that all that much, a gimmick IMO).

Connection

Then connect your Spyder and check it with
$ lsusb
Bus 005 Device 087: ID 085c:0300 ColorVision, Inc.

If you don't see the above line, then you may have the MTP problem in Ubuntu 11.10. Check dmesg a couple times if you see repeating errors like:
$ dmesg
[164074.156141] usb 5-3: USB disconnect, device number 75
[164074.420049] usb 5-3: new full speed USB device number 76 using ohci_hcd
[164074.595390] usb 5-3: usbfs: USBDEVFS_CONTROL failed cmd mtp-probe rqt 128 rq 6 len 1024 ret -62
...

So if you have the above problem on Ubuntu 11.10, remove part of the MTP library: $ sudo apt-get remove libmtp-runtime and connect again and try lsusb again:
$ lsusb
Bus 005 Device 087: ID 085c:0300 ColorVision, Inc.

Use the bus and device number in the following command: $ sudo chmod 777 /dev/bus/usb/005/087 which you'll need to do again each time you connect the Spyder. Note: a better solution is to have your username in the proper group in /etc/group, such as plugdev.

Measure

Now let's start measuring patches: $ dispcal -v -q l -y l samsung
Setting up the instrument
dispcal: Error - Configuring USB port 'usb:/bus5/dev86/ (Datacolor Spyder3)' to 1 failed with -6 (Resource busy)

Ooops, seems like something is using the driver already: $ sudo lsof | grep 005/086
VirtualBo 10259 dargaud 55u CHR 189,597 0t0 709892 /dev/vboxusb/005/086

Indeed I'd been trying to use the Spyder in VirtualBox, so I just had to close it or disable its use. Let's get started now:

$ dispcal -v -q l -y l samsung
Setting up the instrument
Instrument Type:   Datacolor Spyder3
Serial Number:     01012587
Hardware version:  0x0407
Place instrument on test window.
Hit Esc or Q to give up, any other key to continue:
Display type is LCD
Target white = native white point
Target white brightness = native brightness
Target black brightness = native brightness
Target advertised gamma = 2.400000

Display adjustment menu:
Press 1 .. 7
1) Black level (CRT: Offset/Brightness)
2) White point (Color temperature, R,G,B, Gain/Contrast)
3) White level (CRT: Gain/Contrast, LCD: Brightness/Backlight)
4) Black point (R,G,B, Offset/Brightness)
5) Check all
6) Measure and set ambient for viewing condition adjustment
7) Continue on to calibration
8) Exit

Press 1 and adjust your monitor brightness to get the required number, if you can match it. Then press 3 and adjust your monitor brightness to get the required number, if you can match it. Finally press 7 for a measurement sequence. The rest of the commands are the following. Go to the page above for a more detailed explanation, or call the corresponding command with the --help option:

$ targen -v -d3 -f250 samsung
...
$ dispread -v -y l -k samsung.cal samsung
...
$ colprof -v -A "Samsung" -M "SyncMaster BX2440" -D "2012-04-14" -q m -a s samsung
...

And finally apply the profile to the screen, which you need to do at every reboot or login: $ xcalib samsung.icc



Multiple monitors

Normally you should be able to profile separate monitors with the -d option of dispcal, but it didn't work for me: the calibration patch would always open on the same monitor. There seems to be some incompatibility with the Nvidia driver. So here's how I did it.

First calibrate the monitor which works with dispcal, targen, dispread and colprof to generate a profile for the first monitor.

Then use the nVidia utility (nvidia-settings) to remove that 1st monitor. Find it and disable it in the options, then save your /etc/X11/xorg.conf, you may have to launch the nvidia utility as root. Make sure you keep a copy of that file first:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.good

You probably have to reboot at this point, you should then only have that monitor. Generate the profile with dispcal, targen, dispread and colprof as stated above, using a different name. Then reinstate your original xorg.conf file and reboot: sudo cp /etc/X11/xorg.conf.good /etc/X11/xorg.conf && sudo reboot

Now you are free to use either profile with xcalib. I don't think you can apply both at the same time to their specific monitors.



Printer profiles

For that, I simply run the DataColor software in Windows under VirtualBox and it generates the profiles fine. You can use the profiles in Linux, provided you can find an application that accepts printer profiles. Hahaha. So for printing images, I still use Windows as of 2012.