Skip to contentSkip to conversation

Elo serial touchscreen driver

PATCH In review Vojtech Pavlik 4 participants 23 messages Feb 8, 2005 – Feb 10, 2005 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Elo serial touchscreen driver

Hi!

I've written a driver for probably the most common touchscreen type - the serial Elo touchscreen.

The driver should handle all generations of serial Elos, as it handles Elo 10-byte, 6-byte, 4-byte and 3-byte protocols.

I do not have any touchscreen, so I can't test the driver myself.

So if you have the time, please comment on the code of the patch, and if you have an Elo, please try the driver with it.

Patch attached, also attached is an uptodate version of inputattach, a program needed to get the kernel to talk to the device.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR

[email protected], 2005-02-08 17:18:38+01:00, [email protected]
input: Add support for serial ELO touchscreens, including
Elo IntelliTouch, AccuTouch and SecureTouch.

 drivers/input/touchscreen/Kconfig  |   13 +
 drivers/input/touchscreen/Makefile |    1 
 drivers/input/touchscreen/elo.c    |  315 +++++++++++++++++++++++++++++++++++++
 include/linux/serio.h              |    1 
 4 files changed, 330 insertions(+)
drivers/input/touchscreen/Kconfig +13 -0
diff -Nru a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
@@ -48,6 +48,19 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called gunze.
 
+config TOUCHSCREEN_ELO
+	tristate "Elo serial touchscreens"
+	select SERIO
+	help
+	  Say Y here if you have an Elo serial touchscreen connected to
+	  your system.
+
+	  If unsure, say N.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called gunze.
+
+
 config TOUCHSCREEN_MK712
 	tristate "ICS MicroClock MK712 touchscreen"
 	help
drivers/input/touchscreen/Makefile +1 -0
diff -Nru a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
@@ -7,4 +7,5 @@
 obj-$(CONFIG_TOUCHSCREEN_BITSY)	+= h3600_ts_input.o
 obj-$(CONFIG_TOUCHSCREEN_CORGI)	+= corgi_ts.o
 obj-$(CONFIG_TOUCHSCREEN_GUNZE)	+= gunze.o
+obj-$(CONFIG_TOUCHSCREEN_ELO)	+= elo.o
 obj-$(CONFIG_TOUCHSCREEN_MK712)	+= mk712.o
drivers/input/touchscreen/elo.c new file +315 -0

315 lines not on this page · raw message

include/linux/serio.h +1 -0
diff -Nru a/include/linux/serio.h b/include/linux/serio.h
@@ -216,5 +216,6 @@
 #define SERIO_SNES232	0x26
 #define SERIO_SEMTECH	0x27
 #define SERIO_LKKBD	0x28
+#define SERIO_ELO	0x29
 
 #endif

[email protected], 2005-02-08 17:37:12+01:00, [email protected]
input: Move #include <linux/interrupt.h> inside #ifdef __KERNEL__
in serio.h, to make it userspace-compilable.

 serio.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
include/linux/serio.h +1 -1
diff -Nru a/include/linux/serio.h b/include/linux/serio.h
@@ -10,12 +10,12 @@
  */
 
 #include <linux/ioctl.h>
-#include <linux/interrupt.h>
 
 #define SPIOCSTYPE	_IOW('q', 0x01, unsigned long)
 
 #ifdef __KERNEL__
 
+#include <linux/interrupt.h>
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/device.h>

/*
* $Id: inputattach.c,v 1.22 2005/02/06 13:49:09 vojtech Exp $
*
* Copyright (c) 1999-2000 Vojtech Pavlik
*
* Sponsored by SuSE
*
* Twiddler support Copyright (c) 2001 Arndt Schoenewald
* Sponsored by Quelltext AG (http://www.quelltext-ag.de), Dortmund, Germany */

/*
* Input line discipline attach program
*/

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <[email protected]>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */

#include <linux/serio.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>

int readchar(int fd, unsigned char *c, int timeout)

{
	struct timeval tv;
	fd_set set;
	
	tv.tv_sec = 0;
	tv.tv_usec = timeout * 1000;

	FD_ZERO(&set);
	FD_SET(fd, &set);

	if (!select(fd+1, &set, NULL, NULL, &tv)) return -1;
	if (read(fd, c, 1) != 1) return -1;

	return 0;
}

void setline(int fd, int flags, int speed)

{
	struct termios t;

	tcgetattr(fd, &t);

	t.c_cflag = flags | CREAD | HUPCL | CLOCAL;
	t.c_iflag = IGNBRK | IGNPAR;
	t.c_oflag = 0;
	t.c_lflag = 0;
	t.c_cc[VMIN ] = 1;
	t.c_cc[VTIME] = 0;

	cfsetispeed(&t, speed);
	cfsetospeed(&t, speed);

	tcsetattr(fd, TCSANOW, &t);
}

int logitech_command(int fd, char *c)

{
	int i;
	unsigned char d;
	for (i = 0; c[i]; i++) {
		write(fd, c + i, 1);
		if (readchar(fd, &d, 1000))
			return -1;
		if (c[i] != d)
			return -1;
	}
	return 0;
}

int magellan_init(int fd, long *id, long *extra)

{
	write(fd, "m3\rpBB\rz\r", 9);
	return 0;
}

int warrior_init(int fd, long *id, long *extra)

{
	if (logitech_command(fd, "*S")) return -1;
	setline(fd, CS8, B4800);
	return 0;
}

int spaceball_waitchar(int fd, unsigned char c, unsigned char *d, int timeout)

{
	unsigned char b = 0;

	while (!readchar(fd, &b, timeout)) {
		if (b == 0x0a) continue;
		*d++ = b;
		if (b == c) break;
	}

	*d = 0;

	return -(b != c);
}

int spaceball_waitcmd(int fd, char c, char *d)

{
	int i;

	for (i = 0; i < 8; i++) {
		if (spaceball_waitchar(fd, 0x0d, d, 1000))
			return -1;
		if (d[0] == c)
			return 0;
	}

	return -1;
}

int spaceball_cmd(int fd, char *c, char *d)

{
	int i;

	for (i = 0; c[i]; i++)
		write(fd, c + i, 1);
	write(fd, "\r", 1);

	i = spaceball_waitcmd(fd, toupper(c[0]), d);

	return i;
}

#define SPACEBALL_1003 1
#define SPACEBALL_2003B 3
#define SPACEBALL_2003C 4
#define SPACEBALL_3003C 7
#define SPACEBALL_4000FLX 8
#define SPACEBALL_4000FLX_L 9

int spaceball_init(int fd, long *id, long *extra)

{
	char r[64];

	if (spaceball_waitchar(fd, 0x11, r, 4000) ||
	    spaceball_waitchar(fd, 0x0d, r, 1000))
		return -1;

	if (spaceball_waitcmd(fd, '@', r))
		return -1; 

	if (strncmp("@1 Spaceball alive", r, 18))
		return -1;

	if (spaceball_waitcmd(fd, '@', r))
		return -1; 

	if (spaceball_cmd(fd, "hm", r))
		return -1;

	if (!strncmp("Hm2003B", r, 7))
		*id = SPACEBALL_2003B;
	if (!strncmp("Hm2003C", r, 7))
		*id = SPACEBALL_2003C;
	if (!strncmp("Hm3003C", r, 7))
		*id = SPACEBALL_3003C;

	if (!strncmp("HvFirmware", r, 10)) {

		if (spaceball_cmd(fd, "\"", r))
			return -1;

		if (strncmp("\"1 Spaceball 4000 FLX", r, 21))
			return -1;

		if (spaceball_waitcmd(fd, '"', r))
			return -1; 

		if (strstr(r, " L "))
			*id = SPACEBALL_4000FLX_L;
		else
			*id = SPACEBALL_4000FLX;

		if (spaceball_waitcmd(fd, '"', r))
			return -1; 

		if (spaceball_cmd(fd, "YS", r))
        	        return -1;

		if (spaceball_cmd(fd, "M", r))
        	        return -1;

		return 0;
	}

	if (spaceball_cmd(fd, "P@A@A", r) ||
	    spaceball_cmd(fd, "FT@", r)   ||
	    spaceball_cmd(fd, "MSS", r))
		return -1;

	return 0;
}

int stinger_init(int fd, long *id, long *extra)

{
	int i;
	unsigned char c;
	unsigned char *response = "\r\n0600520058C272";

	if (write(fd, " E5E5", 5) != 5)		/* Enable command */
		return -1; 

	for (i = 0; i < 16; i++)		/* Check for Stinger */
		if (readchar(fd, &c, 200) || (c != response[i])) 
			return -1;

	return 0;
}

int mzp_init(int fd, long *id, long *extra)

{
	if (logitech_command(fd, "*X*q")) return -1;
	setline(fd, CS8, B9600);
	return 0;
}

