[tslib] Setting ts_calibrate results EVIOCSABS

Baruch Siach baruch at tkos.co.il
Tue Jun 20 07:08:21 PDT 2017

Hi Martin,

On Sun, Jun 18, 2017 at 04:45:15PM +0200, Martin Kepplinger wrote:
> On 2017-06-18 15:17, Baruch Siach wrote:
> > Is it possible to set the ts_calibrate results into the kernel input layer 
> > using the EVIOCSABS ioctl()? That would make the calibration instantly 
> > available to all touchscreen input device users, independent from the 
> > tslib library.
> What version of tslib do you use? You should use a recent version from
> Debian sid, for example.

I'm building the latest version statically using Buildroot.

> Do you mean the ts_read_mt() tslib samples data? You might mainly use
> the linear plugin with ts_calibrate, but it's actually a special case.
> > 
> > The problem I am facing is that I'm on X11, stuck with an old kernel (pre 
> > of_touchscreen.c), and a Debian installation that does not package 
> > xf86-input-tslib. The xf86-input-evdev Calibration option doesn't work at all 
> > for some reason.
> Have you read the README.md documentation, specifically
> https://github.com/kergoth/tslib#use-the-filtered-result-in-your-system-ts_uinput-method
> ?

Thanks for the pointer. I was not aware of that trick. I still think that 
configuring the original input device is easier, since it doesn't require 
special configuration on the Xorg side.

> But xf86-input-tslib can also be installed seperately. It's indeed not
> yet packaged for Debian, but available here:
> https://github.com/merge/xf86-input-tslib
> > Looking around I could not find any EVIOCSABS user. The EVIOCSABS ioctl() 
> > as been in the kernel since pre-git times.
> > 
> > Am I missing something obvious here?
> Actually I don't know how common or useful it would be to edit the real
> device' values with EVIOCSABS. I always went the uinput way, creating a
> new device, until now.
> I'll think about it. Feel free to open an issue if you have a concrete idea.

I found eventually that both systemd/udev and libevdev do EVIOCSABS. 
systemd/udev could not help me because the version I have installed on target 
is 215, while this feature was introduced only in 220 (commit 51c0c2869845a0). 
So I settled for running the libevdev relatively new libevdev-tweak-device 
utility from a custom udev rule. This solution works nicely.

> > FWIW, the touchscreen driver is edt-ft5x06.c, that works nicely except 
> > from the calibration. Both X and Y are reported x2 at the X11 level.
> I have used this driver too. But it shouldn't matter at all.

Thanks for your help,

     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

More information about the tslib mailing list