Coder Social home page Coder Social logo

xf86-input-tslib's Introduction

xf86-input-tslib

X.org tslib input driver

how to use

xf86-input-tslib assumes you have only one touchscreen device available, see 80-tslib.conf. If there are multiple in your system, please specify one config section for each. xf86-input-tslib aims to make tslib easy to use and doesn't offer special configuration options.

  • have tslib (libts) installed.
  • download and extract.
  • cd xf86-input-tslib into the extracted directory
  • ./configure --prefix=/usr
  • make
  • sudo make install

Done. Configure your tslib's ts.conf (which is probably why you installed xf86-input-tslib in the first place :) ) and reboot.

To uninstall, again go inside the extracted directory, and do

sudo make uninstall

multitouch

if you use tslib 1.10 or higher (libts.so.0.7.0 or higher), you have multitouch.

calibrate (if not calibrated) before X starts the display

(untested :) If you use the linear module in ts.conf you want to calibrate your screen, using ts_calibrate. To do this once in case not already done, you'd add something like the following snippet to your display manager's init script

  • /etc/gdm3/Init/Default for Gnome3's gdm

  • /etc/X11/xdm/Xsetup for X's display manager

  • /etc/kde4/kdm/Xsetup for KDE's kdm and so on:

      TSCALIB_BIN=/usr/bin/ts_calibrate
    
      # calibrate touchscreen, if no calibfile exists
      if ! [ -f "${TSLIB_CALIBFILE}" ] ; then
      	if ! ${TSCALIB_BIN} ; then
      		echo "calibration failed!"
      	else
      		echo "calibration done."
      	fi
      fi
    

To trigger re-calibration, simply delete the TSLIB_CALIBFILE file and reboot.

contact

historical notes

In cooperation with Pengutronix, this Github repository builds upon the former source distribution. (Thanks Pengutronix, for hosting and all your awesome development work!) Development and main source distribution is now done on Github. In case Pengutronix continues mirroring future tarball releases, and thus provides backwards compatibility for downstream users: Thanks for your help :)

xf86-input-tslib's People

Contributors

merge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xf86-input-tslib's Issues

Causing X to segfault

Whenever I install this from the AUR on my Raspberry Pi (armv7h, not AArch64) it causes X to segfault. As soon as I uninstall it X goes back to working normally. Here's the log from X: xorg.log

Compatibility issue with X and ar1021_i2c

I have been working with Buildroot, developing for beaglebone black. I have a 4Dsystems gen4 4.3" resistive touch screen cape attached.

I started with this tutorial: http://www.jumpnowtek.com/beaglebone/BeagleBone-Systems-with-Buildroot.html, however I had to modify my device tree to support the gen4 touch screen.
I have enabled X.org and am using tslib to filter the touch events into the uinput device which is setup as an input device in my 80-tslib.conf file, here is my modified file:

#
# Catch-all tslib loader for udev-based systems
#
# We match on all touchscreen devices. If you have multiple, please specify.

Section "InputClass"
        Identifier "tslib touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "tslib"
EndSection

Section "InputDevice"
        Identifier "tslib"
        Driver "tslib"
        Option "ScreenNumber"   "0"
        Option "Width"      "480"
        Option "Height"     "272"
        Option "Rotate"     "NONE"
        Option "TslibDevice"    "/dev/uinput"
        Option "CorePointer"
EndSection

The Option "Width" and "Height" parameter in 80-tslib.conf don't seem to have any effect.

I have finally gotten my device calibrated and working correctly, but I had to make these modifications to the tslib.c file:

--- a/src/tslib.c       (Original)
+++ b/src/tslib.c       (Bug Fix)
@@ -284,19 +284,19 @@
                        InitValuatorAxisStruct(device, 0,
                                               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X),
                                               0,               /* min val */
-                                              priv->width - 1, /* max val */
-                                              priv->width,     /* resolution */
+                                              480 -1,//priv->width - 1,        /* max val */
+                                              1024,//priv->width,      /* resolution */
                                               0,               /* min_res */
-                                              priv->width,     /* max_res */
+                                              1024,//priv->width,      /* max_res */
                                               Absolute);

                        InitValuatorAxisStruct(device, 1,
                                               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y),
                                               0,               /* min val */
-                                              priv->height - 1,/* max val */
-                                              priv->height,    /* resolution */
+                                              272 -1,//priv->height - 1,/* max val */
+                                              1024,//priv->height,     /* resolution */
                                               0,               /* min_res */
-                                              priv->height,    /* max_res */
+                                              1024,//priv->height,     /* max_res */
                                               Absolute);

                        InitValuatorAxisStruct(device, 2,
@@ -311,19 +311,19 @@
                        InitValuatorAxisStruct(device, 0,
                                               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_X),
                                               0,               /* min val */
-                                              priv->width - 1, /* max val */
-                                              priv->width,     /* resolution */
+                                              480 -1,//priv->width - 1,        /* max val */
+                                              1024,//priv->width,      /* resolution */
                                               0,               /* min_res */
-                                              priv->width,     /* max_res */
+                                              1024,//priv->width,      /* max_res */
                                               Absolute);

                        InitValuatorAxisStruct(device, 1,
                                               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y),
                                               0,               /* min val */
-                                              priv->height - 1,/* max val */
-                                              priv->height,    /* resolution */
+                                              272 -1,//priv->height - 1,/* max val */
+                                              1024,//priv->height,     /* resolution */
                                               0,               /* min_res */
-                                              priv->height,    /* max_res */
+                                              1024,//priv->height,     /* max_res */
                                               Absolute);

                        InitValuatorAxisStruct(device, 2,

I don't know why this was necessary, only that it fixes the upside down uncalibrated touch screen. These values were determined first by trial and error, until i realized that the width and height values should be the resolution of the device, which I collected with the ts_calibrate command.

# ts_calibrate
xres = 480, yres = 272

1024 for the resolution was chosen based upon the values that used to be there as I found in this link: https://boundarydevices.com/debian-in-more-depth-adding-touch-support/

Anyhow, I am satisfied with the setup I currently have, but I thought I should post these results in case someone else has the same issue/ wants to track down a better solution.

The touch points to the upper left corner only.

Hi. all

I am using the file system as yocto.
I want to use xf86-input-tslib with X.

In ts_test, touch is good. (https://youtu.be/DLOdQVLJ4oM)

However, if i touch using xf86-input-tslib in X, it's a bit strange.
The cursor only points to the upper left corner. (https://youtu.be/xnzFYK5mHes)
Why is this happening?

Below are my basic related logs.

root@test:~# cat /etc/ts.conf
module_raw input

module pthres pmin=1
module dejitter delta=100
module linear
root@test:~#
root@test:~# cat /etc/pointercal
19 -13518 54017748 -10430 44 40723864 65536 800 600
root@test:~#
root@test:~# cat /usr/share/X11/xorg.conf.d/80-tslib.conf
#
# Catch-all tslib loader for udev-based systems
#
# We match on all touchscreen devices. If you have multiple, please specify.

Section "InputClass"
        Identifier "tslib touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "tslib"
EndSection
root@test:~#
root@test:~# fbset

mode "800x600"
    geometry 800 600 800 600 24
    timings 0 0 0 0 0 0 0
    rgba 8/16,8/8,8/0,0/0
endmode

root@test:~#

X11 log : Xorg.0.log

unknown substitution variable ${xinpdriver:Depends}

this is left to be resolved:

dh_gencontrol
dpkg-gencontrol: warning: Depends field of package xserver-xorg-input-tslib: unknown substitution variable ${xinpdriver:Depends}
dpkg-gencontrol: warning: Provides field of package xserver-xorg-input-tslib: unknown substitution variable ${xinpdriver:Provides}
dpkg-gencontrol: warning: Depends field of package xserver-xorg-input-tslib: unknown substitution variable ${xinpdriver:Depends}
dpkg-gencontrol: warning: Provides field of package xserver-xorg-input-tslib: unknown substitution variable ${xinpdriver:Provides}

absbit does not recognize ABS_X, ABS_Y.

Hello.

I have recently seen strange cases.
I am using tsc2007.
Below is the version I am using.

tslib: 1.17
xf86-input-tslib: 1.1.1

Segmentation fault occurred when executing xf86-input-tslib.
The related logs are shown below.

[   150.382] (==) RandR enabled
[   150.542] (II) config/udev: Adding input device TSC2007 Touchscreen (/dev/input/event0)
[   150.543] (**) TSC2007 Touchscreen: Applying InputClass "libinput touchscreen catchall"
[   150.543] (**) TSC2007 Touchscreen: Applying InputClass "tslib touchscreen catchall"
[   150.543] (II) LoadModule: "tslib"
[   150.543] (II) Loading /usr/lib/xorg/modules/input/tslib_drv.so
[   150.549] (II) Module tslib: vendor="X.Org Foundation"
[   150.549]    compiled for 1.19.3, module version = 1.1.1
[   150.549]    Module class: X.Org XInput Driver
[   150.549]    ABI class: X.Org XInput driver, version 24.1
[   150.549] (II) Using input driver 'tslib' for 'TSC2007 Touchscreen'
[   150.549] (**) TSC2007 Touchscreen: always reports core events
[   150.549] (**) Option "path" "/dev/input/event0"
[   150.564] (II) tslib: TSC2007 Touchscreen: using libts version 901
[   150.564] (**) TSC2007 Touchscreen: always reports core events
[   150.564] (EE) tslib: TSC2007 Touchscreen: no touchscreen device(EE) PreInit returned 2 for "TSC2007 Touchscreen"
[   150.564] (EE)
[   150.564] (EE) Backtrace:
[   150.564] (EE)
[   150.564] (EE) Segmentation fault at address 0x0
[   150.564] (EE)
Fatal server error:
[   150.564] (EE) Caught signal 11 (Segmentation fault). Server aborting
[   150.565] (EE)
[   150.565] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[   150.565] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[   150.565] (EE)
[   150.565] (EE) Server terminated with error (1). Closing log file.

I checked the relevant parts and confirmed the problem in the following section.
https://github.com/merge/xf86-input-tslib/blob/master/src/tslib.c#L544-L555
tsc2007 is not multi touch. So it should be priv->abs_x_only = 1; but return BadValue;

So I checked the related values as follows.

#endif /* TSLIB_VERSION_MT */

        xf86IDrvMsg(pInfo, X_INFO, "%s() %dLine ABS_MT_POSITION_X=0x%x ABS_MT_POSITION_Y=0x%x\n", __func__, __LINE__, ABS_MT_POSITION_X, ABS_MT_POSITION_Y);
        xf86IDrvMsg(pInfo, X_INFO, "%s() %dLine ABS_X=0x%x ABS_Y=0x%x\n", __func__, __LINE__, ABS_X, ABS_Y);
        xf86IDrvMsg(pInfo, X_INFO, "%s() %dLine BIT_WORD(ABS_MT_POSITION_X)=0x%x BIT_WORD(ABS_MT_POSITION_Y)=0x%x\n", __func__, __LINE__, BIT_WORD(ABS_MT_POSITION_X), BIT_WORD(ABS_MT_POSITION_Y));
        xf86IDrvMsg(pInfo, X_INFO, "%s() %dLine BIT_WORD(ABS_X)=0x%x BIT_WORD(ABS_Y)=0x%x\n", __func__, __LINE__, BIT_WORD(ABS_X), BIT_WORD(ABS_Y));
        xf86IDrvMsg(pInfo, X_INFO, "%s() %dLine absbit[BIT_WORD(ABS_MT_POSITION_X)]=0x%x absbit[BIT_WORD(ABS_MT_POSITION_Y)]=0x%x\n", __func__, __LINE__, absbit[BIT_WORD(ABS_MT_POSITION_X)], absbit[BIT_WORD(ABS_MT_POSITION_Y)]);
        xf86IDrvMsg(pInfo, X_INFO, "%s() %dLine BIT_MASK(ABS_MT_POSITION_X)=0x%x BIT_MASK(ABS_MT_POSITION_Y)=0x%x\n", __func__, __LINE__, BIT_MASK(ABS_MT_POSITION_X), BIT_MASK(ABS_MT_POSITION_Y));
        xf86IDrvMsg(pInfo, X_INFO, "%s() %dLine absbit[BIT_WORD(ABS_X)]=0x%x absbit[BIT_WORD(ABS_Y)]=0x%x\n", __func__, __LINE__, absbit[BIT_WORD(ABS_X)], absbit[BIT_WORD(ABS_Y)]);
        xf86IDrvMsg(pInfo, X_INFO, "%s() %dLine BIT_MASK(ABS_X)=0x%x BIT_MASK(ABS_Y)=0x%x\n", __func__, __LINE__, BIT_MASK(ABS_X), BIT_MASK(ABS_Y));

        if (!(absbit[BIT_WORD(ABS_MT_POSITION_X)] & BIT_MASK(ABS_MT_POSITION_X)) ||
	    !(absbit[BIT_WORD(ABS_MT_POSITION_Y)] & BIT_MASK(ABS_MT_POSITION_Y))) {
		if (!(absbit[BIT_WORD(ABS_X)] & BIT_MASK(ABS_X)) ||
		    !(absbit[BIT_WORD(ABS_Y)] & BIT_MASK(ABS_Y))) {
			xf86IDrvMsg(pInfo, X_ERROR, "no touchscreen device");
			return BadValue;
		} else {
			priv->abs_x_only = 1;
		}
	} else {
		priv->abs_x_only = 0;
	}

Below is the log.

[   107.986] (II) tslib: TSC2007 Touchscreen: xf86TslibInit() 623Line ABS_MT_POSITION_X=0x35 ABS_MT_POSITION_Y=0x36
[   107.986] (II) tslib: TSC2007 Touchscreen: xf86TslibInit() 624Line ABS_X=0x0 ABS_Y=0x1
[   107.986] (II) tslib: TSC2007 Touchscreen: xf86TslibInit() 625Line BIT_WORD(ABS_MT_POSITION_X)=0x1 BIT_WORD(ABS_MT_POSITION_Y)=0x1
[   107.986] (II) tslib: TSC2007 Touchscreen: xf86TslibInit() 626Line BIT_WORD(ABS_X)=0x0 BIT_WORD(ABS_Y)=0x0
[   107.986] (II) tslib: TSC2007 Touchscreen: xf86TslibInit() 628Line absbit[BIT_WORD(ABS_MT_POSITION_X)]=0x0 absbit[BIT_WORD(ABS_MT_POSITION_Y)]=0x0
[   107.986] (II) tslib: TSC2007 Touchscreen: xf86TslibInit() 629Line BIT_MASK(ABS_MT_POSITION_X)=0x200000 BIT_MASK(ABS_MT_POSITION_Y)=0x400000
[   107.986] (II) tslib: TSC2007 Touchscreen: xf86TslibInit() 630Line absbit[BIT_WORD(ABS_X)]=0x1000000 absbit[BIT_WORD(ABS_Y)]=0x1000000
[   107.986] (II) tslib: TSC2007 Touchscreen: xf86TslibInit() 631Line BIT_MASK(ABS_X)=0x1 BIT_MASK(ABS_Y)=0x2
[   107.986] (II) tslib: TSC2007 Touchscreen: xf86TslibInit() 635Line

When checking, the absbit[BIT_WORD(ABS_X)] and absbit[BIT_WORD(ABS_Y)] values are the same.
And the values are different from BIT_MASK(ABS_X) and BIT_MASK(ABS_Y).
So now it is return BadValue;

The log below is the information of my tsc2007 which I confirmed with evtest.

root@test:~# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      TSC2007 Touchscreen
Select the device event number [0-0]: 0
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "TSC2007 Touchscreen"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value   2114
      Min        0
      Max     4095
    Event code 1 (ABS_Y)
      Value   2264
      Min        0
      Max     4095
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max     4095
Properties:
Testing ... (interrupt to exit)
Event: time 1532238399.675718, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1532238399.675718, type 3 (EV_ABS), code 0 (ABS_X), value 1611
Event: time 1532238399.675718, type 3 (EV_ABS), code 1 (ABS_Y), value 2138
Event: time 1532238399.675718, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 1091
Event: time 1532238399.675718, -------------- SYN_REPORT ------------
Event: time 1532238399.695299, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1532238399.695299, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1532238399.695299, -------------- SYN_REPORT ------------

The values of absbit[BIT_WORD(ABS_X)] and absbit[BIT_WORD(ABS_Y)] seem to be strange.

I'm sorry I do not have enough English.

./configure fails against: unexpected token `RANDR,'

Hi
I try to compile xf86-input-tslib, but it failed. I try execute autogen.sh and it fail with suggestion to instal
sudo apt-get install xutils-dev
I did this. Next I invoke ./configure and it failed with following message:

./configure: line 18549: syntax error near unexpected token RANDR,' ./configure: line 18549: XORG_DRIVER_CHECK_EXT(RANDR, randrproto)'

What I am supposed to do?!?
Rasbian is fully updated...
thanks and best regards
Jacek

Using a variance filter on a single touchscreen will not touch.(tsc2007)

Hi. all

I am using tsc2007 as a touch controller.
Below are my settings.

root@test:~# cat /etc/ts.conf
module_raw input
module variance delta=30
module linear
root@test:~#

Touch works well with ts_test.
However, when I use xf86-input-tslib on X and touch it, the following warning message is displayed.

	tslib: WARNING: no multitouch using VARIANCE filter

And it does not touch on X11.
Below is /var/log/Xorg.0.log.

[  4635.442] (II) LoadModule: "tslib"
[  4635.442] (II) Loading /usr/lib/xorg/modules/input/tslib_drv.so
[  4635.443] (II) Module tslib: vendor="X.Org Foundation"
[  4635.443]    compiled for 1.19.3, module version = 1.2.0
[  4635.443]    Module class: X.Org XInput Driver
[  4635.443]    ABI class: X.Org XInput driver, version 24.1
[  4635.443] (II) Using input driver 'tslib' for 'TSC2007 Touchscreen'
[  4635.443] (**) TSC2007 Touchscreen: always reports core events
[  4635.443] (**) Option "path" "/dev/input/event0"
[  4635.445] (II) tslib: TSC2007 Touchscreen: using libts ABI version 0 (000900)
[  4635.445] (**) TSC2007 Touchscreen: always reports core events
[  4635.490] (**) Option "config_info" "udev:/sys/devices/virtual/input/input0/event0"
[  4635.490] (II) XINPUT: Adding extended input device "TSC2007 Touchscreen" (type: TOUCHSCREEN, id 6)
[  4635.492] (II) config/udev: Adding input device TSC2007 Touchscreen (/dev/input/mouse0)
[  4635.492] (II) No input driver specified, ignoring this device.
[  4635.492] (II) This device may have been added with another device file.

A warning message is displayed even though it is not multi-touch at present, and X11's touch does not work. Something is strange.

tslib : 1.5
xf86-input-tslib : 1.2.0-rc1
yocto : rocko

I'm sorry I do not have enough English.

after installing this i cant login anymore :()

i might be relatively new with linux, and i might have installed too much...

but after installing almost all input drivers in xorg and tslib, every time i try to login, it fails and brings the login page again.
what am i doing wrong?
i have ubuntu 18.04, intel core i7 board, waveshare touch screen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.