int newton_init(int fd, long *id, long *extra) {
int i;
unsigned char c;
unsigned char response[35] =
{ 0x16, 0x10, 0x02, 0x64, 0x5f, 0x69, 0x64, 0x00,

    0x00, 0x00, 0x0c, 0x6b, 0x79, 0x62, 0x64, 0x61,
    0x70, 0x70, 0x6c, 0x00, 0x00, 0x00, 0x01, 0x6e,
    0x6f, 0x66, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x10,
    0x03, 0xdd, 0xe7 };
  for (i = 0; i < 35; i++)
    if (readchar(fd, &c, 400) || (c != response[i]))
      return -1;

return 0;
}

int twiddler_init(int fd, long *id, long *extra)

{
	unsigned char c[10];
	int count, line;

	/* Turn DTR off, otherwise the Twiddler won't send any data. */
	if (ioctl(fd, TIOCMGET, &line)) return -1;
	line &= ~TIOCM_DTR;
	if (ioctl(fd, TIOCMSET, &line)) return -1;

	/* Check whether the device on the serial line is the Twiddler.
	 *
	 * The Twiddler sends data packets of 5 bytes which have the following
	 * properties: the MSB is 0 on the first and 1 on all other bytes, and
	 * the high order nibble of the last byte is always 0x8.
	 *
	 * We read and check two of those 5 byte packets to be sure that we
	 * are indeed talking to a Twiddler. */

	/* Read at most 5 bytes until we find one with the MSB set to 0 */
	for (count = 0; count < 5; count++) {
		if (readchar(fd, c+0, 500)) return -1;
		if ((c[0] & 0x80) == 0) break;
	}

	if (count == 5) {
		/* Could not find header byte in data stream */
		return -1;
	}

	/* Read remaining 4 bytes plus the full next data packet */
	for (count = 1; count < 10; count++) {
		if (readchar(fd, c+count, 500)) return -1;
	}

	/* Check whether the bytes of both data packets obey the rules */
	for (count = 1; count < 10; count++) {
		if ((count % 5 == 0 && (c[count] & 0x80) != 0)
		    || (count % 5 == 4 && (c[count] & 0xF0) != 0x80)
		    || (count % 5 != 0 && (c[count] & 0x80) != 0x80)) {
		    	/* Invalid byte in data packet */
			return -1;
		}
	}

	return 0;
}

int dump_init(int fd, long *id, long *extra)

{
	unsigned char c, o = 0;

	c = 0x80;

	if (write(fd, &c, 1) != 1)         /* Enable command */
                return -1;

	while (1)
		if (!readchar(fd, &c, 1)) {
			printf("%02x (%c) ", c, ((c > 32) && (c < 127)) ? c : 'x');
			o = 1;
		} else {
			if (o) {
				printf("\n");
				o = 0;
			}
		}
}
struct input_types {
	char name[16];
	char name2[16];
	int speed;
	int flags;
	unsigned long type;
	unsigned long id;
	unsigned long extra;
	int flush;
	int (*init)(int fd, long *id, long *extra);
};

struct input_types input_types[] = {

{ "--sunkbd", "-skb", B1200, CS8, SERIO_SUNKBD, 0, 0, 1, NULL },
{ "--lkkbd", "-lk", B4800, CS8|CSTOPB, SERIO_LKKBD, 0, 0, 1, NULL },
{ "--vsxxx-aa", "-vs", B4800, CS8|CSTOPB|PARENB|PARODD,SERIO_VSXXXAA, 0, 0, 1, NULL },
{ "--spaceorb", "-orb", B9600, CS8, SERIO_SPACEORB, 0, 0, 1, NULL },
{ "--spaceball", "-sbl", B9600, CS8, SERIO_SPACEBALL,0, 0, 0, spaceball_init },
{ "--magellan", "-mag", B9600, CS8 | CSTOPB | CRTSCTS, SERIO_MAGELLAN, 0, 0, 1, magellan_init },
{ "--warrior", "-war", B1200, CS7 | CSTOPB, SERIO_WARRIOR, 0, 0, 1, warrior_init },
{ "--stinger", "-sting", B1200, CS8, SERIO_STINGER, 0, 0, 1, stinger_init },
{ "--mousesystems", "-msc", B1200, CS8, SERIO_MSC, 0, 0x01, 1, NULL },
{ "--sunmouse", "-sun", B1200, CS8, SERIO_SUN, 0, 0x01, 1, NULL },
{ "--microsoft", "-bare", B1200, CS7, SERIO_MS, 0, 0, 1, NULL },
{ "--mshack", "-ms", B1200, CS7, SERIO_MS, 0, 0x01, 1, NULL },
{ "--mouseman", "-mman", B1200, CS7, SERIO_MP, 0, 0x01, 1, NULL },
{ "--intellimouse", "-ms3", B1200, CS7, SERIO_MZ, 0, 0x11, 1, NULL },
{ "--mmwheel", "-mmw", B1200, CS7 | CSTOPB, SERIO_MZP, 0, 0x13, 1, mzp_init },
{ "--iforce", "-ifor", B38400, CS8, SERIO_IFORCE, 0, 0, 0, NULL },

{ "--newtonkbd",        "-newt",        B9600, CS8,                     SERIO_NEWTON,	0,	0,	0,      newton_init },
{ "--h3600ts",          "-ipaq",     	B115200, CS8,                   SERIO_H3600,	0,	0,	0,      NULL },
{ "--stowawaykbd",      "-ipaqkbd",     B115200, CS8,                   SERIO_STOWAWAY, 0,	0,	0,      NULL },

{ "--ps2serkbd", "-ps2ser", B1200, CS8, SERIO_PS2SER, 0, 0, 1, NULL },
{ "--twiddler", "-twid", B2400, CS8, SERIO_TWIDKBD, 0, 0, 0, twiddler_init },
{ "--twiddler-joy", "-twidjoy", B2400, CS8, SERIO_TWIDJOY, 0, 0, 0, twiddler_init },
{ "--elotouch", "-elo", B9600, CS8 | CRTSCTS, SERIO_ELO, 0, 0, 0, NULL },
{ "--elo4002", "-elo6b", B9600, CS8 | CRTSCTS, SERIO_ELO, 1, 0, 0, NULL },
{ "--elo271-140", "-elo4b", B9600, CS8 | CRTSCTS, SERIO_ELO, 2, 0, 0, NULL },
{ "--elo261-280", "-elo3b", B9600, CS8 | CRTSCTS, SERIO_ELO, 3, 0, 0, NULL },
{ "--dump", "-dump", B2400, CS8, 0, 0, 0, 0, dump_init },
{ "", "", 0, 0 }

};

int main(int argc, char **argv)

