Opened 7 years ago

Closed 4 years ago

#8338 closed enhancement (fixed)

Touch screen doesn't work on Acer W500

Reported by: lxstoian Owned by: nobody
Priority: normal Milestone: R1
Component: Drivers Version: R1/Development
Keywords: Acer, W500, touchscreen Cc:
Blocked By: Blocking: #8370, #9545
Has a Patch: no Platform: x86

Description

This is an x86 tablet ( AMD C-60 APU ). The touch screen is eGalax : http://home.eeti.com.tw/web20/eg/Touch_Drives.html

Haiku doesn't have support for touch screens , but as things are going now in the computer world this might be a feature to consider.

Attachments (9)

ep121-eGalax_HID.txt (1.1 KB) - added by Bouncer 7 years ago.
listdev.txt (3.5 KB) - added by lxstoian 7 years ago.
acer w500
listusb.txt (973 bytes) - added by lxstoian 7 years ago.
acer w500
usb_hid_report_descriptor_0c45_76f4_0.bin (65 bytes) - added by lxstoian 7 years ago.
acer w500
usb_hid_report_descriptor_0c45_76f4_1.bin (229 bytes) - added by lxstoian 7 years ago.
acer w500
usb_hid_report_descriptor_0eef_7302_0.bin (322 bytes) - added by lxstoian 7 years ago.
acer w500
syslog (366.4 KB) - added by X512 7 years ago.
Syslog
touchscreen.diff (9.1 KB) - added by X512 7 years ago.
My hacks on driver. It enables touchscreen and tries to introduce multitouch. WARNING! This is experimental modifications and not a patch for fixing this ticket.
0001-Fix-input_server-tablet-add-on-name-generation.-Mult.patch (1.1 KB) - added by X512 4 years ago.
patch

Download all attachments as: .zip

Change History (32)

comment:1 Changed 7 years ago by Bouncer

Haiku did at one time have some support for touch screens. Have a look at ticket #7481. I did in fact get it working. I believe we lost the support sometime last summer when mmlr rewrote Haiku's USB HID software. Perhaps he just left off some drivers, or didn't have time to modify them.

comment:2 in reply to:  1 Changed 7 years ago by anevilyak

Replying to Bouncer:

Haiku did at one time have some support for touch screens.

Going off of ticket #7481 that was a work-in-progress patch that was never yet committed, so that's not really the case.

I believe we lost the support sometime last summer when mmlr rewrote Haiku's USB HID software. Perhaps he just left off some drivers, or didn't have time to modify them.

The whole point of proper HID support is precisely that you don't need specialized drivers for everything, the HID spec provides detailed enough descriptors to be able to handle any kind of input device. However, quite a few vendors are idiots and flag their devices as type 0xff (vendor-specific), which results in you having no choice but to use their drivers because it can't be determined that they are in fact HID devices. Furthermore, it's not even clear that it's a USB device at all in this particular case, at least their web page doesn't clarify that. As such, it's not out of the realm of possibility for it to be exporting itself on the PS/2 bus. The output of listusb -v on the system in question would be required to determine that.

Changed 7 years ago by Bouncer

Attachment: ep121-eGalax_HID.txt added

comment:3 Changed 7 years ago by Bouncer

Well, I am certainly no expert in USB drivers. But I see no evidence that the device has type 0xff as you suggest. I ran the listusb -v as you suggested - and it definitely seems to be a HID device. Am attaching relevant portion of the output. But enough of this - I am not trying to hijack the ticket, just trying to offer some additional input.

comment:4 Changed 7 years ago by korli

You should find a file /tmp/usb_hid_report_descriptor_*.bin for your device. Please attach it plus a syslog.

comment:5 Changed 7 years ago by lxstoian

I will provide listusb , listdev , syslog and usb_hid_report... once I get home in 2 hours.

Changed 7 years ago by lxstoian

Attachment: listdev.txt added

acer w500

Changed 7 years ago by lxstoian

Attachment: listusb.txt added

acer w500

Changed 7 years ago by lxstoian

acer w500

Changed 7 years ago by lxstoian

acer w500

Changed 7 years ago by lxstoian

acer w500

comment:6 Changed 7 years ago by X512

Keywords: Acer W500 added

comment:7 Changed 7 years ago by X512

Blocking: 8370 added

comment:8 Changed 7 years ago by X512

I am sure that touchscreen is USB HID. After some hack I force Haiku HID driver to send absolute coordinates from touchscreen, but without any pressure detection. After some research I found that device had many reports and it sends coordinates in report 4. Haiku input system detect only first report and ignore others. I hardcoded report 4.

I think I can fix this problem if I do some more research. Also this touchscreen can handle up to 4 contacts in one time and Haiku must support it. What message need to be send for second, third and forth contact? I think there are some changes in input_server, app_server and interface kit needed.

