eGalax usb touchscreen 0eef:0001 solution yet?

3,122 views
Skip to first unread message

Mike C

unread,
Mar 20, 2012, 5:31:41 AM3/20/12
to andro...@googlegroups.com
Hi all,

I know there are several of you working on getting the eGalax internal usb touchscreen (0eef:0001) to work. It's become a bit quiet on this issue lately, does that mean someone has solved the problem?  If not, this link might be interesting because the described 3M usb touchscreen seems to have the same symptoms: it's detected by getevent but touch input is not taken up by the system. I'm not capable of testing the patch supplied by Daniel (link below), is there someone who want to try it?


Thanks,
Mike

Joseph Hayhoe

unread,
Mar 20, 2012, 8:24:08 AM3/20/12
to Android-x86
Ive pulled some pertinent information from the touchscreen using the
info provided in the 3M topic:

The touchcontroller appears to have the similar issue as it uses
BTN_LEFT instead of BTN_TOUCH. I also see that it is using ABS_Z and
ABS_RX instead of ABS_X and ABS_Y. I am working on tweaking the
patches provided in the 3M article to use the new X/Y names and will
respond with my results.

Input driver version is 1.0.0
Input device ID: bus 0x3 vendor 0xeef product 0x1 version 0x210
Input device name: "eGalax Inc. USB TouchController"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 272 (BTN_LEFT)
Event code 273 (BTN_RIGHT)
Event code 320 (BTN_TOOL_PEN)
Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 0
Min 0
Max 4095
Event code 1 (ABS_Y)
Value 0
Min 0
Max 4095
Event code 2 (ABS_Z)
Value 4008
Min 0
Max 4095
Event code 3 (ABS_RX)
Value 2174
Min 0
Max 4095
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Testing ... (interrupt to exit)
Event: time 1332245870.149551, type 3 (EV_ABS), code 2 (ABS_Z), value
2288
Event: time 1332245870.149593, type 3 (EV_ABS), code 3 (ABS_RX), value
1872
Event: time 1332245870.149602, -------------- SYN_REPORT ------------
Event: time 1332245870.153540, type 4 (EV_MSC), code 4 (MSC_SCAN),
value 90001
Event: time 1332245870.153573, type 1 (EV_KEY), code 272 (BTN_LEFT),
value 1
Event: time 1332245870.153623, -------------- SYN_REPORT ------------
Event: time 1332245870.227579, type 3 (EV_ABS), code 2 (ABS_Z), value
2280
Event: time 1332245870.227653, type 3 (EV_ABS), code 3 (ABS_RX), value
1868
Event: time 1332245870.227665, -------------- SYN_REPORT ------------
Event: time 1332245870.357564, type 4 (EV_MSC), code 4 (MSC_SCAN),
value 90001
Event: time 1332245870.357607, type 1 (EV_KEY), code 272 (BTN_LEFT),
value 0
Event: time 1332245870.357657, -------------- SYN_REPORT ------------

Joseph Hayhoe

unread,
Mar 20, 2012, 8:54:43 AM3/20/12
to Android-x86
Recompiled with the changes and still no response from the
touchscreen...

Daniel Kenzelmann

unread,
Mar 20, 2012, 9:23:55 AM3/20/12
to andro...@googlegroups.com
If you have this in your EventHub.cpp, can you check whether the mouse pointer disappears if you use the touchscreen? (I assume you also have a mouse connected)

(That would indicate that it did indeed identify the touchscreen but does not yet correctly capture the events which we would have to modify in InputReader,cpp)

    // Is this an old style single-touch driver?
    } else if ((test_bit(BTN_TOUCH, device->keyBitmask) || test_bit(BTN_LEFT, device->keyBitmask))
            && ((test_bit(ABS_X, device->absBitmask) && test_bit(ABS_Y, device->absBitmask))
            ||  (test_bit(ABS_Z, device->absBitmask) && test_bit(ABS_RX, device->absBitmask)))) {
        device->classes |= INPUT_DEVICE_CLASS_TOUCH;
    }



Mike C

unread,
Mar 20, 2012, 1:26:07 PM3/20/12
to andro...@googlegroups.com
Daniel, Joseph,

Thanks for your efforts. The eGalax usb touchscreen is resistive and for all I know resistive touchscreens can only be single touch. But i may be mistaken. Personally I would be satisfied is the eGalax works as a single touch screen.

Joseph, I suppose you looked into the touch input config files that are new in ICS (they were not in previous versions)?  I posted something about that but can't find it right now.