{
	unsigned long devt;
	int ldisc;
        int type;
	long id, extra;
        int fd;
	char c;

        if (argc < 2 || argc > 3 || !strcmp("--help", argv[1])) {
                puts("");
                puts("Usage: inputttach <mode> <device>");
                puts("");
                puts("Modes:");
                puts("  --sunkbd        -skb   Sun Type 4 and Type 5 keyboards");
		puts("  --lkkbd         -lk    DEC LK201 / LK401 keyboards");
		puts("  --vsxxx-aa      -vs    DEC VSXXX-AA / VSXXX-GA mouse and VSXXX-AB tablet");
                puts("  --spaceorb      -orb   SpaceOrb 360 / SpaceBall Avenger");
		puts("  --spaceball     -sbl   SpaceBall 2003 / 3003 / 4000 FLX");
                puts("  --magellan      -mag   Magellan / SpaceMouse");
                puts("  --warrior       -war   WingMan Warrior");
		puts("  --stinger       -stng  Gravis Stinger");
		puts("  --mousesystems  -msc   3-button Mouse Systems mice");
		puts("  --sunmouse      -sun   3-button Sun mice");
		puts("  --microsoft     -bare  2-button Microsoft mice");
		puts("  --mshack        -ms    3-button mice in Microsoft mode");
		puts("  --mouseman      -mman  3-button Logitech and Genius mice");
		puts("  --intellimouse  -ms3   Microsoft IntelliMouse");
		puts("  --mmwheel       -mmw   Logitech mice with 4-5 buttons or wheel");
		puts("  --iforce        -ifor  I-Force joysticks and wheels");
                puts("  --h3600ts       -ipaq  Ipaq h3600 touchscreen");
		puts("  --stowawaykbd   -ipaqkbd  Stowaway keyboard");
		puts("  --ps2serkbd     -ps2ser PS/2 via serial keyboard");
		puts("  --twiddler      -twid   Handykey Twiddler chording keyboard");
		puts("  --twiddler-joy  -twidjoy  Handykey Twiddler used as a joystick");
		puts("");
                return 1;
        }

        for (type = 0; input_types[type].speed; type++) {
                if (!strncasecmp(argv[1], input_types[type].name, 16) ||
			!strncasecmp(argv[1], input_types[type].name2, 16))
                        break;
        }

	if (!input_types[type].speed) {
		fprintf(stderr, "inputattach: invalid mode\n");
		return 1;
	}

	if ((fd = open(argv[2], O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0) {
		perror("inputattach");
		return 1;
	}

	setline(fd, input_types[type].flags, input_types[type].speed);

	if (input_types[type].flush)
		while (!readchar(fd, &c, 100));

	id = input_types[type].id;
	extra = input_types[type].extra;

	if (input_types[type].init && input_types[type].init(fd, &id, &extra)) {
		fprintf(stderr, "inputattach: device initialization failed\n");
		return 1;
	}

	ldisc = N_MOUSE;
	if(ioctl(fd, TIOCSETD, &ldisc)) {
		fprintf(stderr, "inputattach: can't set line discipline\n"); 
		return 1;
	}

	devt = SERIO_RS232 | input_types[type].type | (id << 8) | (extra << 16);

	if(ioctl(fd, SPIOCSTYPE, &devt)) {
		fprintf(stderr, "inputattach: can't set device type\n");
		return 1;
	}

	read(fd, NULL, 0);

	ldisc = 0;
	ioctl(fd, TIOCSETD, &ldisc);
	close(fd);

	return 0;
}
maintainer
#1 lore raw
Quoted 5 lines · Vojtech Pavlik

Hi!

I've written a driver for probably the most common touchscreen type - the serial Elo touchscreen.

Hi,

Looks very nice, unfortunately I don;t have a touchscreen to test it. One thing - now that kcalloc in the mainline I find myself using it more and more instead of kmalloc + memtest.

Signature · 1 line
Dmitry
#2 lore raw
In reply to Vojtech Pavlik
Quoted 4 lines · Vojtech Pavlik

Hi!

I've written a driver for probably the most common touchscreen type - the serial Elo touchscreen.

If we are serious about getting support for serial touchscreens into the kernel, I can certainly give a hand there.

I work for a company that develops software for restaurants, and we have a Linux port of our main application running in actual restaurants with a custom made Linux distribution for about 2 years now.

We had to support a number of touchscreens, and we do it in the application itself, reading the serial port and processing the data.

If this could go into the kernel, then our application needed only to read the input device, and handle events, no matter what touch screen was there. That would be a great improvement :)

Quoted 4 lines

The driver should handle all generations of serial Elos, as it handles Elo 10-byte, 6-byte, 4-byte and 3-byte protocols.

I do not have any touchscreen, so I can't test the driver myself.

I have one that uses the 10 byte protocol (I've never seen one ELOtouch that used one of the other protocols). I can give you some feedback as soon as I have some time to test it.

drivers/input/touchscreen/elo.c line 83

Quoted 11 lines

So if you have the time, please comment on the code of the patch, and if you have an Elo, please try the driver with it.

[...]

drivers/input/touchscreen/elo.c new file +7 -0
+		case 9:
+			if (elo->csum) {
+				input_regs(dev, regs);
+				input_report_abs(dev, ABS_X, (elo->data[4] << 8) | elo->data[3]);
+				input_report_abs(dev, ABS_Y, (elo->data[6] << 8) | elo->data[5]);
+				input_report_abs(dev, ABS_PRESSURE, (elo->data[8] << 8) | elo->data[7]);
+				input_report_key(dev, BTN_TOUCH, elo->data[8] || elo->data[7]);

This one is weird. In my code I have this:

Quoted 1 line
           button = ((buf[2] & 0x03) != 0);

So maybe, ELO touchscreens that don't have pressure sense output, only send "touch down / up" information on the 2 LSB's of the third byte(?)

Anyway, inputattach should have a command line option to set the baudrate manually, as some of these touchscreens have configurable baudrates, and some POS manufacturers set them to non-default values.

Also, I've already seen touchscreens where the POS manufacturer got the pin-out wrong (or something like that) so the touch reports the X coordinate where the Y should be, and vice-versa. I really don't know where this should be handled (driver, input layer, application?), but it must be handled somewhere for the applications to work.

Signature · 4 lines
Paulo Marques - www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)
#3 lore raw
Quoted 8 lines · Paulo Marques
Quoted 4 lines · Vojtech Pavlik

Hi!

I've written a driver for probably the most common touchscreen type - the serial Elo touchscreen.

If we are serious about getting support for serial touchscreens into the kernel, I can certainly give a hand there.

I want serious support for ALL touchscreens in Linux.

Quoted 10 lines

I work for a company that develops software for restaurants, and we have a Linux port of our main application running in actual restaurants with a custom made Linux distribution for about 2 years now.

We had to support a number of touchscreens, and we do it in the application itself, reading the serial port and processing the data.

If this could go into the kernel, then our application needed only to read the input device, and handle events, no matter what touch screen was there. That would be a great improvement :)

And I'm glad there is interest. :)

Quoted 4 lines

I have one that uses the 10 byte protocol (I've never seen one ELOtouch that used one of the other protocols). I can give you some feedback as soon as I have some time to test it.

Quoted 12 lines

drivers/input/touchscreen/elo.c line 83

Quoted 8 lines

[...]

drivers/input/touchscreen/elo.c new file +7 -0
+		case 9:
+			if (elo->csum) {
+				input_regs(dev, regs);
+				input_report_abs(dev, ABS_X, (elo->data[4] << 8) | elo->data[3]);
+				input_report_abs(dev, ABS_Y, (elo->data[6] << 8) | elo->data[5]);
+				input_report_abs(dev, ABS_PRESSURE, (elo->data[8] << 8) | elo->data[7]);
+				input_report_key(dev, BTN_TOUCH, elo->data[8] || elo->data[7]);

This one is weird. In my code I have this:

Quoted 1 line
           button = ((buf[2] & 0x03) != 0);

My documentation doesn't seem to say anything about the Status (buf[2]) byte. If a touch bit is reported there, then great, I'll change the driver to use that.

Right now the driver uses the Z value to tell if the screen is touched or not.

Quoted 2 lines

So maybe, ELO touchscreens that don't have pressure sense output, only send "touch down / up" information on the 2 LSB's of the third byte(?)

That's very likely.

Quoted 3 lines

Anyway, inputattach should have a command line option to set the baudrate manually, as some of these touchscreens have configurable baudrates, and some POS manufacturers set them to non-default values.

That's rather easy to do.

Quoted 5 lines

Also, I've already seen touchscreens where the POS manufacturer got the pin-out wrong (or something like that) so the touch reports the X coordinate where the Y should be, and vice-versa. I really don't know where this should be handled (driver, input layer, application?), but it must be handled somewhere for the applications to work.

I think the best place would be in the X event driver, if X is used, or the graphics toolkit, and worst case the application.

I don't believe the mirroring/flipping is kernel's job, since it tries to always pass the data with the least amount of transformation applied to achieve hardware abstraction.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#4 lore raw

On Wed, 2005-02-09 18:00:15 +0100, Vojtech Pavlik <[email protected]> wrote in message <[email protected]>:

Quoted 11 lines · Paulo Marques
Quoted 8 lines
Quoted 4 lines · Vojtech Pavlik

Hi!

I've written a driver for probably the most common touchscreen type - the serial Elo touchscreen.

If we are serious about getting support for serial touchscreens into the kernel, I can certainly give a hand there.

I want serious support for ALL touchscreens in Linux.

Maybe I'd write drivers for the T-Sharc and fujitsu controllers, too. These are in a lot of POS hardware, too, and sometimes they're a pain to use (esp. calibration).

Linux at the Point Of Sale is quite well running (I'm employed at a POS software company).

Quoted 1 line

And I'm glad there is interest. :)

If I find a minute, I'll possibly give it a test run. I've got actual hardware around.

Quoted 8 lines
Quoted 5 lines

Also, I've already seen touchscreens where the POS manufacturer got the pin-out wrong (or something like that) so the touch reports the X coordinate where the Y should be, and vice-versa. I really don't know where this should be handled (driver, input layer, application?), but it must be handled somewhere for the applications to work.

I think the best place would be in the X event driver, if X is used, or the graphics toolkit, and worst case the application.

First of all, we need a really properly working Linux event driver in XFree86/X.Org. I'm not sure if this is already the case.

Quoted 3 lines

I don't believe the mirroring/flipping is kernel's job, since it tries to always pass the data with the least amount of transformation applied to achieve hardware abstraction.

ACK. Should be handled by XFree86's driver.

Additionally, there are two other things that need to be addressed (and I'm willing to actually write code for this, but need input from other parties, too:)

- Touchscreen calibration
Basically all these touchscreens are capable of being calibrated. It's not done with just pushing the X/Y values the kernel receives into the Input API. These beasts may get physically mis-calibrated and eg. report things like (xmax - xmin) <= 20, so resolution would be really bad and kernel reported min/max values were only "theoretical" values, based on the protocol specs.

I think about a simple X11 program for this. Comments?

- POS keyboards
These are real beasties. Next to LEDs and keycaps, they can contain barcode scanners, magnetic card readers and displays. Right now, there's no good API to pass something as complex as "three-track magnetic stripe data" or a whole scanned EAN barcode. Also, some keyboards can be written to (change display contents, switch on/off scanners, ...).

This is usually "solved" with a little patch that allows userspace to write to the keyboard (/dev/psaux like), but this is a bad hack (just look at the patches floating around for this...).

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#5 lore raw
Quoted 5 lines · Jan-Benedict Glaw
Quoted 1 line

I want serious support for ALL touchscreens in Linux.

Maybe I'd write drivers for the T-Sharc and fujitsu controllers, too. These are in a lot of POS hardware, too, and sometimes they're a pain to use (esp. calibration).

Well, if you write them, send them my way. :)

Quoted 2 lines

If I find a minute, I'll possibly give it a test run. I've got actual hardware around.

Thanks!

Quoted 11 lines
Quoted 8 lines
Quoted 5 lines

Also, I've already seen touchscreens where the POS manufacturer got the pin-out wrong (or something like that) so the touch reports the X coordinate where the Y should be, and vice-versa. I really don't know where this should be handled (driver, input layer, application?), but it must be handled somewhere for the applications to work.

I think the best place would be in the X event driver, if X is used, or the graphics toolkit, and worst case the application.

First of all, we need a really properly working Linux event driver in XFree86/X.Org. I'm not sure if this is already the case.

There is 'evtouch'. It's probably not perfect, but a good start.

Quoted 19 lines
Quoted 3 lines

I don't believe the mirroring/flipping is kernel's job, since it tries to always pass the data with the least amount of transformation applied to achieve hardware abstraction.

ACK. Should be handled by XFree86's driver.

Additionally, there are two other things that need to be addressed (and I'm willing to actually write code for this, but need input from other parties, too:)

- Touchscreen calibration
Basically all these touchscreens are capable of being calibrated. It's not done with just pushing the X/Y values the kernel receives into the Input API. These beasts may get physically mis-calibrated and eg. report things like (xmax - xmin) <= 20, so resolution would be really bad and kernel reported min/max values were only "theoretical" values, based on the protocol specs.

Quoted 1 line

I think about a simple X11 program for this. Comments?

How would the program communicate with the devices?

Quoted 8 lines

- POS keyboards
These are real beasties. Next to LEDs and keycaps, they can contain barcode scanners, magnetic card readers and displays. Right now, there's no good API to pass something as complex as "three-track magnetic stripe data" or a whole scanned EAN barcode. Also, some keyboards can be written to (change display contents, switch on/off scanners, ...).

We probably don't want magnetic stripe data to go through the input event stream (although it is possible to do that), so a new interface would be most likely necessary.

Quoted 4 lines

This is usually "solved" with a little patch that allows userspace to write to the keyboard (/dev/psaux like), but this is a bad hack (just look at the patches floating around for this...).

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#6 lore raw
Quoted 3 lines · Vojtech Pavlik
Quoted 1 line · Jan-Benedict Glaw
Quoted 1 line

I want serious support for ALL touchscreens in Linux.

I'm glad to hear it. I was just pointing out the "serial" part, because, unlike USB and other interfaces, a serial port can not say "what" is attached to it, so we need the "inputattach" method to explain to the kernel what is there (and the irattach, pppd, etc.).

Quoted 5 lines
Quoted 3 lines

Maybe I'd write drivers for the T-Sharc and fujitsu controllers, too. These are in a lot of POS hardware, too, and sometimes they're a pain to use (esp. calibration).

Well, if you write them, send them my way. :)

I sometimes feel that we should have a "generic" touch screen driver from looking at the code for the different brands.

Almost all touch screen data goes something like this:

- every packet is fixed size, N bytes long

- the "header" bytes can be described by <data> AND <mask> ==
something expected

- the X,Y,pressure,touch data can be described as "starting at bit B,
length N, multiply by Z". An array of these tokens should be able to handle coordinates broken into several.

If this information could be passed as a module parameter, new touchscreens could be supported without any kernel modification.

We could parse a definition "string", like this:

"SIZE:10,SYNC:0:8:85,SYNC:8:8:54,X:24:8:1,X:32:8:256,Y:40:8:1,Y:48:8:256,T:16:2:1"

This string defines the touch driver for elotouch, 10 bytes packet (I didn't include the pressure reading, for simplification).

I currently have 6 different "drivers" that would all fit into this model. The same goes for all 3 elotouch protocols that you implemented.

Does this sound like a good idea?

Quoted 11 lines
Quoted 2 lines

If I find a minute, I'll possibly give it a test run. I've got actual hardware around.

Thanks!

[...]

Quoted 3 lines
Quoted 3 lines

I don't believe the mirroring/flipping is kernel's job, since it tries to always pass the data with the least amount of transformation applied to achieve hardware abstraction.

This is one argument that I don't quite understand. Doesn't hardware abstraction mean that the application should receive the "same" data regardless of the hardware.

I would say that the kernel would do a good job in abstracting hardware, if it always returned X,Y coordinates from [0..65535] (or something like that) in always the same direction, regardless of the actual hardware involved...

Quoted 1 line
Quoted 1 line

ACK. Should be handled by XFree86's driver.

Unfortunately, I don't use any X driver (The application runs over the framebuffer), and I don't think it is a good idea to force people to use it.

Quoted 4 lines
Quoted 4 lines

Additionally, there are two other things that need to be addressed (and I'm willing to actually write code for this, but need input from other parties, too:)

Quoted 9 lines
Quoted 9 lines

- Touchscreen calibration
Basically all these touchscreens are capable of being calibrated. It's not done with just pushing the X/Y values the kernel receives into the Input API. These beasts may get physically mis-calibrated and eg. report things like (xmax - xmin) <= 20, so resolution would be really bad and kernel reported min/max values were only "theoretical" values, based on the protocol specs. I think about a simple X11 program for this. Comments?

Touch screens doing this are severely brain-damaged. And yes, I've come across a few of them, but not lately.

I would say that a tool to recover the touch screen into a "usable" state, by talking directly to the serial port, and "calibrating" it to max possible / min possible values would be the best way to deal with this.

Modern touchscreens just send the A/D data to the PC, and let the real processor do the math (it can even do more complex calculations, like compensate for rotation, etc.). IMHO calibration should be handled by software.

Quoted 10 lines
Quoted 8 lines

- POS keyboards
These are real beasties. Next to LEDs and keycaps, they can contain barcode scanners, magnetic card readers and displays. Right now, there's no good API to pass something as complex as "three-track magnetic stripe data" or a whole scanned EAN barcode. Also, some keyboards can be written to (change display contents, switch on/off scanners, ...).

Quoted 3 lines

We probably don't want magnetic stripe data to go through the input event stream (although it is possible to do that), so a new interface would be most likely necessary.

It's even worse. Most keyboards don't separate the real keys from magnetic stripe reader events, and just simulate key presses for MSR data. They expect the software to be in a state where it is waiting for that data, and will process it accordingly.

What we've done in our application is to use the timings and sequence of key presses to distinguish between normal key presses and MSR data :P

Signature · 4 lines
Paulo Marques - www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)
#7 lore raw
Quoted 6 lines · Paulo Marques
Quoted 1 line
Quoted 1 line
Quoted 1 line

I want serious support for ALL touchscreens in Linux.

I'm glad to hear it. I was just pointing out the "serial" part, because, unlike USB and other interfaces, a serial port can not say "what" is attached to it, so we need the "inputattach" method to explain to the kernel what is there (and the irattach, pppd, etc.).

Touchscreens are one class of devices where the serial attachment is not dying.

Quoted 27 lines
Quoted 5 lines
Quoted 3 lines

Maybe I'd write drivers for the T-Sharc and fujitsu controllers, too. These are in a lot of POS hardware, too, and sometimes they're a pain to use (esp. calibration).

Well, if you write them, send them my way. :)

I sometimes feel that we should have a "generic" touch screen driver from looking at the code for the different brands.

Almost all touch screen data goes something like this:

- every packet is fixed size, N bytes long

- the "header" bytes can be described by <data> AND <mask> ==
something expected

- the X,Y,pressure,touch data can be described as "starting at bit B,
length N, multiply by Z". An array of these tokens should be able to handle coordinates broken into several.

If this information could be passed as a module parameter, new touchscreens could be supported without any kernel modification.

We could parse a definition "string", like this:

"SIZE:10,SYNC:0:8:85,SYNC:8:8:54,X:24:8:1,X:32:8:256,Y:40:8:1,Y:48:8:256,T:16:2:1"

Quoted 7 lines

This string defines the touch driver for elotouch, 10 bytes packet (I didn't include the pressure reading, for simplification).

I currently have 6 different "drivers" that would all fit into this model. The same goes for all 3 elotouch protocols that you implemented.

Does this sound like a good idea?

I don't think so. I don't think the saving of code is worth the obfuscation, after all, 6 drivers is still not so much.

Also, direct code implementation can implement better synchronization methods and faster resynchronization in case of lost bytes.

And then there are protocols like the Gunze one, which wouldn't be covered by this.

Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

I don't believe the mirroring/flipping is kernel's job, since it tries to always pass the data with the least amount of transformation applied to achieve hardware abstraction.

Quoted 8 lines

This is one argument that I don't quite understand. Doesn't hardware abstraction mean that the application should receive the "same" data regardless of the hardware.

I would say that the kernel would do a good job in abstracting hardware, if it always returned X,Y coordinates from [0..65535] (or something like that) in always the same direction, regardless of the actual hardware involved...

I can understand that, however, when the only difference is in the actual _mounting_ of the hardware ... I'm not so sure.

Quoted 4 lines
Quoted 1 line
Quoted 1 line

ACK. Should be handled by XFree86's driver.

Unfortunately, I don't use any X driver (The application runs over the framebuffer), and I don't think it is a good idea to force people to use it.

We could have a library that would do that and link applications against it. It could also handle things like tap-n-drag, etc, something we certainly don't want in the kernel.

Quoted 14 lines
Quoted 4 lines
Quoted 4 lines

Additionally, there are two other things that need to be addressed (and I'm willing to actually write code for this, but need input from other parties, too:)

Quoted 9 lines
Quoted 9 lines

- Touchscreen calibration
Basically all these touchscreens are capable of being calibrated. It's not done with just pushing the X/Y values the kernel receives into the Input API. These beasts may get physically mis-calibrated and eg. report things like (xmax - xmin) <= 20, so resolution would be really bad and kernel reported min/max values were only "theoretical" values, based on the protocol specs. I think about a simple X11 program for this. Comments?

Quoted 6 lines

Touch screens doing this are severely brain-damaged. And yes, I've come across a few of them, but not lately.

I would say that a tool to recover the touch screen into a "usable" state, by talking directly to the serial port, and "calibrating" it to max possible / min possible values would be the best way to deal with this.

I agree with that. It could possibly even be put into the inputattach init routine for the specific touchscreen.

Quoted 4 lines

Modern touchscreens just send the A/D data to the PC, and let the real processor do the math (it can even do more complex calculations, like compensate for rotation, etc.). IMHO calibration should be handled by software.

And this is something the kernel certainly won't do. Floating point math is possible in the kernel with some jumping through hoops, but avoiding it is usually the better option.

Quoted 8 lines
Quoted 3 lines

We probably don't want magnetic stripe data to go through the input event stream (although it is possible to do that), so a new interface would be most likely necessary.

It's even worse. Most keyboards don't separate the real keys from magnetic stripe reader events, and just simulate key presses for MSR data. They expect the software to be in a state where it is waiting for that data, and will process it accordingly.

In that case I'm not sure if the kernel should care at all what the data is.

Quoted 2 lines

What we've done in our application is to use the timings and sequence of key presses to distinguish between normal key presses and MSR data :P

Yes, embedded and single purpose systems are often full of hacks like this.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#8 lore raw
Quoted 4 lines · Vojtech Pavlik

On Wed, Feb 09, 2005 at 06:08:10PM +0000, Paulo Marques wrote:
[...]
Touchscreens are one class of devices where the serial attachment is not dying.

Very true.

Quoted 9 lines

[...]

Quoted 8 lines

We could parse a definition "string", like this:

"SIZE:10,SYNC:0:8:85,SYNC:8:8:54,X:24:8:1,X:32:8:256,Y:40:8:1,Y:48:8:256,T:16:2:1"

This string defines the touch driver for elotouch, 10 bytes packet (I didn't include the pressure reading, for simplification).

I currently have 6 different "drivers" that would all fit into this model. The same goes for all 3 elotouch protocols that you implemented.

Quoted 7 lines
Quoted 1 line

Does this sound like a good idea?

I don't think so. I don't think the saving of code is worth the obfuscation, after all, 6 drivers is still not so much.

Also, direct code implementation can implement better synchronization methods and faster resynchronization in case of lost bytes.

Agreed.

A touch screen driver is pretty small already. The only advantage would actually be to support new touchscreens without actually changing the kernel, but if we write the code for the touchscreens we already know, we will probably not see that many "new" touchscreens with weird protocols.

Quoted 2 lines

And then there are protocols like the Gunze one, which wouldn't be covered by this.

Actually the string for the gunze touchscreen would be something like (constructed from interpreting the gunze.c source code):

"SIZE:11, SYNC:0:5:80,SYNC:40:8:44,SYNC:80:8:13, X:12:4:1000,X:20:4:100,X:28:4:10,X:36:4:1, Y:52:4:3000,Y:60:4:300,Y:68:4:30,Y:76:4:3, T:2:1:1"

Yes, it doesn't look good ;)

And I agree that we would probably not be able to cover _all_ touchscreens.

Quoted 5 lines

[...]

We could have a library that would do that and link applications against it. It could also handle things like tap-n-drag, etc, something we certainly don't want in the kernel.

I really like this idea :)

A libtouch library that handled calibration (this includes mirroring and swapping the coordinates) and other goodies (like filtering out short "touch release" events while dragging, etc.) would be a good standard interface for all applications.

Being in user space would also mean that the library could do things like keeping a /etc/touch.conf file where it would read default calibration data, etc.

Quoted 6 lines

[...]

Quoted 1 line

I would say that a tool to recover the touch screen into a "usable" state, by talking directly to the serial port, and "calibrating" it to max possible / min possible values would be the best way to deal with this.

I agree with that. It could possibly even be put into the inputattach init routine for the specific touchscreen.

This certainly seems like a good place for it, yes.

Quoted 6 lines
Quoted 1 line

Modern touchscreens just send the A/D data to the PC, and let the real processor do the math (it can even do more complex calculations, like compensate for rotation, etc.). IMHO calibration should be handled by software.

And this is something the kernel certainly won't do. Floating point math is possible in the kernel with some jumping through hoops, but avoiding it is usually the better option.

We don't necessarily need floating point (even with 32 bits we have plenty of space for fixed point arithmetic), but I agree that this would be better handled in a library.

Signature · 4 lines
Paulo Marques - www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)
#9 lore raw

On Wed, 2005-02-09 19:54:04 +0000, Paulo Marques <[email protected]> wrote in message <[email protected]>:

Quoted 6 lines
Quoted 3 lines

We could have a library that would do that and link applications against it. It could also handle things like tap-n-drag, etc, something we certainly don't want in the kernel.

I really like this idea :)

Quoted 8 lines

A libtouch library that handled calibration (this includes mirroring and swapping the coordinates) and other goodies (like filtering out short "touch release" events while dragging, etc.) would be a good standard interface for all applications.

Being in user space would also mean that the library could do things like keeping a /etc/touch.conf file where it would read default calibration data, etc.

...and for X11. Maybe we'd start talking about an API for this lib? At least, my employer is interested I guess. (But this is OT wrt. the Linux kernel, could you contact me at [email protected]?)

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#10 lore raw
In reply to Vojtech Pavlik

On Wed, 2005-02-09 20:18:17 +0100, Vojtech Pavlik <[email protected]> wrote in message <[email protected]>:

Quoted 6 lines
Quoted 3 lines

I would say that a tool to recover the touch screen into a "usable" state, by talking directly to the serial port, and "calibrating" it to max possible / min possible values would be the best way to deal with this.

I agree with that. It could possibly even be put into the inputattach init routine for the specific touchscreen.

At least, inputattach should only recalibrate if asked for that. POS *users* are not very computer-skilled (typically, at least over here) and even automated recalibration (ie. the cashier software forces it because it detects that the user presses besides the actual images) are kind of stress to them...

Quoted 7 lines
Quoted 4 lines

It's even worse. Most keyboards don't separate the real keys from magnetic stripe reader events, and just simulate key presses for MSR data. They expect the software to be in a state where it is waiting for that data, and will process it accordingly.

In that case I'm not sure if the kernel should care at all what the data is.

The problematic part is that this needs to be done at a quite low level, since POS keyboards may send quite a lot more than make/break codes in "proper" order...

Quoted 5 lines
Quoted 2 lines

What we've done in our application is to use the timings and sequence of key presses to distinguish between normal key presses and MSR data :P

Yes, embedded and single purpose systems are often full of hacks like this.

...and especially this problem can be better solved by reprogramming the MCR readers :-)

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#11 lore raw
Quoted 11 lines · Jan-Benedict Glaw
Quoted 7 lines
Quoted 4 lines

It's even worse. Most keyboards don't separate the real keys from magnetic stripe reader events, and just simulate key presses for MSR data. They expect the software to be in a state where it is waiting for that data, and will process it accordingly.

In that case I'm not sure if the kernel should care at all what the data is.

The problematic part is that this needs to be done at a quite low level, since POS keyboards may send quite a lot more than make/break codes in "proper" order...

I'll need some specific examples of protocols the keyboard use to judge how to tackle that.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

What we've done in our application is to use the timings and sequence of key presses to distinguish between normal key presses and MSR data :P

Yes, embedded and single purpose systems are often full of hacks like this.

...and especially this problem can be better solved by reprogramming the MCR readers :-)

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#12 lore raw

On Wed, 2005-02-09 21:10:32 +0100, Vojtech Pavlik <[email protected]> wrote in message <[email protected]>:

Quoted 7 lines · Jan-Benedict Glaw
Quoted 3 lines

The problematic part is that this needs to be done at a quite low level, since POS keyboards may send quite a lot more than make/break codes in "proper" order...

I'll need some specific examples of protocols the keyboard use to judge how to tackle that.

I'll try to get some showkeys dumps for you tomorrow. This will be sent to you privately since it may contain real card data...

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#13 lore raw
In reply to Paulo Marques

On Wed, 2005-02-09 18:08:10 +0000, Paulo Marques <[email protected]> wrote in message <[email protected]>:

Quoted 14 lines
Quoted 4 lines
Quoted 4 lines

Additionally, there are two other things that need to be addressed (and I'm willing to actually write code for this, but need input from other parties, too:)

Quoted 9 lines
Quoted 9 lines

- Touchscreen calibration
Basically all these touchscreens are capable of being calibrated. It's not done with just pushing the X/Y values the kernel receives into the Input API. These beasts may get physically mis-calibrated and eg. report things like (xmax - xmin) <= 20, so resolution would be really bad and kernel reported min/max values were only "theoretical" values, based on the protocol specs. I think about a simple X11 program for this. Comments?

Quoted 2 lines

Touch screens doing this are severely brain-damaged. And yes, I've come across a few of them, but not lately.

That's IMHO not brain-damaged, but pure physics: just consider scratches or dust (or other substances) applied to the touch foil. This happens all the time, so the touch screen gets out of calibration. This won't happen on a screen used only twice a day. But think about a touch screen that's tortured all the day with pencils, finger rings, dirty fingers,
...

Quoted 3 lines

I would say that a tool to recover the touch screen into a "usable" state, by talking directly to the serial port, and "calibrating" it to max possible / min possible values would be the best way to deal with this.

Min/Max values (as of protocol theory) is possibly not the very best you can do with the hardware. I more thing about submitting these (after physical calibration) to the kernel driver to supply them to it's users.

Quoted 4 lines

Modern touchscreens just send the A/D data to the PC, and let the real processor do the math (it can even do more complex calculations, like compensate for rotation, etc.). IMHO calibration should be handled by software.

Is this done eg. by Elo, Mutouch, Fujitsu, T-Sharc (to only name the most common)? I don't think so...

Quoted 10 lines
Quoted 10 lines
Quoted 8 lines

- POS keyboards
These are real beasties. Next to LEDs and keycaps, they can contain barcode scanners, magnetic card readers and displays. Right now, there's no good API to pass something as complex as "three-track magnetic stripe data" or a whole scanned EAN barcode. Also, some keyboards can be written to (change display contents, switch on/off scanners, ...).

Quoted 8 lines
Quoted 3 lines

We probably don't want magnetic stripe data to go through the input event stream (although it is possible to do that), so a new interface would be most likely necessary.

It's even worse. Most keyboards don't separate the real keys from magnetic stripe reader events, and just simulate key presses for MSR data. They expect the software to be in a state where it is waiting for that data, and will process it accordingly.

This only happens if you don't configurethe MSR properly :-) Most of them can be configured to send quite complex (as in: structured) init sequences that cannot be generated by a keyboard (ie multiple break codes without make codes and the like).

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#14 lore raw
Quoted 4 lines · Jan-Benedict Glaw

On Wed, 2005-02-09 18:08:10 +0000, Paulo Marques <[email protected]> wrote in message <[email protected]>:

[...]

Quoted 8 lines
Quoted 1 line

Touch screens doing this are severely brain-damaged. And yes, I've come across a few of them, but not lately.

That's IMHO not brain-damaged, but pure physics: just consider scratches or dust (or other substances) applied to the touch foil. This happens all the time, so the touch screen gets out of calibration. This won't happen on a screen used only twice a day. But think about a touch screen that's tortured all the day with pencils, finger rings, dirty fingers,

The brain-damaged part wasn't the calibration. It was the calibration being done in the touchscreen itself, instead of letting the PC handle it for them. We will always need calibration, of course.

Quoted 7 lines

...

Quoted 1 line

I would say that a tool to recover the touch screen into a "usable" state, by talking directly to the serial port, and "calibrating" it to max possible / min possible values would be the best way to deal with this.

Min/Max values (as of protocol theory) is possibly not the very best you can do with the hardware. I more thing about submitting these (after physical calibration) to the kernel driver to supply them to it's users.

You're missing my point completely... :(

What I was suggesting was that we don't use physical calibration *at all*.

We let the touch screen send the widest range it can muster, so that we don't have quantization errors. We then calibrate in software as for any other touch screen, using the coordinates sent as "raw data".

Quoted 4 lines
Quoted 1 line

Modern touchscreens just send the A/D data to the PC, and let the real processor do the math (it can even do more complex calculations, like compensate for rotation, etc.). IMHO calibration should be handled by software.

Is this done eg. by Elo, Mutouch, Fujitsu, T-Sharc (to only name the most common)? I don't think so...

If you don't try to configure the "physical calibration" of a Elo, MuTouch, etc, they send coordinates in a nice 0..2^N-1 format. That is the best approach IMHO.

Quoted 5 lines

[...]
This only happens if you don't configurethe MSR properly :-) Most of them can be configured to send quite complex (as in: structured) init sequences that cannot be generated by a keyboard (ie multiple break codes without make codes and the like).

Even if they can not be generated by a keyboard, if you don't handle them in special way, you'll get a lot of rubbish. We do handle the special sequences when available, but there still barcode scanners that don't generate a nice sequence.

There are even barcode scanners that generate things like <press Alt>+<numeric X>+<numeric Y>+<numeric Z>+<release Alt> without even bothering to release the numeric keys, to generate ASCII code XYZ :P

Signature · 4 lines
Paulo Marques - www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)
#15 lore raw

On Wed, 2005-02-09 20:51:43 +0000, Paulo Marques <[email protected]> wrote in message <[email protected]>:

Quoted 9 lines
Quoted 7 lines · Jan-Benedict Glaw

On Wed, 2005-02-09 18:08:10 +0000, Paulo Marques <[email protected]> wrote in message <[email protected]>:
That's IMHO not brain-damaged, but pure physics: just consider scratches or dust (or other substances) applied to the touch foil. This happens all the time, so the touch screen gets out of calibration. This won't happen on a screen used only twice a day. But think about a touch screen that's tortured all the day with pencils, finger rings, dirty fingers,

Quoted 3 lines

The brain-damaged part wasn't the calibration. It was the calibration being done in the touchscreen itself, instead of letting the PC handle it for them. We will always need calibration, of course.

Again, you cannot map 0..\inf Ohm or 0..\inf nF to a given set [0..0xffff] of coordinates. The physical characteristics of touchscreens *can* change, so you need to recalibrate the A/D converter itself.

Quoted 7 lines
Quoted 3 lines

Min/Max values (as of protocol theory) is possibly not the very best you can do with the hardware. I more thing about submitting these (after physical calibration) to the kernel driver to supply them to it's users.

You're missing my point completely... :(

What I was suggesting was that we don't use physical calibration *at all*.

But there *needs* to be a way to do that. I don't want to place this functionality into the kernel, but we need to have a program for that at some time. Current solutions are bad hacks and don't actually work reliably.

Quoted 3 lines

We let the touch screen send the widest range it can muster, so that we don't have quantization errors. We then calibrate in software as for any other touch screen, using the coordinates sent as "raw data".

That cannot be done. Just hit a resistor-based touchscreen once with a hammer. You'll probably see that you need a physical recalibration then... Or flood it with water-solved citronic acid and let is on the screen for some days. That's funny, but it's real life...

Quoted 11 lines
Quoted 7 lines
Quoted 4 lines

Modern touchscreens just send the A/D data to the PC, and let the real processor do the math (it can even do more complex calculations, like compensate for rotation, etc.). IMHO calibration should be handled by software.

Is this done eg. by Elo, Mutouch, Fujitsu, T-Sharc (to only name the most common)? I don't think so...

If you don't try to configure the "physical calibration" of a Elo, MuTouch, etc, they send coordinates in a nice 0..2^N-1 format. That is the best approach IMHO.

It is -- as long as the physical characteristics don't change all that much. Unfortunately (at least for real-life POS usage) this happens frequently.

Quoted 6 lines
Quoted 5 lines

[...]
This only happens if you don't configurethe MSR properly :-) Most of them can be configured to send quite complex (as in: structured) init sequences that cannot be generated by a keyboard (ie multiple break codes without make codes and the like).

Quoted 8 lines

Even if they can not be generated by a keyboard, if you don't handle them in special way, you'll get a lot of rubbish. We do handle the special sequences when available, but there still barcode scanners that don't generate a nice sequence.

There are even barcode scanners that generate things like <press Alt>+<numeric X>+<numeric Y>+<numeric Z>+<release Alt> without even bothering to release the numeric keys, to generate ASCII code XYZ :P

Which then either needs to be parsed by userspace (which needs access to raw make/break codes and be able to send data to the kbd) or we write keyboard-specific Input API drivers for them.

However, a userspace library for that (if raw access to the keyboard is given) could do the same job.

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#16 lore raw
Quoted 11 lines · Jan-Benedict Glaw

On Wed, 2005-02-09 20:51:43 +0000, Paulo Marques <[email protected]> wrote in message <[email protected]>:

Quoted 9 lines
Quoted 7 lines · Jan-Benedict Glaw

On Wed, 2005-02-09 18:08:10 +0000, Paulo Marques <[email protected]> wrote in message <[email protected]>:
That's IMHO not brain-damaged, but pure physics: just consider scratches or dust (or other substances) applied to the touch foil. This happens all the time, so the touch screen gets out of calibration. This won't happen on a screen used only twice a day. But think about a touch screen that's tortured all the day with pencils, finger rings, dirty fingers,

Quoted 7 lines
Quoted 3 lines

The brain-damaged part wasn't the calibration. It was the calibration being done in the touchscreen itself, instead of letting the PC handle it for them. We will always need calibration, of course.

Again, you cannot map 0..\inf Ohm or 0..\inf nF to a given set [0..0xffff] of coordinates. The physical characteristics of touchscreens *can* change, so you need to recalibrate the A/D converter itself.

Both 4-wire and 5-wire resistive touchscreens work as voltage dividers.

Thus the chip doesn't have to care about the total resistance, it just applies voltage on two wires and the voltage on the other two corresponds proportionally to the position. That's one axis measurement. For the other axis, the role of the wires is simply swapped.

For capacitive touch sensors it's very much different, and the controller usually is matched to the sensor, since the sensor usually has several electrodes, so the controller 'knows' about the sensor because they were manufactured together.

Regarding surface wave sensors, I'm not completely sure about the need of calibration to get the range there. I'd assume that since they measure wave reflections from reflector fins, and they know the number of the fins (== number of reflections), that they'll be able to stretch the range properly as well.

Quoted 8 lines
Quoted 3 lines

We let the touch screen send the widest range it can muster, so that we don't have quantization errors. We then calibrate in software as for any other touch screen, using the coordinates sent as "raw data".

That cannot be done. Just hit a resistor-based touchscreen once with a hammer. You'll probably see that you need a physical recalibration then... Or flood it with water-solved citronic acid and let is on the screen for some days. That's funny, but it's real life...

You'll need a new touchscreen most likely. The hammer will break the glass if you hit it properly, and if the citric acid gets between the resistive layers, you get nonlinear distortion of the resistivity and that cannot be calibrated for.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#17 lore raw

On Wed, 2005-02-09 22:53:35 +0100, Vojtech Pavlik <[email protected]> wrote in message <[email protected]>:

Quoted 9 lines
Quoted 4 lines

That cannot be done. Just hit a resistor-based touchscreen once with a hammer. You'll probably see that you need a physical recalibration then... Or flood it with water-solved citronic acid and let is on the screen for some days. That's funny, but it's real life...

You'll need a new touchscreen most likely. The hammer will break the glass if you hit it properly, and if the citric acid gets between the resistive layers, you get nonlinear distortion of the resistivity and that cannot be calibrated for.

If they were private customers, sure, they'd just buy a new touchscreen. But in reality, as long as it somewhat "works", it'll be used as long as possible.

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#18 lore raw
Quoted 12 lines · Jan-Benedict Glaw

On Wed, 2005-02-09 22:53:35 +0100, Vojtech Pavlik <[email protected]> wrote in message <[email protected]>:

Quoted 9 lines
Quoted 4 lines

That cannot be done. Just hit a resistor-based touchscreen once with a hammer. You'll probably see that you need a physical recalibration then... Or flood it with water-solved citronic acid and let is on the screen for some days. That's funny, but it's real life...

You'll need a new touchscreen most likely. The hammer will break the glass if you hit it properly, and if the citric acid gets between the resistive layers, you get nonlinear distortion of the resistivity and that cannot be calibrated for.

Actually, if this is done in a library, we might compensate for non-linear distortion, by making a "high resolution" calibration where the user has to press a grid of 4x4 points (or something like that) instead of just a few of points. The grid would allow non-linear calibration.

I'm not suggesting that we can use a touch screen that has citric acid moving around between the layers, though :)

Quoted 3 lines

If they were private customers, sure, they'd just buy a new touchscreen. But in reality, as long as it somewhat "works", it'll be used as long as possible.

We are seriously diverging now....

Let me try to put things into perspective:

---------------

 |               |                                        --------
 |  Touch        |          -----------                  |        |
 |  Screen       |---------|    TS     |   serial port   |   PC   |
 |               |       __|controller |-----------------|        |
 |               |      /  |           |                 |        |
  ---------------       |   -----------                   --------
       \_______________/
Quoted 7 lines · In a previous post you

Basically all these touchscreens are capable of being calibrated. It's not done with just pushing the X/Y values the kernel receives into the Input API. These beasts may get physically mis-calibrated and eg. report things like (xmax - xmin) <= 20, so resolution would be really bad and kernel reported min/max values were only "theoretical" values, based on the protocol specs.

To get raw values that are (xmax-xmin)<=20, the TS controller must be "trying" to do some calibration itself.

That's the brain-damaged part.

The TS controller should not be doing any calibration at all, and send the widest range it can through the serial port to the PC.

On the PC we must have a library that is capable of scaling / rotating those values so that it converts them into "screen absolute" coordinates. I call these screen absolute because they shouldn't depend on the actual resolution.

So there is no doubt that calibration must be done. We are past that. I too work with touch screens in restaurants for more than 10 years now, so I surely know what an agrssive environment is, and what damage a touchscreen might be exposed to.

So, if the inputattach program initializes the TS controller to make it send the widest range (1:1 calibration) it can deliver, we can do all the calibration on the PC and not depend on the TS being able to do the calibration itself.

Actually a calibration that can do scaling and rotation, can automatically compensate for mirroring and/or switched X/Y axes. We probably need the user to press 4 points for that, though (3 points are enough, but just barely enough).

Signature · 4 lines
Paulo Marques - www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)
#19 lore raw

On Thu, 2005-02-10 13:06:46 +0000, Paulo Marques <[email protected]> wrote in message <[email protected]>:

Quoted 23 lines

We are seriously diverging now....

Let me try to put things into perspective:

---------------

 |               |                                        --------
 |  Touch        |          -----------                  |        |
 |  Screen       |---------|    TS     |   serial port   |   PC   |
 |               |       __|controller |-----------------|        |
 |               |      /  |           |                 |        |
  ---------------       |   -----------                   --------
       \_______________/
Quoted 7 lines · In a previous post you

Basically all these touchscreens are capable of being calibrated. It's not done with just pushing the X/Y values the kernel receives into the Input API. These beasts may get physically mis-calibrated and eg. report things like (xmax - xmin) <= 20, so resolution would be really bad and kernel reported min/max values were only "theoretical" values, based on the protocol specs.

Quoted 2 lines

To get raw values that are (xmax-xmin)<=20, the TS controller must be "trying" to do some calibration itself.

All touchscreens get calibrated once during their production AFAIK. This should result at least in a "useable" resolution. ...but have a tight look at today's touches: their [xy]{min,max} values don't cover all the theoretical range of values that could be sent with the protocol in use. Just taking an example, one screen here (it has never ever been physically recalibrated except right after production) used values (for X as well as for Y) in the range of about [350..3800]. The protocol does allow a lot more...

Quoted 1 line

That's the brain-damaged part.

It's not :) The foil layers aren't all that equal after production. They're (from the protocol point of view) generalized by calibrating them once (during production). However, if the screen gets injured, this must either be re-done, or the screen may need to be replaced. However, replacing parts in the field is expensive and service staff tries to not do that, but instead a recalibration is tried first. IFF the touchscreen is then found to be *really* dead, it's replaced.

Quoted 2 lines

The TS controller should not be doing any calibration at all, and send the widest range it can through the serial port to the PC.

But it needs to know the exact range of possible resistance/capacity to be able to do that. This is where the trouble starts that I'm talking about. Of course you can *assume* that capacity will be in a (well-known) range (you know the range because you can just test a production example), but this range is a bit different for each touchscreen produced, let alone the fact that the foils may get scratches or other injuries. In a bad case, you get a near-short-circuit so that your (new) range of values is near-zero. Recalibrating the A/D converter may revive this almost-dead screen.

Quoted 9 lines

On the PC we must have a library that is capable of scaling / rotating those values so that it converts them into "screen absolute" coordinates. I call these screen absolute because they shouldn't depend on the actual resolution.

So there is no doubt that calibration must be done. We are past that. I too work with touch screens in restaurants for more than 10 years now, so I surely know what an agrssive environment is, and what damage a touchscreen might be exposed to.

Right, but there are two kinds of calibration:

(1) Mapping the raw capacity/resistor values (that only the TS controller is aware of) to something the HID API can output. (This, too, includes that the kernel dictates the range of values that can be reached).
(2) Mapping the range of reachable HID coordinates to actual on-screen pixels. (This accounts for a person't fat and/or un-even fingers...)

"Calibration" in X11 with all it's drivers is done at the (2) level. You first have to figure out the range of generated values and then place these as [xy]{min,max} values.

However, the hardware-internal mapping (1) isn't covered anywhere right now. This usually isn't much of a problem during real use, but it *is* a problem if the hardware ever gets damaged (or the controller's flash breaks). Ever tried to use a serial sniffer on vendor's original MS Windows drivers? They almost always update the controller's internal mapping, too.

Quoted 4 lines

So, if the inputattach program initializes the TS controller to make it send the widest range (1:1 calibration) it can deliver, we can do all the calibration on the PC and not depend on the TS being able to do the calibration itself.

This is nice, but even cannot be done with all TS controllers. The very old ones actually just hand over the pure A/D values as a 10bit integer. For sure, you won't ever see a touchscreen that covers the whole scale:)

Quoted 4 lines

Actually a calibration that can do scaling and rotation, can automatically compensate for mirroring and/or switched X/Y axes. We probably need the user to press 4 points for that, though (3 points are enough, but just barely enough).

ACK. We'd do a lib for that and have a X11 driver to make use of it.

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#20 lore raw
Quoted 6 lines · Jan-Benedict Glaw

On Thu, 2005-02-10 13:06:46 +0000, Paulo Marques <[email protected]> wrote in message <[email protected]>:
[...]

Quoted 1 line

To get raw values that are (xmax-xmin)<=20, the TS controller must be "trying" to do some calibration itself.

Quoted 8 lines

All touchscreens get calibrated once during their production AFAIK. This should result at least in a "useable" resolution. ...but have a tight look at today's touches: their [xy]{min,max} values don't cover all the theoretical range of values that could be sent with the protocol in use. Just taking an example, one screen here (it has never ever been physically recalibrated except right after production) used values (for X as well as for Y) in the range of about [350..3800]. The protocol does allow a lot more...

This happens because the touch area is in fact a little larger than the screen (and there are probably some protection resistors in series with the touch) and you have 12-bit A/D that should give values [0..4095]. You still have more than enough range to calibrate in software.

The protocol has nothing to do with this. It is the number of bits in the A/D converter that matter. Usually you will have 2 bytes for each coordinate but only N bits will actually contain data, with N being the A/D resolution.

Quoted 10 lines
Quoted 1 line

That's the brain-damaged part.

It's not :) The foil layers aren't all that equal after production. They're (from the protocol point of view) generalized by calibrating them once (during production). However, if the screen gets injured, this must either be re-done, or the screen may need to be replaced. However, replacing parts in the field is expensive and service staff tries to not do that, but instead a recalibration is tried first. IFF the touchscreen is then found to be *really* dead, it's replaced.

So you're seriously saying that a perfectly good touchscreen, that returned values in the range [350..3800] after being injured might give values in a range (xmax-xmin)<=20 ??? That's a pretty nasty injury...

More to the point, usually when you send calibration data into the TS controller, it doesn't change anything at the analog level, it only makes the controller do some math on the A/D data before sending it to the PC. That doesn't help us at all.

Quoted 12 lines
Quoted 1 line

The TS controller should not be doing any calibration at all, and send the widest range it can through the serial port to the PC.

But it needs to know the exact range of possible resistance/capacity to be able to do that. This is where the trouble starts that I'm talking about. Of course you can *assume* that capacity will be in a (well-known) range (you know the range because you can just test a production example), but this range is a bit different for each touchscreen produced, let alone the fact that the foils may get scratches or other injuries. In a bad case, you get a near-short-circuit so that your (new) range of values is near-zero. Recalibrating the A/D converter may revive this almost-dead screen.

The way a resistive touchscreen works, the controller doesn't need to know at all the value of the total resistance. A capacitive TS might need some calibration, but nowhere near to the amount that makes a 12 bit A/D return a 4/5 bit range.

In more than 10 years of touch screen usage, I've never seen a case like you describe, so it's pretty hard for me to believe that:

a) you can get a resistive touch screen to give values (xmin-xmax)<=20 just by injuring it, but in a way that it can be revived

b) you can revive it by just changing the calibration parameters on the TS controller

I believe you can make a touch screen controller return values in a very short range if you try to use its internal calibration and mess up the values really badly. In this case, recalibrating will almost certainly make it work again.

Quoted 6 lines

[...]
Right, but there are two kinds of calibration:

(1) Mapping the raw capacity/resistor values (that only the TS controller is aware of) to something the HID API can output. (This, too, includes that the kernel dictates the range of values that can be reached).

I would really like to see a datasheet of a TS controller that actually does this, before we start working on a solution for it.

By the way, this has nothing to do with the kernel. The input API can deliver at least 16 bit resolution to user space, so there is no limitation on the software side. It is the A/D resolution that matters.

Quoted 5 lines

[...]
However, the hardware-internal mapping (1) isn't covered anywhere right now. This usually isn't much of a problem during real use, but it *is* a problem if the hardware ever gets damaged (or the controller's flash breaks).

Why would a flash break if you never write to it? I would expect the TS layers to be damaged before any electronic part gets broken...

Quoted 3 lines

Ever tried to use a serial sniffer on vendor's original MS Windows drivers? They almost always update the controller's internal mapping, too.

That is because they were done by the same brain-damaged people that didn't yet realize that a PC can do the couple of multiplications / divisions necessary in a few nanoseconds and still believe that the TS controller is "alleviating" the burden of the PC by doing that _complex_ math itself :P

Quoted 5 lines

[...]

Quoted 1 line

Actually a calibration that can do scaling and rotation, can automatically compensate for mirroring and/or switched X/Y axes. We probably need the user to press 4 points for that, though (3 points are enough, but just barely enough).

ACK. We'd do a lib for that and have a X11 driver to make use of it.

Ok, lets start working on it then :)

Signature · 4 lines
Paulo Marques - www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)
#21 lore raw

On Thu, 2005-02-10 15:35:28 +0000, Paulo Marques <[email protected]> wrote in message <[email protected]>:

Quoted 5 lines

Jan-Benedict Glaw wrote:

So you're seriously saying that a perfectly good touchscreen, that returned values in the range [350..3800] after being injured might give values in a range (xmax-xmin)<=20 ??? That's a pretty nasty injury...

Right. This is what I'm saying. And recalibration of the TS controller can (in _most_ cases) fix that.

Quoted 2 lines

a) you can get a resistive touch screen to give values (xmin-xmax)<=20 just by injuring it, but in a way that it can be revived

With some digging, maybe I can even find such a beast somewhere around here (working for a software company, I don't my hands on large quantities of broken hardware...).

Quoted 7 lines

b) you can revive it by just changing the calibration parameters on the TS controller

I believe you can make a touch screen controller return values in a very short range if you try to use its internal calibration and mess up the values really badly. In this case, recalibrating will almost certainly make it work again.

:-) That's just messing up it's "proper" calibration and restoring working parameters.

Quoted 9 lines
Quoted 6 lines

[...]
Right, but there are two kinds of calibration:

(1) Mapping the raw capacity/resistor values (that only the TS controller is aware of) to something the HID API can output. (This, too, includes that the kernel dictates the range of values that can be reached).