I think it's need to add contact number to mouse messages and send this messages to views with B_MULTITOUCH_AWARE flag.

Also there are some mechanism for right mouse button emulation needed. In windows it just long time pressure with special indicator. I think that it can be implemented as filter.

comment:9 Changed 7 years ago by lxstoian

Why not just implement single touch for now ?

comment:10 Changed 7 years ago by korli

To find out reports sent by your device, the USB HID driver analyzes the report descriptors. Thus, to add support for this device, you should make sure you understand what reports are provided by your device to be able to modify correctly the USB HID driver. And you're right it's probably mandatory to add support for these multitouch digitizers downstream.

See also http://www.usb.org/developers/hidpage/HUTRR34.zip to see if that fits your device.

Changed 7 years ago by X512

Attachment: syslog added

Syslog

comment:11 Changed 7 years ago by X512

Part of syslog:

KERN: usb_hid: adding protocol handlers
KERN: usb_hid: root collection holds 5 application collections
KERN: usb_hid: collection usage page 13 usage id 4
KERN: usb_hid: collection not a supported keyboard subset
KERN: usb_hid: mouse device with 0 buttons and no wheel
KERN: usb_hid: report id: 4
KERN: usb_hid: collection not a joystick or gamepad
KERN: usb_hid: collection usage page 1 usage id 1
KERN: usb_hid: collection not a supported keyboard subset
KERN: usb_hid: mouse device with 2 buttons and no wheel
KERN: usb_hid: report id: 1
KERN: usb_hid: collection not a joystick or gamepad
KERN: usb_hid: collection usage page 65280 usage id 1
KERN: usb_hid: collection not a supported keyboard subset
KERN: usb_hid: collection not a mouse/tablet/digitizer
KERN: usb_hid: collection not a joystick or gamepad
KERN: usb_hid: collection usage page 13 usage id 4
KERN: usb_hid: collection not a supported keyboard subset
KERN: usb_hid: mouse device with 0 buttons and no wheel
KERN: usb_hid: report id: 2
KERN: usb_hid: collection not a joystick or gamepad
KERN: usb_hid: collection usage page 13 usage id 14
KERN: usb_hid: collection not a supported keyboard subset
KERN: usb_hid: collection not a mouse/tablet/digitizer
KERN: usb_hid: collection not a joystick or gamepad
KERN: usb_hid: added 3 handlers for hid device
KERN: usb_hid: init_driver() OK
KERN: usb_hid: publish_devices()
KERN: usb_hid: publishing input/tablet/usb0
KERN: usb_hid: publishing input/tablet/usb1
KERN: usb_hid: publishing input/tablet/usb2

Why 3 mouses? Mayble device presents legacy mouse support. One mouse has 2 buttons...

Report 4 holds absolute coordinates. Report 1 doesn't.

input_server tablet device take only one report and cursor don't move if reports other than 4 are disabled.

Also as I see multitouch work. If I contact with 4 fingers and move Haiku cursor flashing in 4 places. Also I see high CPU load and cursor slow down.

Now it's need to detect where touch pressure and contact number holds.

comment:12 Changed 7 years ago by X512

I was stupid. HIDReport has PrintToStream() method... It says that:

KERN: usb_hid: HIDReport 0x82699c80
KERN: usb_hid: 	type: 1 input
KERN: usb_hid: 	report id: 4
KERN: usb_hid: 	report size: 40 bits = 5 bytes
KERN: usb_hid: 	item count: 6
KERN: usb_hid: 	HIDReportItem 0x80833440
KERN: usb_hid: 		byte offset: 0
KERN: usb_hid: 		shift: 0
KERN: usb_hid: 		mask: 0x00000001
KERN: usb_hid: 		has data: yes
KERN: usb_hid: 		array: no
KERN: usb_hid: 		relative: no
KERN: usb_hid: 		minimum: 0
KERN: usb_hid: 		maximum: 1
KERN: usb_hid: 		usage minimum: 0x000d0042
KERN: usb_hid: 		usage maximum: 0x000d0042
KERN: usb_hid: 	HIDReportItem 0x808333e0
KERN: usb_hid: 		byte offset: 0
KERN: usb_hid: 		shift: 1
KERN: usb_hid: 		mask: 0x00000001
KERN: usb_hid: 		has data: yes
KERN: usb_hid: 		array: no
KERN: usb_hid: 		relative: no
KERN: usb_hid: 		minimum: 0
KERN: usb_hid: 		maximum: 1
KERN: usb_hid: 		usage minimum: 0x000d0032
KERN: usb_hid: 		usage maximum: 0x000d0032
KERN: usb_hid: 	HIDReportItem 0x80833c20
KERN: usb_hid: 		byte offset: 0
KERN: usb_hid: 		shift: 2
KERN: usb_hid: 		mask: 0x0000001f
KERN: usb_hid: 		has data: yes
KERN: usb_hid: 		array: no
KERN: usb_hid: 		relative: no
KERN: usb_hid: 		minimum: 0
KERN: usb_hid: 		maximum: 16
KERN: usb_hid: 		usage minimum: 0x000d0051
KERN: usb_hid: 		usage maximum: 0x000d0051
KERN: usb_hid: 	HIDReportItem 0x80833b60
KERN: usb_hid: 		byte offset: 0
KERN: usb_hid: 		shift: 7
KERN: usb_hid: 		mask: 0x00000001
KERN: usb_hid: 		has data: yes
KERN: usb_hid: 		array: no
KERN: usb_hid: 		relative: no
KERN: usb_hid: 		minimum: 0
KERN: usb_hid: 		maximum: 1
KERN: usb_hid: 		usage minimum: 0x000d0047
KERN: usb_hid: 		usage maximum: 0x000d0047
KERN: usb_hid: 	HIDReportItem 0x80833500
KERN: usb_hid: 		byte offset: 1
KERN: usb_hid: 		shift: 0
KERN: usb_hid: 		mask: 0x0000ffff
KERN: usb_hid: 		has data: yes
KERN: usb_hid: 		array: no
KERN: usb_hid: 		relative: no
KERN: usb_hid: 		minimum: 0
KERN: usb_hid: 		maximum: 32767
KERN: usb_hid: 		usage minimum: 0x00010030
KERN: usb_hid: 		usage maximum: 0x00010030
KERN: usb_hid: 	HIDReportItem 0x80833290
KERN: usb_hid: 		byte offset: 3
KERN: usb_hid: 		shift: 0
KERN: usb_hid: 		mask: 0x0000ffff
KERN: usb_hid: 		has data: yes
KERN: usb_hid: 		array: no
KERN: usb_hid: 		relative: no
KERN: usb_hid: 		minimum: 0
KERN: usb_hid: 		maximum: 32767
KERN: usb_hid: 		usage minimum: 0x00010031
KERN: usb_hid: 		usage maximum: 0x00010031

Encoded types:

B_HID_UID_DIG_TIP_SWITCH
B_HID_UID_DIG_IN_RANGE
B_HID_UID_DIG_CONTACT_IDENTIFIER
Unknown(Digitizers::Code(0x0047))
B_HID_UID_GD_X
B_HID_UID_GD_Y

I use B_HID_UID_DIG_TIP_SWITCH as primary mouse button and get something working.

I can't find what means digitizer code 0x47. Hut1_12v2.pdf says that: 47-FFFF - Reserved. HUTRR34.pdf don't says anything about code 0x47.

Finally I got crash from atheroswifi driver(Haiku always try to connect to unknown open WiFi and often fails). Device haven't keyboard and I can't type anything in KDL. I will fill another ticket.

comment:14 Changed 7 years ago by X512

I have no time for developing driver now. For now I use Windows 8 Developer Preview on this machine.

It would be nice to have touch support in Haiku. Now there are a lot of devices with touchscreen controlled interface(but many of this have ARM CPU).

comment:15 Changed 7 years ago by X512

Finally I got touchscreen working on Haiku! It is working, but with report id 4 hack and multitouch isn't handled correctly.

As I read from Microsoft documentation HID device can had many reports. Haiku HID driver create device for every report id. Is this correct? Also tablet input_server device can't handle more than 1 device correctly.

I changed mouse generation logic in tablet add on: now B_MOUSE_MOVED message generated before B_MOUSE_DOWN / B_MOUSE_UP. Without it most applications didn't handle mouse messages correctly. Some issues with event handling still exists in menus.

I don't think that patch is useful because it is hardcoded to Acer W500. HID report handling should be changed to remove hack.

comment:16 Changed 7 years ago by modeenf

Keywords: touchscreen added

comment:17 Changed 7 years ago by modeenf

Any chans of adding your changes here as reference?

Changed 7 years ago by X512

Attachment: touchscreen.diff added

My hacks on driver. It enables touchscreen and tries to introduce multitouch. WARNING! This is experimental modifications and not a patch for fixing this ticket.

comment:18 Changed 7 years ago by X512

This patch is also Acer W500 specific.

comment:19 Changed 6 years ago by X512

Blocking: 9545 added

comment:20 Changed 4 years ago by X512

I found and fixed real ussue that pervents touchscreen working. tablet input_server add-on incorrectly generates device name causing name collision and only first tablet are registered. I don't know why, but USB HID tablet driver found 3 tablet devices (/dev/input/tablet/usb0, usb1, usb2) but first one don't produce any input.

comment:21 Changed 4 years ago by X512

Has a Patch: set

comment:22 Changed 4 years ago by jessicah

Has a Patch: unset

comment:23 Changed 4 years ago by jessicah

Resolution: fixed
Status: newclosed

Fixed in hrev48217.

Note: See TracTickets for help on using tickets.