Many thanks again.

mike

Daniel Kenzelmann

unread,
Mar 20, 2012, 3:50:46 PM3/20/12
to andro...@googlegroups.com
Hi,

According to the evtest output they are indeed single-touch (same as my resistive 3M screen here..)
The "// Is this an old style single-touch driver?" comment was part of the code snippet, not a question :-)

Joseph, if you want I could try some modifications myself and make an .iso or post the patch files but I have no eGalax screen so I have no way to test this.
Could you also verify which of the axes (ABS_RX and ABS_Z) correspond to X and Y? You might be able to see that in the evtest output by running along one side of the screen


Chris Bagwell

unread,
Mar 20, 2012, 5:05:55 PM3/20/12
to Android-x86
On Mar 20, 7:24 am, Joseph Hayhoe <fnj00m...@gmail.com> wrote:
> Ive pulled some pertinent information from the touchscreen using the
> info provided in the 3M topic:
>
> The touchcontroller appears to have the similar issue as it uses
> BTN_LEFT instead of BTN_TOUCH. I also see that it is using ABS_Z and
> ABS_RX instead of ABS_X and ABS_Y. I am working on tweaking the
> patches provided in the 3M article to use the new X/Y names and will
> respond with my results.

When you see eGalax HW reporting ABS_Z and ABS_RX, it means you need
to add a quirk to hid-core driver for it to work. What happens is the
USB HW's HID report declares 2 interfaces on 1 device and each has its
own X/Y report. hid-core merges them both onto a single /dev/input
device, gets confused by the duplicate X/Y's, and maps second set to
ABS_Z/ABS_RX since those are first unused events right after ABS_X/
ABS_Y . See:

http://git.android-x86.org/?p=kernel/common.git;a=blob;f=drivers/hid/usbhid/hid-quirks.c;h=cfbd11913bb240695bb0758d2b364314fc91f160;hb=refs/heads/android-3.0.x

Look at this sample line for another eGalax device:

36 { USB_VENDOR_ID_DWAV,
USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT |
HID_QUIRK_NOGET },

Add a line for 0xeef:0001 that has the HID_QUIRK_MULTI_INPUT. This
will cause 2 /dev/input's to be created each with a ABS_X/ABS_Y
instead of 1 /dev/input with ABS_X/ABS_Y/ABS_Z/ABS_RX. The first
device will never send events but the second one will. Probably
BTN_LEFT will stay as BTN_LEFT though.

If this happens to be a multi-touch eGalax (probably not) then there
maybe issues beyond above.

Chris

Iggy Budiman H.

unread,
Mar 20, 2012, 8:23:18 PM3/20/12
to andro...@googlegroups.com

Guys, I use this eGalax on my ICS RC1. It works but it's vertically reversed. Can anyone tell me which is the configuration/calibration file for touchscreen? I have no problem in froyo &  gb since it has ts_cal in it.

TIA
---------------
salam
-iggy

Sent using charming phone for charming people.

On 21 Mar 2012 04:57, "Chris Bagwell" <ch...@cnpbagwell.com> wrote:

On Mar 20, 7:24 am, Joseph Hayhoe <fnj00m...@gmail.com> wrote:

> Ive pulled some pertinent information from the touchscreen using the

> info provided in the 3M top...

When you see eGalax HW reporting ABS_Z and ABS_RX, it means you need
to add a quirk to hid-core driver for it to work.  What happens is the
USB HW's HID report declares 2 interfaces on 1 device and each has its
own X/Y report.  hid-core merges them both onto a single /dev/input
device, gets confused by the duplicate X/Y's, and maps second set to
ABS_Z/ABS_RX since those are first unused events right after ABS_X/
ABS_Y .  See:

http://git.android-x86.org/?p=kernel/common.git;a=blob;f=drivers/hid/usbhid/hid-quirks.c;h=cfbd11913bb240695bb0758d2b364314fc91f160;hb=refs/heads/android-3.0.x

Look at this sample line for another eGalax device:

 36         { USB_VENDOR_ID_DWAV,
USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT |
HID_QUIRK_NOGET },

Add a line for 0xeef:0001 that has the HID_QUIRK_MULTI_INPUT.  This
will cause 2 /dev/input's to be created each with a ABS_X/ABS_Y
instead of 1 /dev/input with ABS_X/ABS_Y/ABS_Z/ABS_RX.  The first
device will never send events but the second one will.  Probably
BTN_LEFT will stay as BTN_LEFT though.