I would really like to see a datasheet of a TS controller that actually does this, before we start working on a solution for it.

One of {elo,mu}touch does this. Unfortunately, the commands aren't documented in the publically available sheets you can download from their site. Using a serial sniffer, you can easily dismantle the protocol to face the fact: these controller are a lot more clever than the sheets will tell you :-)

Quoted 2 lines

Why would a flash break if you never write to it? I would expect the TS layers to be damaged before any electronic part gets broken...

That's simple: some plastic/rubber shoes on equal ground, you can easily load yourself with some 10000V. Touch it once, maybe it survives the smoke. And possibly, the controller will loose it's flash contents... Decalibrating by electrostatic discharge is even something that our customers are able to _mention_ at the phone ("My finger hurt, it felt like something bite me, the muscles and nerves hurt in my arm, the computer crashed and upon reboot, I couldn't press the correct pictograms...")

Quoted 9 lines
Quoted 3 lines

Ever tried to use a serial sniffer on vendor's original MS Windows drivers? They almost always update the controller's internal mapping, too.

That is because they were done by the same brain-damaged people that didn't yet realize that a PC can do the couple of multiplications / divisions necessary in a few nanoseconds and still believe that the TS controller is "alleviating" the burden of the PC by doing that _complex_ math itself :P

Yeah, right you are.

Quoted 9 lines
Quoted 7 lines

[...]

Quoted 4 lines

Actually a calibration that can do scaling and rotation, can automatically compensate for mirroring and/or switched X/Y axes. We probably need the user to press 4 points for that, though (3 points are enough, but just barely enough).

ACK. We'd do a lib for that and have a X11 driver to make use of it.

Ok, lets start working on it then :)

Sure. (I'll write you off-list tomorrow.)

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#22 lore raw
In reply to Paulo Marques
Quoted 3 lines · Paulo Marques

By the way, this has nothing to do with the kernel. The input API can deliver at least 16 bit resolution to user space, so there is no limitation on the software side. It is the A/D resolution that matters.

Make that 32-bit.

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Actually a calibration that can do scaling and rotation, can automatically compensate for mirroring and/or switched X/Y axes. We probably need the user to press 4 points for that, though (3 points are enough, but just barely enough).

ACK. We'd do a lib for that and have a X11 driver to make use of it.

Remember that the X driver will have to either link statically or the lib will have to be an X module. X drivers are not allowed to use OS libs.

Quoted 1 line

Ok, lets start working on it then :)

Keep that enthusiasm! ;)

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR