From nobody Tue Aug 10 04:03:12 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 6D1DB1751912 for ; Tue, 10 Aug 2021 04:03:20 +0000 (UTC) (envelope-from mark@kane.mn) Received: from stinger.tntpowerhost.com (stinger.tntpowerhost.com [104.128.58.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "stinger.tntpowerhost.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GkK7C3f4Fz4tRk; Tue, 10 Aug 2021 04:03:19 +0000 (UTC) (envelope-from mark@kane.mn) Received: from stinger.tntpowerhost.com (localhost [127.0.0.1]) by stinger.tntpowerhost.com (OpenSMTPD) with ESMTP id 0a9af403; Mon, 9 Aug 2021 23:03:12 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kane.mn; h= mime-version:date:from:to:cc:subject:in-reply-to:references :message-id:content-type:content-transfer-encoding; s=stinger; bh=WgMZKFkNmuW+FGfcIHreZuS0iTLeFHsbbjpUZJn7z/c=; b=TaZMhWyd6G/R Ms2jEvOdbzfZRu+ppRG0ucuYdPCmkvU8YydMemDd3HWC/lNN0hCmIV0hJal7v5u3 rgVhS8Pt+z6bGANkMLkGqp0I3e+9mXi3GDIcBFDZxlXsDPCmjAAwedShgycZ6mfz 8WYHqKTpG6/im4pFH8wpTrhfO0MRhdo= Received: from stinger.tntpowerhost.com (localhost [127.0.0.1]) by stinger.tntpowerhost.com (OpenSMTPD) with ESMTPSA id c1884606 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Mon, 9 Aug 2021 23:03:12 -0500 (CDT) 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 Date: Mon, 09 Aug 2021 23:03:12 -0500 From: Mark Kane To: Vladimir Kondratyev Cc: usb@freebsd.org, hps@selasky.org Subject: Re: eGalax USB touchscreen issues In-Reply-To: <168b368c-3258-6416-42c5-a722e45bf14b@FreeBSD.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> User-Agent: Roundcube Webmail/1.4.6 Message-ID: X-Sender: mark@kane.mn Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GkK7C3f4Fz4tRk X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=kane.mn header.s=stinger header.b=TaZMhWyd; dmarc=pass (policy=none) header.from=kane.mn; spf=pass (mx1.freebsd.org: domain of mark@kane.mn designates 104.128.58.83 as permitted sender) smtp.mailfrom=mark@kane.mn X-Spamd-Result: default: False [-4.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[kane.mn:s=stinger]; FREEFALL_USER(0.00)[mark]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:104.128.58.83]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[kane.mn:+]; DMARC_POLICY_ALLOW(-0.50)[kane.mn,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:30455, ipnet:104.128.58.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 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! :) 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: 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 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 (?). With usbhid disabled uep(4) attaches in evdev mode and X gets the input device but no events are heard: ugen0.3: at usbus0 uep0 on uhub1 uep0: on usbus0 [ 59.002] (II) config/udev: Adding input device eGalax Inc. USB TouchController (/dev/input/event5) [ 59.002] (**) eGalax Inc. USB TouchController: Applying InputClass "evdev touchscreen catchall" [ 59.002] (**) eGalax Inc. USB TouchController: Applying InputClass "libinput touchscreen catchall" [ 59.002] (II) Using input driver 'libinput' for 'eGalax Inc. USB TouchController' [ 59.002] (**) eGalax Inc. USB TouchController: always reports core events [ 59.002] (**) Option "Device" "/dev/input/event5" [ 59.002] (**) Option "_source" "server/udev" [ 59.005] (II) event5 - eGalax Inc. USB TouchController, class 0/0, rev 1.10/1.00, addr 3: is tagged by udev as: Touchscreen [ 59.006] (II) event5 - eGalax Inc. USB TouchController, class 0/0, rev 1.10/1.00, addr 3: device is a touch device [ 59.007] (II) event5 - eGalax Inc. USB TouchController, class 0/0, rev 1.10/1.00, addr 3: device removed [ 59.007] (**) Option "config_info" "udev:/dev/input/event5" [ 59.007] (II) XINPUT: Adding extended input device "eGalax Inc. USB TouchController" (type: TOUCHSCREEN, id 11) [ 59.007] (**) Option "AccelerationScheme" "none" [ 59.007] (**) eGalax Inc. USB TouchController: (accel) selected scheme none/0 [ 59.007] (**) eGalax Inc. USB TouchController: (accel) acceleration factor: 2.000 [ 59.007] (**) eGalax Inc. USB TouchController: (accel) acceleration threshold: 4 [ 59.010] (II) event5 - eGalax Inc. USB TouchController, class 0/0, rev 1.10/1.00, addr 3: is tagged by udev as: Touchscreen [ 59.011] (II) event5 - eGalax Inc. USB TouchController, class 0/0, rev 1.10/1.00, addr 3: device is a touch device # evemu-record Available devices: /dev/input/event0: System mouse /dev/input/event1: System keyboard multiplexer /dev/input/event2: Power Button /dev/input/event3: Sleep Button /dev/input/event4: Lite-On Technology Corp. USB Multimedia Keyboard, class 0/0, rev 1.10/1.09, add /dev/input/event5: eGalax Inc. USB TouchController, class 0/0, rev 1.10/1.00, addr 3 Select the device event number [0-5]: 5 # EVEMU 1.3 # Kernel: 13.0-RELEASE-p3 # Input device name: "eGalax Inc. USB TouchController, class 0/0, rev 1.10/1.00, addr 3" # Input device ID: bus 0x03 vendor 0xeef product 0x01 version 0000 # Supported events: # Event type 0 (EV_SYN) # Event code 0 (SYN_REPORT) # Event code 1 (SYN_CONFIG) # Event code 2 (SYN_MT_REPORT) # Event code 3 (SYN_DROPPED) # Event code 4 ((null)) # Event code 5 ((null)) # Event code 6 ((null)) # Event code 7 ((null)) # Event code 8 ((null)) # Event code 9 ((null)) # Event code 10 ((null)) # Event code 11 ((null)) # Event code 12 ((null)) # Event code 13 ((null)) # Event code 14 ((null)) # Event code 15 (SYN_MAX) # Event type 1 (EV_KEY) # Event code 330 (BTN_TOUCH) # Event type 3 (EV_ABS) # Event code 0 (ABS_X) # Value 0 # Min 0 # Max 2047 # Fuzz 0 # Flat 0 # Resolution 0 # Event code 1 (ABS_Y) # Value 0 # Min 0 # Max 2047 # Fuzz 0 # Flat 0 # Resolution 0 # Properties: # Property type 1 (INPUT_PROP_DIRECT) N: eGalax Inc. USB TouchController, class 0/0, rev 1.10/1.00, addr 3 I: 0003 0eef 0001 0000 P: 02 00 00 00 00 00 00 00 B: 00 0b 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 04 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 02 00 00 00 00 00 00 00 00 B: 03 03 00 00 00 00 00 00 00 B: 04 00 00 00 00 00 00 00 00 B: 05 00 00 00 00 00 00 00 00 B: 11 00 00 00 00 00 00 00 00 B: 12 00 00 00 00 00 00 00 00 B: 14 00 00 00 00 00 00 00 00 B: 15 00 00 00 00 00 00 00 00 B: 15 00 00 00 00 00 00 00 00 A: 00 0 2047 0 0 0 A: 01 0 2047 0 0 0 ################################ # Waiting for events # ################################ [...no events...] Trying uep(4) in native mode with xf86-input-egalax also had the same, uep(4) attached but no events when testing with xinput. # 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 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 #