If this happens to be a multi-touch eGalax (probably not) then there
maybe issues beyond above.

Chris


--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
...

Joseph Hayhoe

unread,
Mar 21, 2012, 4:55:37 PM3/21/12
to Android-x86
The evtest was ran on ubuntu 10.04 if that makes any difference. Where
do you need to place the quirk, in the hid-quirks.c file or straight
in hid-core.c? Any tips on what this quirk line should look like?

On Mar 20, 5:05 pm, Chris Bagwell <ch...@cnpbagwell.com> wrote:
> On Mar 20, 7:24 am, Joseph Hayhoe <fnj00m...@gmail.com> wrote:
>
> > Ive pulled some pertinent information from the touchscreen using the
> > info provided in the 3M topic:
>
> > The touchcontroller appears to have the similar issue as it uses
> > BTN_LEFT instead of BTN_TOUCH. I also see that it is using ABS_Z and
> > ABS_RX instead of ABS_X and ABS_Y. I am working on tweaking the
> > patches provided in the 3M article to use the new X/Y names and will
> > respond with my results.
>
> When you see eGalax HW reporting ABS_Z and ABS_RX, it means you need
> to add a quirk to hid-core driver for it to work.  What happens is the
> USB HW's HID report declares 2 interfaces on 1 device and each has its
> own X/Y report.  hid-core merges them both onto a single /dev/input
> device, gets confused by the duplicate X/Y's, and maps second set to
> ABS_Z/ABS_RX since those are first unused events right after ABS_X/
> ABS_Y .  See:
>
> http://git.android-x86.org/?p=kernel/common.git;a=blob;f=drivers/hid/...

Chris Bagwell

unread,
Mar 21, 2012, 5:14:11 PM3/21/12
to andro...@googlegroups.com
Place in hid_blacklist[] array (around line 35) in
drivers/hid/usbhid/hid-quirks.c. I believe this should work. You may
not need the NOGET quirk but since the other eGalax has it, its safer
to start with that.

{ 0x0eef, 0x0001, HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET },

Chris

> --
> You received this message because you are subscribed to the Google Groups "Android-x86" group.

> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-x86...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
>

Joseph Hayhoe

unread,
Mar 21, 2012, 8:26:55 PM3/21/12
to Android-x86
WHOLLY CRAP SUCCESS!!!

Touchscreen is working great on my build of eeepc, image included
below:

http://fnj00.dyndns-home.com/eeepc.iso

Many thanks to Chris Bagwell and others for assisting with making this
a reality!

Chris Bagwell

unread,
Mar 21, 2012, 9:05:56 PM3/21/12
to andro...@googlegroups.com
I'm curious. What does evtest show is reported by this new 2nd input
when you touch the screen? Is it BTN_LEFT or BTN_TOUCH?

If BTN_LEFT, is it working with out needing those BTN_LEFT patches
from the other thread?

Chris

Joseph Hayhoe

unread,
Mar 21, 2012, 9:23:06 PM3/21/12
to Android-x86
I actually do not have evtest on the android build only on the ubuntu
build. I pulled the latest data from the repo and it appears the
patches for BTN_LEFT were already in place so I left them.

Joseph Hayhoe

unread,
Mar 21, 2012, 10:04:49 PM3/21/12
to Android-x86
The only issue I see now is after suspend the touchscreen will not
function until you plug in a mouse and move the cursor.

Chris Bagwell

unread,
Mar 21, 2012, 9:42:08 PM3/21/12
to andro...@googlegroups.com
Thanks. That clears up my confusion. I thought it would remain
BTN_LEFT and didn't realize the patches were already in.

Chris

Chih-Wei Huang

unread,
Mar 22, 2012, 1:22:46 AM3/22/12
to andro...@googlegroups.com
2012/3/22 Joseph Hayhoe <fnj0...@gmail.com>:

> I actually do not have evtest on the android build only on the ubuntu
> build. I pulled the latest data from the repo and it appears the
> patches for BTN_LEFT were already in place so I left them.

You can use getevent, the built-in debug tool of android

getevent -p (show how many input queues you have)
getevent -l /dev/input/eventX (show events from queue eventX)

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Andrew Trimble

unread,
Mar 22, 2012, 2:46:50 AM3/22/12
to andro...@googlegroups.com
Dunno if this will help at all, but I run a Xenarc 705TSV which uses the resistive eGalax (single)-touch controller, but when detected by Android x86 it acts as if the touch overlay was rotated 90º offset to the actual screen. (Ubuntu and Win7 also do this with default drivers).
So whenever I wanted to flick left or right through home screens I had to swipe up or down. To touch the App Launcher button on the right, had to poke around the bottom of the screen.

Ended up stumbling upon this post by rdg, where he too came across this behavior and even wrote a small patch for it.
I have tried this in gingerbread, honeycomb and ICS, and at least for me it has made the eGalax controller usable.

I've made a patch file of rdg's work, so all credit goes to rdg. (see attachment)
To run this patch, copy it to you base build dir (Eg: ~/android-x86/)
And then from that directory run: patch -p1 < hid-input.c.patch
In ICS and possibly Honeycomb this succeeds, but is offset by 44 lines (according to output), don't worry about this as it will compile and work fine.

To test touch input (before or after) look in: Apps -> Dev Tools -> Pointer Location. Test by touching the screen or clicking the mouse button.
To keep the location up: Apps -> Dev Tools -> Development Settings. Change 'No pointer location' to 'Pointer location'
hid-input.c.patch

Chih-Wei Huang

unread,
Mar 22, 2012, 3:45:03 AM3/22/12
to andro...@googlegroups.com
2012/3/22 Andrew Trimble <twi...@gmail.com>:

> Dunno if this will help at all, but I run a Xenarc 705TSV which uses the
> resistive eGalax (single)-touch controller, but when detected by Android x86
> it acts as if the touch overlay was rotated 90º offset to the actual screen.
> (Ubuntu and Win7 also do this with default drivers).

I think you can just use tslib to calibrate it,
no need to hack the kernel.

The eeepc iso of 4.0-RC1 has ts_calibrate. Try

stop zygote
mkdir /data/system/tslib
ts_calibrate
start zygote

If you create your own target, remember to add the
following line to your product definition file to enable tslib.

$(call inherit-product-if-exists,external/tslib/tslib.mk)

then add BOARD_USES_TSLIB=true
to initrd script (refer to
device/asus/common/asus_info )

Andrew Trimble

unread,
Mar 22, 2012, 6:18:35 AM3/22/12
to andro...@googlegroups.com

On Thursday, March 22, 2012 6:45:03 PM UTC+11, Chih-Wei Huang wrote:

I think you can just use tslib to calibrate it,
no need to hack the kernel.

The eeepc iso of 4.0-RC1 has ts_calibrate. Try

stop zygote
mkdir /data/system/tslib
ts_calibrate
start zygote

If you create your own target, remember to add the
following line to your product definition file to enable tslib.

$(call inherit-product-if-exists,external/tslib/tslib.mk)

then add BOARD_USES_TSLIB=true
to initrd script (refer to
device/asus/common/asus_info )

--
Chih-Wei
Android-x86 project
http://www.android-x86.org


Before trying the hid-input.c.patch I tried implementing TS_LIB and getting it to use the pointercal file, but it never seemed to make any difference. But never in the fasion you described.
Just tried it tho and it worked on the stock eeepc iso like you said, and seems to give me better Y axis resolution. Might try and ditch the patch now :)

Thank you for that info Chih-Wei.

RanzQ

unread,
Mar 22, 2012, 6:24:45 AM3/22/12
to andro...@googlegroups.com
Hi,

Not sure if this is related enough to this thread but I have a problem with ts_calibrate.
I've got EeePC 1000H with 10" screen and eGalax touch. When calibrate it, it is almost accurate
but the pointer doesn't go all the way to the edges, it stays 10mm from them, no matter if
I calibrate it with a finger or a pen. I thought I could maybe manually adjust the pointercal but
I have no clue what the values mean.

Chih-Wei Huang

unread,
Mar 22, 2012, 7:23:32 AM3/22/12
to andro...@googlegroups.com
2012/3/22 Andrew Trimble <twi...@gmail.com>:

> Before trying the hid-input.c.patch I tried implementing TS_LIB and getting
> it to use the pointercal file, but it never seemed to make any difference.
> But never in the fasion you described.

When did you try it?
The tslib calibration was integrated on Feb 23.
(see my post of announcement)
Of course it won't work if you try before that date.

> Just tried it tho and it worked on the stock eeepc iso like you said, and
> seems to give me better Y axis resolution. Might try and ditch the patch now

--

Andrew Trimble

unread,
Mar 22, 2012, 11:13:02 AM3/22/12
to andro...@googlegroups.com
Yeah that's probably it. Still, thanks for the info :)

RanzQ

