Summary: | wmt driver fails to attach to Synaptics Touchscreen | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Sergei Akhmatdinov <sakhmatd> | ||||||||||||
Component: | usb | Assignee: | Vladimir Kondratyev <wulf> | ||||||||||||
Status: | Closed FIXED | ||||||||||||||
Severity: | Affects Some People | CC: | dpolyg, emaste, sakhmatd, sakhmatd, wulf | ||||||||||||
Priority: | --- | ||||||||||||||
Version: | CURRENT | ||||||||||||||
Hardware: | amd64 | ||||||||||||||
OS: | Any | ||||||||||||||
Attachments: |
|
Description
Sergei Akhmatdinov
2018-10-07 18:11:24 UTC
Forgot to mention that I am tracking head, updated world and kernel today. Hi Sergei, Could you attach HID descriptor of your touchscreen. usbhid-dump (sysutils/usbhid-dump) can help you obtain it. Created attachment 203907 [details] usbconfig -d ugen0.2 dump_all_desc Attach output of `usbconfig -d ugen0.2 dump_all_desc` mentioned in comment 0 just in case pastebin goes away. @Vladimir Is this sufficient information or is usbhid-dump output still needed? (In reply to Kubilay Kocak from comment #3) > @Vladimir Is this sufficient information or is usbhid-dump output still needed? usbhid-dump output is still needed. Unlike mices and keyboards, touchscreens do not have boot protocol records in USB interface descriptor so their detection is based on content of HID descriptor. Created attachment 208210 [details]
Output of usbhid-dump
My apologies for not responding to this bug sooner.
Please find the output of usbhid-dump attached. The device is now detected as ugen0.3, I was not sure which descriptor corresponds to the device itself.
(In reply to Sergei Akhmatdinov from comment #5) HID report descriptor appeared to be broken. It declares 'Contact Count Maximum' as padding bits: 0x85, 0x08, // Report ID (8) 0x09, 0x55, // Usage (0x55) 0xB1, 0x03, // Feature (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) Try the attached patch. It is a quick and dirty hack, not a real solution. Right way is to substitute broken descriptor with fixed one, but wmt(4) driver can not do that yet. Created attachment 209051 [details]
Treat_padding_as_data_for_CCMax.patch
(In reply to Vladimir Kondratyev from comment #6) Thank you, Vladimir. The patch seems to work, wmt attaches now: # dmesg | grep wmt wmt0 on uhub1 wmt0: <SYNAPTICS Synaptics Touch Digitizer V04, class 0/0, rev 2.00/0.05, addr 2> on usbus0 wmt0: 15 contacts and []. Report range [0:0] - [2786:1579] wmt0: 10 feature report contactsugen1.2: <vendor 0x8087 product 0x8001> at usbus1 wmt0: at uhub1, port 5, addr 2 (disconnected) wmt0: detached wmt0 on uhub1 wmt0: <SYNAPTICS Synaptics Touch Digitizer V04, class 0/0, rev 2.00/0.05, addr 5> on usbus0 wmt0: 15 contacts and []. Report range [0:0] - [2786:1579] wmt0: 10 feature report contacts I seem to get a device as /dev/input/event0. However, X fails to make use of it. I do not see anything mention /dev/input/event0 in Xorg.0.log. xf86-input-evdev and xf86-input-libinput are both installed. Libinput seems to see the device, however: # libinput list-devices Device: SYNAPTICS Synaptics Touch Digitizer V04, class 0/0, rev 2.00/0.05, addr 5 Kernel: /dev/input/event0 Group: 1 Seat: seat0, default Size: 279x158mm Capabilities: touch Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: identity matrix Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a I don't know if libinput is interfering or not. I have made an entry in Xorg.conf.d to try and force evdev, but Xorg seems to ignore it. # 40-touch.conf Section "InputDevice" Identifier "Touchscreen" Driver "evdev" Option "Device" "/dev/input/event0" EndSection (In reply to Sergei Akhmatdinov from comment #8) You should start with evemu-record (devel/evemu) and find out if your device produces any events Created attachment 209233 [details]
Output of evemu-record
Seems like I am getting events, here is the output of
# evemu-record /dev/input/event0
after touching the screen once and releasing.
Created attachment 209381 [details]
Fix_report_descriptor.patch
(In reply to Sergei Akhmatdinov from comment #10) > Seems like I am getting events, here is the output of > # evemu-record /dev/input/event0 > after touching the screen once and releasing. Events look good for single touch. So you need to configure Xorg properly. On one of my laptops I found following line in "ServerLayout" section: InputDevice "TouchScreen" "SendCoreEvents" May be that is what you need. The other option is to use evdev-awared input device autoconfiguration backend. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196678 P.S. I updated patch with proper fix for your touchscreen. Please test it after reverting of previous one. Experiencing the same kind of behavior on 12.1-RELEASE and different touch screen model. The solution: InputDevice "TouchScreen" "SendCoreEvents" works for me, but I stll need "InputDevice" section with hard-coded device name '/dev/input/eventN' AFAIK the 'N' number above may change... Is there a way to avoid hard-coding of 'N' in config file? A commit references this bug: Author: wulf Date: Mon Mar 9 21:01:22 UTC 2020 New revision: 358824 URL: https://svnweb.freebsd.org/changeset/base/358824 Log: wmt(4): Fix Synaptics Touch Digitizer V04 attachment Touch Digitizer V04 report descriptor declares 'Contact Count Maximum' usage as constant. That was not supported by descriptor parser. PR: 232040 Reported by: Sergei Akhmatdinov <sakhmatd@darkn.space> MFC after: 1 week Changes: head/sys/dev/usb/input/wmt.c First version of patch is committed (Treat_padding_as_data_for_CCMax.patch) as it appeared to be correct too. A commit references this bug: Author: wulf Date: Tue Mar 17 23:57:07 UTC 2020 New revision: 359055 URL: https://svnweb.freebsd.org/changeset/base/359055 Log: MFC r358824: wmt(4): Fix Synaptics Touch Digitizer V04 attachment Touch Digitizer V04 report descriptor declares 'Contact Count Maximum' usage as constant. That was not supported by descriptor parser. PR: 232040 Reported by: Sergei Akhmatdinov <sakhmatd@darkn.space> Changes: _U stable/12/ stable/12/sys/dev/usb/input/wmt.c A commit references this bug: Author: wulf Date: Tue Mar 17 23:58:58 UTC 2020 New revision: 359056 URL: https://svnweb.freebsd.org/changeset/base/359056 Log: MFC r358824: wmt(4): Fix Synaptics Touch Digitizer V04 attachment Touch Digitizer V04 report descriptor declares 'Contact Count Maximum' usage as constant. That was not supported by descriptor parser. PR: 232040 Reported by: Sergei Akhmatdinov <sakhmatd@darkn.space> Changes: _U stable/11/ stable/11/sys/dev/usb/input/wmt.c |