Re: Raw mouse input is distorted

2008-09-22 Thread Peter Hutterer
On Fri, Sep 19, 2008 at 01:29:58PM +0200, Søren Hauberg wrote:
 I do have a follow-up question (you can't get rid of me that easy :-)
 ). I have modified the 'usbtouchscreen' kernel module such that it can
 use calibration parameters. With this in place, my touchscreen works
 in X with the 'evdev' driver, i.e. out of the box. Do you guys think
 this is the right approach to handling touchscreens in GNU/Linux, or
 would you prefer an X driver for handling touchscreens? I plan on
 posting the kernel patch to the kernel list on Monday unless anybody
 here thinks the problem should be solved in X instead of the kernel.

I'd prefer the fix in the kernel module, as it keeps the X drivers to a
minimum.
 
Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Raw mouse input is distorted

2008-09-22 Thread Simon Thum
Søren Hauberg wrote:
 I'm sorry but I don't quite understand (I don't know that much about
 either X, nor the kernel). But you think it would be better to solve
 this in X, right? Via a special driver for touch screens? And then I
 can use these 'device properties' to set the calibration parameters
 without restarting X? Is that what you mean? If so, where can I read
 about these 'device properties'?
It depends on what exactly you are calibrating. If it is only about 
sensor value range, evdev will adapt to what the kernel specifies in 
EVIOCGABS (ABS_X / ABS_Y). Should suffice in the usual case.

If there's more, well, it's really up to you. In-kernel means gpm stuff 
works too.

As for dev props, peter's post is everything non-code I saw yet:
http://who-t.blogspot.com/2008/07/input-device-properties.html


___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Raw mouse input is distorted

2008-09-22 Thread Søren Hauberg
2008/9/22 Peter Hutterer [EMAIL PROTECTED]:
 On Fri, Sep 19, 2008 at 01:29:58PM +0200, Søren Hauberg wrote:
 I do have a follow-up question (you can't get rid of me that easy :-)
 ). I have modified the 'usbtouchscreen' kernel module such that it can
 use calibration parameters. With this in place, my touchscreen works
 in X with the 'evdev' driver, i.e. out of the box. Do you guys think
 this is the right approach to handling touchscreens in GNU/Linux, or
 would you prefer an X driver for handling touchscreens? I plan on
 posting the kernel patch to the kernel list on Monday unless anybody
 here thinks the problem should be solved in X instead of the kernel.

 I'd prefer the fix in the kernel module, as it keeps the X drivers to a
 minimum.

This is also the conclusion I came to, because the changes to the
kernel are fairly small. Also, it should help touch screen users who
aren't using X.

Søren
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Raw mouse input is distorted

2008-09-21 Thread Simon Thum
Søren Hauberg wrote:
 I do have a follow-up question (you can't get rid of me that easy :-)
 ). I have modified the 'usbtouchscreen' kernel module such that it can
 use calibration parameters. With this in place, my touchscreen works
 in X with the 'evdev' driver, i.e. out of the box. Do you guys think
 this is the right approach to handling touchscreens in GNU/Linux, or
 would you prefer an X driver for handling touchscreens? I plan on
 posting the kernel patch to the kernel list on Monday unless anybody
 here thinks the problem should be solved in X instead of the kernel.
Kernel has its merits, but I'd say X via device properties (rather new 
feature). This solves the root problem too.
Hosting: ATM it seems to be more kernel-related than X-related, and 
should go to the former's hemisphere.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Raw mouse input is distorted

2008-09-19 Thread Simon Thum
Søren Hauberg wrote:
 Can I somehow force the evdev driver to only accept absolute events?
 
 I'll see if I can find the time to look into fixing the issue, as I
 guess it could be related to my problems. But like everybody else I'm
 in lack of time, so I'm not sure if it'll be doable.
Adding an option would make the problem solveable in HAL, which isn't 
the worst place of all. Should be trivial.

If that's the issue, you should find both relative and absolute axes 
mentioned in your xorg log.

In xf86-input-evdev/evdev.c there's EvdevInit and EvdevProbe. The former 
could be used to place an option, the latter might give you insights how 
to mod your kernel module to get rid of relative stuff so you don't need 
to modify evdev.

@Peter: It might make sense to suppress the relative bit if a absolute 
touchpad is found, or go prefer absolute on touchpads in EvdevInit(). 
How do you think about that?

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Raw mouse input is distorted

2008-09-18 Thread Søren Hauberg
2008/9/18 Peter Hutterer [EMAIL PROTECTED]:
 On Wed, Sep 17, 2008 at 06:46:17AM -0700, Hauberg wrote:
   Now, my problem is that X seems to somehow accelerate the output from the
 'usbtouchscreen' module, so that when I move my finger to the left, the
 cursor moves about twice as far to the left as my finger did. This does not
 correspond to the output from the 'usbtouchscreen' module. So, I'm a bit
 confused here: does X place the cursor at the position outputted by the
 kernel, or does it do some fancy things?

 after a quick 30s peek into the evtouch driver:
 it always inits x/y with a range of [0-1024]. you'd need to change this (in
 EVTouchPreInit) to reflect the real range of the coordinates you post from the
 driver module.

