Welcome, this is an Innovations Tech Tip. I recently did some work with an ELO Touchsystems 1515L 15″ LCD Desktop Touchmonitor. I was pleased with the touchmonitor’s hardware and performance, but in order to make it work properly in Linux I had to find a suitable calibration program. Out of the box on several distributions this touchscreen exhibits Y-axis inversion, where touching the top of the screen moves the cursor to the bottom and vice versa. xinput-calibrator is a freedesktop.org project that worked well for calibration, fixing the Y-axis inversion issue, and as a bonus it works for any standard Xorg touchscreen driver.
For this post I tested on Bodhi Linux 1.2.0 (based on Ubuntu 10.04 LTS), Fedora 15, and Ubuntu 11.04.
xinput-calibrator, as I mentioned, was the screen calibration utility.
Click here to go to
xinput-calibrator‘s website and choose your package. Be aware that if you’re using the ARM version of Bodhi (in alpha at the time of this writing) it’s based on Debian, so you’ll want to grab the Debian testing package. You can also add a PPA if you’re running Ubuntu, but I had trouble getting that to work during my tests. Last but not least, you can grab the source and compile it yourself by downloading the tarball or using git.
Before you actually install
xinput-calibrator on a freshly installed Debian based system (including Ubuntu and Bodhi), make sure to update your package management system or you’ll get failed dependencies. This is because the package management system doesn’t know what packages are available in the repositories yet. This isn’t a problem with Fedora since the package management index is updated every time you use YUM. Once you’ve ensured that the system is or will be updated, you’ll be ready to install
xinput-calibrator via the package that you downloaded or the PPA.
xinput-calibrator is installed, it should show up in your application menu(s). Look for an item labeled “Calibrate Touchscreen”. If you don’t see it anywhere, you can launch it from the terminal with the
xinput_calibrator (note the underscore) command.
Figure 1 – xinput_calibrator screenshot
The use of
xinput-calibrator is very simple. You’re presented with a full-screen application that asks you to touch a series of 4 points. The instructions say that you can use a stylus to increase precision, but I find that using my finger works well for the ELO touchscreen. One of the nice features of
xinput-calibrator is that it’s smart enough to know when it encounters an inverted axis. After I run through the calibration the Y-axis inversion problem is fixed, so I’m ready to start using the touchscreen.
You’ll probably want your calibration to persist across reboots, so you’ll need to do a little more work now to make the settings permanent. First you’ll need to run the
xinput_calibrator command from the terminal and then perform the calibration.
$ xinput_calibrator Calibrating EVDEV driver for "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface" id=9 current calibration values (from XInput): min_x=527, max_x=3579 and min_y=3478, max_y=603 Doing dynamic recalibration: Setting new calibration data: 527, 3577, 3465, 600 --> Making the calibration permanent <-- copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' Section "InputClass" Identifier "calibration" MatchProduct "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface" Option "Calibration" "527 3577 3465 600" EndSection
Toward the bottom of the output you can see instructions for "Making the calibration permanent". This section will vary depending what
xinput_calibrator detects about your system. In my case under Ubuntu the output was an xorg.conf.d snippet, which I then copied into the xorg.conf.d directory on my distribution. Be aware that even though the output says that
xorg.conf.d should be located in
/etc/X11, it might actually be located somewhere else like
/usr/share/X11 on your distribution. Once you've found the
xorg.conf.d directory you can use your favorite text editor (with root privileges) to create the
99-calibration.conf file inside of it. Now when you reboot, you should see that your calibration has stayed in effect.
If you have a reason to avoid using an
xorg.conf.d file to store your calibrations, you can run
xinput_calibrator with the
--output-type xinput option/argument combo.
$ xinput_calibrator --output-type xinput Calibrating EVDEV driver for "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface" id=9 current calibration values (from XInput): min_x=184, max_x=3932 and min_y=184, max_y=3932 Doing dynamic recalibration: Setting new calibration data: 524, 3581, 3482, 591 --> Making the calibration permanent <-- Install the 'xinput' tool and copy the command(s) below in a script that starts with your X session xinput set-int-prop "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface" "Evdev Axis Calibration" 32 524 3581 3482 591
At the bottom of this output you can see that there are instructions for using xinput to make your calibration persistent. If it's not already present, you'll need to install
xinput and then copy the command line in
xinput_calibrator's instructions into a script that starts with your X session. You can usually also add it to your desktop manager's startup programs via something like
gnome-session-properties if you would prefer.
Another option that might be of use to you is
--verbose) option displays extra output so that you can see more of what's going on behind the scenes. If you have any trouble getting your calibration to work, this would be a good place to start.
Your output will probably vary from what I have here depending on what type of hardware you have and which distribution you run. For instance, on Fedora 15 I get the
xinput instructions by default instead of an
xorg.conf.d snippet. Make sure that you run the above commands yourself, and don't copy the output from my listings.
If you have a desire or need to redo the calibration periodically, you might want to consider creating a wrapper script to automate the process of making the calibration permanent. Such a script might use
sed to strip out the relevant code and then a simple
echo statement to dump it into the correct
xorg.conf.d file or startup script.
That concludes this Tech Tip. Have a look at innovationsts.com for other tips, projects, how-tos, and service offerings available from Innovations Technology Solutions. Thanks, and stay tuned for more from Innovations.