merge / xf86-input-tslib

X.org tslib input driver
MIT License
7 stars 2 forks source link

The touch points to the upper left corner only. #7

Open KwonTae-young opened 6 years ago

KwonTae-young commented 6 years ago

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

KwonTae-young commented 6 years ago

I did some debugging.

In the following section, priv-width and priv-height contain a value of 4095. https://github.com/merge/xf86-input-tslib/blob/e74682c815cd81f87a6fddd359b594038341c6d9/src/tslib.c#L557-L568

The tsc2007 kernel device driver that I use actually sets the ABS_X and ABS_Y values to MAX_12BIT (4095). https://github.com/torvalds/linux/blob/255442c93843f52b6891b21d0b485bf2c97f93c3/drivers/input/touchscreen/tsc2007_core.c#L370-L375

I entered my resolution of 800,600 in that area and confirmed that it works.

I think I should read 800,600 from /etc/pointercal because I already have calibrated.

merge commented 6 years ago

Thanks for reporting! Could you test using xf86-input-tstlib version 0.0.7? And set whatever it's config needs. Seems like we don't read your screen resolution correctly. There are a few open issues with the new version....

merge commented 6 years ago

ok. I guess the safest way will be to require the screen resolution to be set by the user in the config file again. I'll change the title accordingly, to have it on the todo list, ok?

KwonTae-young commented 6 years ago

Thanks for the quick feedback.

ForrestFeng commented 6 years ago

Hi merge, thanks for creating this software. I'm using it to adopt tslib to X. Like xoduddk123 reported, I'm having the same issue, is it fixed in the RC release?

merge commented 6 years ago

no. I haven't had time for it. Feel free to step up and do it.

Am 8. August 2018 02:44:32 MESZ schrieb Forrest Feng notifications@github.com:

Hi merge, thanks for creating this software. I'm using it to adopt tslib to X. Like xoduddk123 reported, I'm having the same issue, is it fixed in the RC release?

-- Martin Kepplinger http://martinkepplinger.com sent from mobile

marianomd commented 4 years ago

ok. I guess the safest way will be to require the screen resolution to be set by the user in the config file again. I'll change the title accordingly, to have it on the todo list, ok?

Hello merge!! Thanks for your effort. I'm facing the same problem. Do you mean in ts.conf? I can't find the parameters name or example for this.

merge commented 4 years ago

ok. I guess the safest way will be to require the screen resolution to be set by the user in the config file again. I'll change the title accordingly, to have it on the todo list, ok?

Hello merge!! Thanks for your effort. I'm facing the same problem. Do you mean in ts.conf? I can't find the parameters name or example for this.

no. the 80-tslib.conf file. please use version 1.1

danielrdt commented 4 years ago

Hi,

i got the same issue in my setup. In my case ABS_X was >16000 and ABS_Y was 9600 but in real maximum X was equal to horizontal resolution (1920) - so maybe the driver or tslib reports a wrong value at this point?

To create a configurable solution I added Options "MaxX" and "MaxY" in my commit 66b728428db63e45ce13f7034e9a23bec43f44b5. If ommited the "wrong" system values may be used again.

My xorg.conf now looks like:

Section "InputDevice"
    Identifier "tslib"
    Driver "tslib"
    Option "Device" "/dev/input/event0"
    Option "MaxX" "1920"
    Option "MaxY" "720"
EndSection

For me it resolves the problem. Hope it may also help others.

In master branch the fd seem to have changed - should I adapt this patch for master and submit a pull request?

Best regards Daniel