I don't see this in the evtouch driver, but since I don't know much
about X, this just might be my ignorance showing :-)
In general, I really want to avoid using the evtouch driver as it is
unmaintained. The only development on this driver appears to be done
by the Debian people. So the actual place to get the evtouch source
code is not the evtouch website, but actually the Debian package. This
difference could also explain why I don't see the 1024 stuff in
EVTouchPreInit.

But I don't think I've been clear enough in my description of our
system. One way to get a functional setup is to use the
'usbtouchscreen' kernel module and the evtouch X11 driver. This works
fine for everyday use, but it is hard to perform calibration.
  Another way to get a potentially working setup (this is what I'm
working on) is to alter the 'usbtouchscreen' kernel module such that
it can read the calibration data, and actually provide actual screen
coordinates. I have this working, such that I can give the kernel my
calibration parameters, and it will emit mouse events that corresponds
to actual screen coordinates. If I use the 'evdev' X11 driver to
handle these mouse events the cursor moves faster (I think that's the
best word I've got) than the output from the kernel. Instead of using
the 'evdev' X11 driver I can use the evtouch driver, and tell it not
to use the calibration data, and that works. But then I haven't gotten
rid of the evtouch driver, which is my main motivation.

 all events are posted as absolute from the evtouch driver
 (xf86PostMotionEvent, xf86PostButtonEvent), which means they will get scaled
 by the server into the screen space, i.e. if the screen has a resolution is
 2048, this means that the device coordinate 512 will map to the screen
 coordinate 1024.

 This could be the reason for your scaling issue. Setting up the axes with the
 right values should fix that. alternatively, you could make sure the kernel
 driver pre-scales to a range of 0-1024.

I've tried to make the kernel send events with x in [0, 1023] and y in
[0, 1023], but that still behaves quite poorly. I'm sorry that I can't
give a better explanation, but I know sooo little about X that I
simply don't have the terminology.

Søren
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Raw mouse input is distorted

2008-09-17 Thread Hauberg

Hi All,
  First post here, so if I'm asking the wrong place, please let me know...
Anyway, at work I have a DMC touchscreen that Linux recognizes with the
'usbtouchscreen' kernel module. If I want to use this touchscreen with X I
have to calibrate the screen, and give some parameters to the 'evtouch'
driver. This is working just fine except the calibration procedure requires
that I restart X. Since I want to give our customers a chance to calibrate
the screen, I'm not too fond of this X-restarting (it makes our product look
hacky) .
  So, in order to solve this problem, I've extended the 'usbtouchscreen'
kernel module such that it can read the calibration parameters, and
transform the coordinates accordingly (if anybody wants the patch for
'usbtouchscreen' let me know). With this change, I can see (via kernel logs)
that the output generated by the 'usbtouchscreen' module corresponds quite
well to the physical position where I touch the screen. So far so good...
  Now, my problem is that X seems to somehow accelerate the output from the
'usbtouchscreen' module, so that when I move my finger to the left, the
cursor moves about twice as far to the left as my finger did. This does not
correspond to the output from the 'usbtouchscreen' module. So, I'm a bit
confused here: does X place the cursor at the position outputted by the
kernel, or does it do some fancy things?

Thanks,
Søren

P.S. I guess I should mention that I'm using OpenSUSE 11.0.

P.P.S. It might be relevant to say that output is sent from 'usbtouchscreen'
using 'input_report_abs' which calls 'input_event' with the 'EV_ABS' flag.
-- 
View this message in context: 
http://www.nabble.com/Raw-mouse-input-is-distorted-tp19532482p19532482.html
Sent from the Free Desktop - xorg mailing list archive at Nabble.com.

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: Raw mouse input is distorted

2008-09-17 Thread Simon Thum
Søren Hauberg wrote:
 2008/9/17 Simon Thum [EMAIL PROTECTED]:
 Yeah, it does some fancy things for relative devices. Technically, you don't
 have one, but you should be able to suppress it with

 xset 1 1
crap. I meant

  xset m 1 1

 the kernel. But I'm a bit confused about one thing: the kernel driver
 marks its output as EV_ABS (I assume that means an absolute position).
 So, why would X consider the device to be relative? Does it convert
 everything into relative positions?
Maybe evdev works better? I seems there is a problem when both absolute 
AND relative axes are exposed, but since you seems to have some control 
over the kernel module, you could simply suppress those. That should be 
enough get X recognize it as absolute.

I cc'ed the list so better ideas may emerge.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Raw mouse input is distorted

2008-09-17 Thread Peter Hutterer
On Wed, Sep 17, 2008 at 09:26:08PM +0200, Simon Thum wrote:
 Maybe evdev works better? I seems there is a problem when both absolute 
 AND relative axes are exposed,  

The reason for this is that there's a couple of popular devices
(keyboard/mouse combos) that claim to have both relative x/y axes and absolute
x/y axes simultaneously.

You lose the ability to go past the min/max reported for x/y (which in my case
was 255/255). It can be fixed in the driver, but nobody volunteered for it
yet.

If you feel like it: https://bugs.freedesktop.org/show_bug.cgi?id=17637

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg