[Miscellaneous Android Development] YetAnotherForumUser:
Inexplicable touch results, probably NOT caused by touch panel or driver...

I looked a bit deeper into this phenomenon and found something surprising. Have a look at the attached image, a photo of the screen with one of these strange touch glitches. Compare this to the output from the touch panel driver when this experiment was done. I bolded the X coordinates to make clear what I want to point out

68707-348000: EV_ABS ABS_X [B]00001574[/B]
68707-348000: EV_ABS ABS_Y 00000cfe
68707-348000: EV_ABS ABS_PRESSURE 00000017
68707-348000: EV_KEY BTN_TOUCH DOWN
68707-348000: EV_ABS ABS_MT_POSITION_X [B]00001574[/B]
68707-348000: EV_ABS ABS_MT_POSITION_Y 00000cfe
68707-348000: EV_ABS ABS_MT_PRESSURE 00000017
68707-348000: EV_ABS ABS_MT_TOUCH_MAJOR 00000017
68707-348000: EV_SYN SYN_MT_REPORT 00000000
68707-348000: EV_SYN SYN_REPORT 00000000
68707-383000: EV_ABS ABS_X [B]00001573[/B]
68707-383000: EV_ABS ABS_PRESSURE 00000018
68707-383000: EV_ABS ABS_MT_POSITION_X [B]00001573[/B]
68707-383000: EV_ABS ABS_MT_POSITION_Y 00000cfe
68707-383000: EV_ABS ABS_MT_PRESSURE 00000018
68707-383000: EV_ABS ABS_MT_TOUCH_MAJOR 00000018
68707-383000: EV_SYN SYN_MT_REPORT 00000000
68707-383000: EV_SYN SYN_REPORT 00000000
68707-387000: EV_ABS ABS_MT_POSITION_X [B]00001573[/B]
68707-387000: EV_ABS ABS_MT_POSITION_Y 00000cfe
68707-387000: EV_ABS ABS_MT_PRESSURE 00000018
68707-387000: EV_ABS ABS_MT_TOUCH_MAJOR 00000018
68707-387000: EV_SYN SYN_MT_REPORT 00000000
68707-387000: EV_SYN SYN_REPORT 00000000
68707-396000: EV_ABS ABS_X [B]000015f4[/B]
68707-396000: EV_ABS ABS_PRESSURE 00000010
68707-396000: EV_ABS ABS_MT_POSITION_X [B]000015f4[/B]
68707-396000: EV_ABS ABS_MT_POSITION_Y 00000cfe
68707-396000: EV_ABS ABS_MT_PRESSURE 00000010
68707-396000: EV_ABS ABS_MT_TOUCH_MAJOR 00000010
68707-396000: EV_SYN SYN_MT_REPORT 00000000
68707-396000: EV_SYN SYN_REPORT 00000000
68707-408000: EV_ABS ABS_PRESSURE 00000000
68707-409000: EV_KEY BTN_TOUCH UP
68707-409000: EV_ABS ABS_MT_POSITION_X [B]000015f4[/B]
68707-409000: EV_ABS ABS_MT_POSITION_Y 00000cfe
68707-409000: EV_ABS ABS_MT_PRESSURE 00000000
68707-409000: EV_ABS ABS_MT_TOUCH_MAJOR 00000000
68707-409000: EV_SYN SYN_MT_REPORT 00000000
68707-409000: EV_SYN SYN_REPORT 00000000

Notice the variance in the reported X coordinates is relatively low, between 1573 and 15f4. Translated to the screen resolution this would be a pixel shift of around 22 (why? the touch panel has a resolution of 7680, the screen resolution is 1280, so there are 6 touch panel 'pixels' for every screen pixel). The image shows a completely different result though - the line is at least 150 pixels long. Where did those extra pixels come from?

Another strange thing here is the sequence of events. The driver first reports single-touch X and Y (ABS_X and ABS_Y), followed by multitouch X and Y (ABS_MT_POSITION_X and ABS_MT_POSITION_Y). This is as expected, since these events get reported in sequence by the driver. What is not expected is the absence of ABS_Y reports after the first report, and the occasional absence of ABS_X reports. The driver ALWAYS reports ABS_X/ABS_Y/ABS_PRESSURE/BTN_TOUCH followed by the related ABS_MT_xxx events. Either getevent does not report all events (although it should), or some events get dropped somewhere. This still does not explain the glitches I mentioned above, but it might be worth looking in to a bit deeper (still).