Touchscreen and Driver Installed but tslib Cannot Calibrate

13,682

Try to add

input_dev = input_allocate_device();
[..]
set_bit(EV_ABS, input_dev->evbit);
set_bit(EV_KEY, input_dev->evbit);

So that the tslib sees the device as supporting both EV_ABS and EV_KEY events (even if it does not actually send both of those).

You know how to reach me if you have more questions... ;)

Share:
13,682
PhilBot
Author by

PhilBot

The ship stays where it is and the engines move the universe around it.

Updated on June 05, 2022

Comments

  • PhilBot
    PhilBot almost 2 years

    I have cross-compiled the latest commit of tslib from github ( https://github.com/kergoth/tslib/commits/master ). My touchscreen is hooked up to my embedded board and I enabled the drivers from the vendor. When I boot and look at the output of 'cat /dev/input/touchscreen' I can see plenty of output being generated from moving my fingers around the screen. The Kernel also outputs to the console nicely formatted messages for 'finger1' and 'finger2'.

    I am not able to calibrate however. When I set my environment variables like shown below and run ts_calibrate, it spits out the message 'xres = 640, yres = 480 tslib: Selected device is not a touchscreen (must support ABS and KEY event types)' and does nothing more...

    So Linux knows that my device exists and I can see scrolling output, but tslib can't calibrate. What am I doing wrong and how can I fix this?

    # ls -rlt /dev/input/touchscreen
    lrwxrwxrwx    1 root     root             6 Jan 17 21:06 /dev/input/touchscreen -> event1
    # chmod 777 /dev/input/touchscreen
    # chmod 777 /dev/input/event1
    
    # cat /dev/input/touchscreen  | hexdump
    0000000 9011 3883 565f 0001 0003 0030 0001 0000
    0000010 9011 3883 565f 0001 0003 0032 0001 0000
    0000020 9011 3883 565f 0001 0003 0035 04c9 0000
    0000030 9011 3883 565f 0001 0003 0036 0c3f 0000
    0000040 9011 3883 565f 0001 0000 0002 0000 0000
    0000050 9011 3883 565f 0001 0000 0000 0000 0000
    0000060 9011 3883 90a9 0001 0003 0030 0001 0000
    0000070 9011 3883 90a9 0001 0003 0032 0001 0000
    
    # cat /sys/devices/virtual/input/input1/uevent
    PRODUCT=0/0/0/0
    NAME="aura-touchscreen"
    PROP=0
    EV=9
    ABS=650000 0
    MODALIAS=input:b0000v0000p0000e0000-e0,3,kra30,32,35,36,mlsfw
    
    # cat /etc/ts.conf
    # Uncomment if you wish to use the linux input layer event interface
    module_raw input
    module pthres pmin=1
    module variance delta=30
    module dejitter delta=100
    module linear
    
    export TSLIB_TSEVENTTYPE=INPUT
    export TSLIB_TSDEVICE=/dev/input/touchscreen
    export TSLIB_CALIBFILE=/etc/pointercal
    export TSLIB_CONFFILE=/etc/ts.conf
    export TSLIB_PLUGINDIR=/usr/lib/ts
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_CONSOLEDEVICE=none
    export TSTS_INFO_FILE=/sys/devices/virtual/input/input1/uevent
    export QWS_MOUSE_PROTO=tslib:/dev/input/touchscreen
    export PATH=$PATH:/usr/bin
    ts_calibrate
    xres = 640, yres = 480
    tslib: Selected device is not a touchscreen (must support ABS and KEY event types)
    

    Interesting if I do 'cat /proc/bus/input/devices' then I can see my touchscreen but there is only an ABS entry ( no KEY ) and tslib says I need both. Can I somehow assign a 'KEY' entry here?

    # cat /proc/bus/input/devices
    I: Bus=0019 Vendor=0001 Product=0001 Version=0003
    N: Name="TWL4030 Keypad"
    P: Phys=twl4030_keypad/input0
    S: Sysfs=/devices/platform/omap/omap_i2c.1/i2c-1/1-004a/twl4030_keypad/input/input0
    U: Uniq=
    H: Handlers=kbd event0
    B: PROP=0
    B: EV=100013
    B: KEY=ffc
    B: MSC=10
    
    I: Bus=0000 Vendor=0000 Product=0000 Version=0000
    N: Name="aura-touchscreen"
    P: Phys=
    S: Sysfs=/devices/virtual/input/input1
    U: Uniq=
    H: Handlers=event1
    B: PROP=0
    B: EV=9
    B: ABS=650000 0
    
  • PhilBot
    PhilBot over 11 years
    Thanks - I added the following to get ts_calibrate to not complain about the device not being a touchscreen: set_bit(EV_KEY, aura.input_dev->evbit); set_bit(ABS_X, aura.input_dev->absbit); set_bit(ABS_Y, aura.input_dev->absbit); set_bit(BTN_TOUCH, aura.input_dev->keybit); I am still working on getting ts_calibrate to accept input though.