unread,
Mar 22, 2012, 12:52:59 PM3/22/12
to andro...@googlegroups.com
Got this fixed by calibrating with points 10mm from the edges.

Mike C

unread,
Mar 24, 2012, 5:31:08 AM3/24/12
to andro...@googlegroups.com
To all who made efforts to get the eGalax working.....

Many many thanks. Joseph, I use your iso and it works fine. 

Thanks again!

Op donderdag 22 maart 2012 16:13:02 UTC+1 schreef Andrew Trimble het volgende:

Joseph Hayhoe

unread,
Mar 24, 2012, 8:23:03 PM3/24/12
to andro...@googlegroups.com

http://www.youtube.com/watch?v=ce8xi4D0qIM&feature=email&email=comment_received

I'm soo glad the touchscreen finally works. My carpc is near complete.

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-x86/-/6_OacEsAqwIJ.

Philippe

unread,
Oct 19, 2012, 2:42:39 AM10/19/12
to andro...@googlegroups.com
Hello

For it work, but I must to modify the kernel driver
Patch (it's not very clean!!):
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -156,8 +156,8 @@ enum {
 static const struct usb_device_id usbtouch_devices[] = {
 #ifdef CONFIG_TOUCHSCREEN_USB_EGALAX
  /* ignore the HID capable devices, handled by usbhid */
- {USB_DEVICE_HID_CLASS(0x0eef, 0x0001), .driver_info = DEVTYPE_IGNORE},
- {USB_DEVICE_HID_CLASS(0x0eef, 0x0002), .driver_info = DEVTYPE_IGNORE},
+ {USB_DEVICE_HID_CLASS(0x0eef, 0x0001), .driver_info = DEVTYPE_EGALAX},
+ {USB_DEVICE_HID_CLASS(0x0eef, 0x0002), .driver_info = DEVTYPE_EGALAX},
 
  /* normal device IDs */
  {USB_DEVICE(0x3823, 0x0001), .driver_info = DEVTYPE_EGALAX},
@@ -303,13 +303,42 @@ static int e2i_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
 #define EGALAX_PKT_TYPE_REPT 0x80
 #define EGALAX_PKT_TYPE_DIAG 0x0A
 
+#define EGALAX_PKT_TYPE_SIZE 0x06
+#define EGALAX_PKT_TYPE_11BITS 0x00
+#define EGALAX_PKT_TYPE_12BITS 0x02
+#define EGALAX_PKT_TYPE_13BITS 0x04
+#define EGALAX_PKT_TYPE_14BITS 0x06
+
 static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
 {
+ int mask;
  if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT)
  return 0;
 
- dev->x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F);
- dev->y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F);
+ switch(pkt[0] & EGALAX_PKT_TYPE_SIZE)
+ {
+ case EGALAX_PKT_TYPE_11BITS : 
+ mask = 0x07FF;
+ break;
+ case EGALAX_PKT_TYPE_12BITS : 
+ mask = 0x0FFF;
+ break;
+ case EGALAX_PKT_TYPE_13BITS : 
+ mask = 0x1FFF;
+ break;
+ case EGALAX_PKT_TYPE_14BITS : 
+ mask = 0x3FFF;
+ break;
+ default : 
+ mask = 0x7FFF;
+ break;
+ }
+
+ dev->x = (((pkt[4] & 0x7F) << 7) | (pkt[3] & 0x7F)) & mask;
+ dev->y = (((pkt[2] & 0x7F) << 7) | (pkt[1] & 0x7F)) & mask;
+// printk( KERN_INFO "PFO : x = %d, y = %d", dev->x, dev->y );
+// printk( KERN_INFO "PFO : %X %X %X %X %X %X", pkt[0], pkt[1], pkt[2], pkt[3], pkt[4], pkt[5] );
+
  dev->touch = pkt[0] & 0x01;
 
  return 1;

anand M

unread,
Nov 27, 2012, 1:09:44 AM11/27/12
to andro...@googlegroups.com
HI

I used your bulid eeepc.iso [http://fnj00.dyndns-home.com/eeepc.iso] with nomodeset in kernel command line

i enter the command less /proc/bus/input/devices in command line [ALT+F1] but i didnt get my egalaxy Touch Monitor information [i got all other external hardware connected via usb port]

i Connected the monitor in Linux mint did the same command in terminal in this case i got my egalaxy Touch screen information

Can you please give me some suggestion to get my touch screen works ..
Reply all
Reply to author
Forward
0 new messages