Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

[Q] Geniatech AT1200 box + external USB touchScreen weird problem

$
0
0
Hello developers!

I own a Geniatech AT1200 Android 4.1.2 TV box, used as a CarPC device. Along with it I am trying to use a USB touchScreen based on a PIC microcontroller. The USB touchScreen is a DIY device. What it basically does is report itself as a HID touchscreen digitizer device, it produces ABS_X and ABS_Y and BTN_TOUCH events. Coordinate range is 0..4095, max value reported is 4095. The USB touchScreen ran FINE on my previous Geniatech Android 2.3 based box, also it works fine on a Windows XP computer.

Now, with this 4.1.2 box there is a weird problem. When a point on a touchscreen is touched, Android may report it in 4 different places, as though it thinks touchscreen orientation is being changed. The change is pure cyclic: 25% of the time coordinates are reported correctly, another 25% they are mirrored, then 25% of the time coordinates are swapped, another 25% swapped mirrored, then the cycle repeats. Coordinate change takes place approx. every 4 secs.

I checked output using 'getevent'. The raw coordinates reported are always consistent with actual touches. So I wrote a sample script that's emulating touches:

sendevent /dev/input/event0 0003 0000 00002105 # X
sendevent /dev/input/event0 0003 0001 00002117 # Y
sendevent /dev/input/event0 0000 0000 00000000 # zero

sendevent /dev/input/event0 0001 0330 00000001 # touch down
sendevent /dev/input/event0 0000 0000 00000000 # zero

sendevent /dev/input/event0 0001 0330 00000000 # touch up
sendevent /dev/input/event0 0000 0000 00000000 # zero


If I run the script repeatedly with touch traces enabled in developer section, I finally end up with 4 points on the screen. One actual coordinates, another coordinates swapped, then coordinates mirrored, and coordinates mirrored swapped.

I understand, it's the InputReader component that's responsible for /dev/input/event0 events conversion to Android touch events. That's part of the kernel, but maybe there are other places to check? I am totally clueless and I have found no indication of anyone having such a problem on the internet whatsoever. This is a consumer device, I cannot recompile the kernel, however, I found it's source code on the net.

Thank you.

Viewing all articles
Browse latest Browse all 3614

Trending Articles