Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KwonTae-young opened this issue Feb 1, 2018 · 9 comments
Open

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

KwonTae-young opened this issue Feb 1, 2018 · 9 comments

Comments

@KwonTae-young
Copy link

KwonTae-young commented Feb 1, 2018

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
Copy link
Author

I did some debugging.

In the following section, priv-width and priv-height contain a value of 4095.

if (priv->abs_x_only) {
if (ioctl(fd_temp, EVIOCGABS(ABS_X), &absinfo) < 0) {
xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOGABS failed");
return BadValue;
}
priv->width = absinfo.maximum;
if (ioctl(fd_temp, EVIOCGABS(ABS_Y), &absinfo) < 0) {
xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOGABS failed");
return BadValue;
}
priv->height = absinfo.maximum;

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
Copy link
Owner

merge commented Feb 1, 2018

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
Copy link
Owner

merge commented Feb 1, 2018

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
Copy link
Author

Thanks for the quick feedback.

@ForrestFeng
Copy link

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
Copy link
Owner

merge commented Aug 8, 2018 via email

@marianomd
Copy link

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
Copy link
Owner

merge commented Sep 26, 2019

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 added a commit to danielrdt/xf86-input-tslib that referenced this issue Feb 17, 2020
@danielrdt
Copy link

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 66b7284. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants