From nobody Wed Aug 11 22:12:13 2021 X-Original-To: usb@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 024081751247 for ; Wed, 11 Aug 2021 22:13:36 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GlPGl6N1pz4dj9; Wed, 11 Aug 2021 22:13:35 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from [192.168.0.30] (unknown [176.120.225.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: wulf) by smtp.freebsd.org (Postfix) with ESMTPSA id 41F46C692; Wed, 11 Aug 2021 22:13:35 +0000 (UTC) (envelope-from wulf@FreeBSD.org) To: Mark Kane Cc: usb@freebsd.org, hps@selasky.org References: <324d49ca-1c0e-659d-194d-ece4d5f7f5e2@FreeBSD.org> <0ae3fec48e2c351d2c006f4ba4932cd7@kane.mn> <166dd4d4-24cd-c24b-d75e-9a34fa734358@FreeBSD.org> <36983ce5-8358-5a04-2377-46067d3c3c79@FreeBSD.org> <59ba07a0ecbdac36746fe18ea5f0559f@kane.mn> <92c855bf-a73a-bae5-fcdc-c5a88008739b@FreeBSD.org> <5e8cd8d75deff98e8db3352001ce8432@kane.mn> <858ac67e-14e2-730c-4a16-ca218e2c0bee@FreeBSD.org> <168b368c-3258-6416-42c5-a722e45bf14b@FreeBSD.org> From: Vladimir Kondratyev Subject: Re: eGalax USB touchscreen issues Message-ID: <12706f32-be2e-1cda-5d90-53b4e80b0b52@FreeBSD.org> Date: Thu, 12 Aug 2021 01:12:13 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 List-Id: FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-usb List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 10.08.2021 07:03, Mark Kane wrote: > On 2021-08-07 05:56, Vladimir Kondratyev wrote: >> Try attached patch (on top of previous one) > > The screen we've been testing works perfectly with this patch on top of > previous one (with usbhid_load="YES" and hw.usb.usbhid.enable=1). Thanks > very much for all of your work on this! :) Great! You wrote very descriptive crash report which made tracking the bug rather easy task! > > I have many of these egalax screens for an application being migrated > from Linux to FreeBSD. Physically they all look identical but after > trying a few others it seems that some are very different inside. Below > is one that is not working with or without the patches. Is there any > possibility of also supporting this variant on FreeBSD? > > Screen #2 - With your 2 patches and usbhid/hidraw: > > ugen0.3: at usbus0 > usbhid0 on uhub1 > usbhid0: addr 3> on usbus0 > hidbus0: on usbhid0 > hidraw0: on hidbus0 > hidraw0: no report descriptor > > # hid-decode /dev/hidraw0 > (no output) > # usbhid-dump > 000:003:000:DESCRIPTOR         1628551474.564813 >  8D 0F 00 09 42 09 32 15 00 25 01 95 02 75 01 81 >  02 95 06 75 01 81 03 05 01 09 30 75 10 95 01 A4 >  55 00 65 00 36 00 00 46 00 00 16 1E 00 26 C8 0F >  81 02 09 31 16 3C 00 26 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This one looks like corrupted fragment of touch device HID report descriptor. Check wires, USB port, device itself and so on. Most probably, it is a standard eGalax HID device with some USB transport problems. > 000:004:001:DESCRIPTOR         1628551474.567569 >  05 0C 09 01 A1 01 85 01 19 00 2A 3C 02 15 00 26 >  3C 02 95 01 75 10 81 00 C0 05 01 09 80 A1 01 85 >  02 19 81 29 83 25 01 75 01 95 03 81 02 95 05 81 >  01 C0 > > 000:004:000:DESCRIPTOR         1628551474.570559 >  05 01 09 06 A1 01 05 07 19 E0 29 E7 15 00 25 01 >  95 08 75 01 81 02 95 08 75 01 81 01 05 08 19 01 >  29 03 95 03 75 01 91 02 95 01 75 05 91 01 05 07 >  19 00 2A FF 00 15 00 26 FF 00 95 06 75 08 81 00 >  C0 > # > > Based on that and a lot of forums/bugzilla reading it seems that the > vendor re-used hardware IDs that makes older non-HID touchscreens look > the same as their newer HID screens. This "screen #2" was manufactured > in 2012 compared to the 2018 unit that works with your patches now. So I > suspect this may be one of the older non-HID screens that uep(4) should > support (?). I don't think so. I have a sample of non-HID eGalax touchscreen built in 2009. It advertises bInterfaceClass = 0x00ff rather than 0x0003 (HID) in your touchscreen. > With usbhid disabled uep(4) attaches in evdev mode and X gets the input > device but no events are heard: > > Trying uep(4) in native mode with xf86-input-egalax also had the same, > uep(4) attached but no events when testing with xinput. > xf86-input-egalax can not work with kernels compiled with EVDEV_SUPPORT. This options disables native interface of uep(4) > # usbconfig -d ugen0.3 dump_all_desc > ugen0.3: at usbus0, cfg=0 md=HOST > spd=FULL (12Mbps) pwr=ON (100mA) > >   bLength = 0x0012 >   bDescriptorType = 0x0001 >   bcdUSB = 0x0110 >   bDeviceClass = 0x0000  >   bDeviceSubClass = 0x0000 >   bDeviceProtocol = 0x0000 >   bMaxPacketSize0 = 0x0040 >   idVendor = 0x0eef >   idProduct = 0x0001 >   bcdDevice = 0x0100 >   iManufacturer = 0x0001  >   iProduct = 0x0002  >   iSerialNumber = 0x0000  >   bNumConfigurations = 0x0001 > >  Configuration index 0 > >     bLength = 0x0009 >     bDescriptorType = 0x0002 >     wTotalLength = 0x0022 >     bNumInterfaces = 0x0001 >     bConfigurationValue = 0x0001 >     iConfiguration = 0x0001  >     bmAttributes = 0x00a0 >     bMaxPower = 0x0032 > >     Interface 0 >       bLength = 0x0009 >       bDescriptorType = 0x0004 >       bInterfaceNumber = 0x0000 >       bAlternateSetting = 0x0000 >       bNumEndpoints = 0x0001 >       bInterfaceClass = 0x0003  ^------HID >       bInterfaceSubClass = 0x0000 >       bInterfaceProtocol = 0x0000 >       iInterface = 0x0000  > >       Additional Descriptor > >       bLength = 0x09 >       bDescriptorType = 0x21 >       bDescriptorSubType = 0x10 >        RAW dump: >        0x00 | 0x09, 0x21, 0x10, 0x02, 0x00, 0x01, 0x22, 0x8d, >        0x08 | 0x00 > >      Endpoint 0 >         bLength = 0x0007 >         bDescriptorType = 0x0005 >         bEndpointAddress = 0x0081  >         bmAttributes = 0x0003  >         wMaxPacketSize = 0x0008 >         bInterval = 0x0003 >         bRefresh = 0x0000 >         bSynchAddress = 0x0000 > # -- WBR Vladimir Kondratyev