Tias <[email protected]> [2009-12-12 23:36:07]:

> Hi Petr,

Hi Tias,

> If you think it is related to calibration, you can try 
> xinput_calibrator. Its a generic touchscreen calibration utility (still 
> depends on GTK-mm for now, will be fixed in the next version):
> http://www.freedesktop.org/wiki/Software/xinput_calibrator

Thanks, I've modified it little bit to get it working, pls see attached
patches:

custom-device.patch: Allows you to specify which device use want calibrate,
it's necessary if you've more devices. In current state it tries to configure
last device found and in my case it wasn't touchscreen device.

new-values-evdev.patch: In current state it prints out xorg.conf settings for
evtouch driver, so I modified it and now it prints correct values for evdev
driver also, plus commandline values for xinput set-int-prop.

> It calibrates the Xorg driver (and the values that the X server 
> receives). You report calibrating from the values of the kernel, maybe 
> using a user-space tool will solve your problem ?

I tried values from xinput_calibrator after calibration, but the situation is
same as it was before, I still can't access bottom-right part of screen and
it's even worse with this values, because now the touches in top-left area are
bit off few points, pointer movement doesn't match touches.

What do you mean by user-space tool?

> If you want to find out what the X server thinks of your touchscreen 
> actions, install xinput and run:
>  > xinput test "TS name"
> you can also check the output of
>  > xinput query-state "TS name"
> to find out the exact coordinates of your touches.
> (this will probably be similar to the 'xidump' you mentioned though)

Yes, I tried that also before, but it's same, seems like correct values which
match kernel values. I'll try to dig into Xserver code to find out what's
going on.  My 22" touchscreen is 16:10, shouldn't that be a problem?

Thanks a lot for your suggestions.

-- ynezz
Index: xinput_calibrator/xinput_calibrator.cc
===================================================================
--- xinput_calibrator.orig/xinput_calibrator.cc	2009-12-13 13:09:03.000000000 +0100
+++ xinput_calibrator/xinput_calibrator.cc	2009-12-13 13:40:38.000000000 +0100
@@ -281,7 +281,7 @@
   /* We ignore flip_x and flip_y,
    * the min/max values will already be flipped and drivers can handle this */
 
-  printf ("Suggested new values for xorg.conf:\n");
+  printf ("Suggested new values for xorg.conf, evtouch driver:\n");
   printf ("\tOption\t\"MinX\"\t\t\"%d\"\t# was \"%d\"\n",
                 min_x, oldcalib_min_x);
   printf ("\tOption\t\"MaxX\"\t\t\"%d\"\t# was \"%d\"\n",
@@ -291,6 +291,15 @@
   printf ("\tOption\t\"MaxY\"\t\t\"%d\"\t# was \"%d\"\n",
                 max_y, oldcalib_max_y);
   printf ("\tOption\t\"SwapXY\"\t\"%d\"\n", swap_xy);
+  printf ("\nSuggested new values for xorg.conf, evdev driver:\n");
+  printf ("\tOption\t\"Calibration\"\t\"%d %d %d %d\"\t# was \"%d %d %d %d\"\n",
+                min_x, max_x, min_y, max_y, oldcalib_min_x, oldcalib_max_x,
+                oldcalib_min_y, oldcalib_max_y);
+  printf ("\tOption\t\"SwapXY\"\t\"%d\"\n", swap_xy);
+  printf ("\nOr you can set it online running this commands:\n");
+  printf ("\txinput set-int-prop %s \"Evdev Axis Calibration\" 32 "
+          "%d %d %d %d\n", drivername, min_x, max_x, min_y, max_y);
+  printf ("\txinput set-int-prop %s \"Evdev Axes Swap\" 8 %d\n", drivername, swap_xy);
 }
 
 
Index: xinput_calibrator/xinput_calibrator.cc
===================================================================
--- xinput_calibrator.orig/xinput_calibrator.cc	2009-12-13 13:09:35.000000000 +0100
+++ xinput_calibrator/xinput_calibrator.cc	2009-12-13 13:10:53.000000000 +0100
@@ -23,8 +23,9 @@
  * Authors:
  *	Soren Hauberg ([email protected])
  *	Tias Guns ([email protected])
+ *	Petr Stetiar ([email protected])
  *
- * Version: 0.2.0
+ * Version: 0.2.1
  *
  * Make: g++ -Wall xinput_calibrator.cc `pkg-config --cflags --libs gtkmm-2.4` -o xinput_calibrator
  */
Index: xinput_calibrator/xinput_calibrator.cc
===================================================================
--- xinput_calibrator.orig/xinput_calibrator.cc	2009-12-13 11:47:15.000000000 +0100
+++ xinput_calibrator/xinput_calibrator.cc	2009-12-13 13:09:03.000000000 +0100
@@ -476,6 +476,8 @@
 {
 public:
   CalibrationArea ();
+  void init ();
+  void set_device (const char *name) { device_name = name; };
 
 protected:
   /* Helper functions */
@@ -491,10 +493,15 @@
   int num_clicks, width, height;
   Calibrator* W;
   int time_elapsed;
+  const char *device_name;
 };
 
 CalibrationArea::CalibrationArea ()
-  : num_clicks (0), time_elapsed (0)
+  : num_clicks (0), time_elapsed (0), device_name (0)
+{
+}
+
+void CalibrationArea::init ()
 {
   /* Not sure this is the right place for this, but here we go
    * Get driver name and axis information from XInput */
@@ -540,6 +547,12 @@
                     max_x = ax[0].max_value;
                     min_y = ax[1].min_value;
                     max_y = ax[1].max_value;
+
+                    /* If it's device user specified on commadline */
+                    if (device_name && !strcmp(drivername, device_name)) {
+                        fprintf(stderr, "Found user specified device: '%s'\n", drivername);
+                        goto found_device;
+                    }
                 }
 
             }
@@ -553,6 +566,8 @@
         }
 
     }
+
+found_device:
     XFreeDeviceList (slist);
 
     if (found == 0) {
@@ -711,6 +726,10 @@
   win.fullscreen ();
 
   CalibrationArea area;
+  if (argc > 1)
+     area.set_device (argv[1]);
+
+  area.init ();
   win.add (area);
   area.show ();
 
_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to