From nobody Thu Nov 9 08:10:10 2023 X-Original-To: freebsd-x11@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 UTF8SMTP id 4SQvlD0Ql9z50bn2 for ; Thu, 9 Nov 2023 08:10:16 +0000 (UTC) (envelope-from freebsd-x11@dino.sk) Received: from cm0.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with UTF8SMTPS id 4SQvlC0wcNz3MLW for ; Thu, 9 Nov 2023 08:10:14 +0000 (UTC) (envelope-from freebsd-x11@dino.sk) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of freebsd-x11@dino.sk designates 84.245.65.72 as permitted sender) smtp.mailfrom=freebsd-x11@dino.sk; dmarc=none Received: from zeta.dino.sk ([84.245.95.254]) (AUTH: LOGIN milan, TLS: TLSv1.3,256bits,TLS_AES_256_GCM_SHA384) by cm0.netlabit.sk with ESMTPSA id 00000000024204B4.00000000654C93E3.0000B689; Thu, 09 Nov 2023 09:10:11 +0100 Date: Thu, 9 Nov 2023 09:10:10 +0100 From: Milan Obuch To: freebsd-x11@freebsd.org Subject: Touch screen with X multi monitor setup Message-ID: <20231109091010.349608ef@zeta.dino.sk> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; amd64-portbld-freebsd13.1) List-Id: X11 List-Archive: https://lists.freebsd.org/archives/freebsd-x11 List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-x11@freebsd.org X-BeenThere: freebsd-x11@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-3.29 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.99)[-0.986]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[freebsd-x11@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[dino.sk]; ARC_NA(0.00)[]; ASN(0.00)[asn:5578, ipnet:84.245.64.0/18, country:SK]; FROM_HAS_DN(0.00)[]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4SQvlC0wcNz3MLW X-Spamd-Bar: --- Hi, after some years using Acer T231H1 monitor for its monitor role, I decided now to try its touch screen interface. It uses USB interface, plugging it into my workstation shows just kernel: ugen0.6: at usbus0 in dmesg/console output. One hint I've got was use multimedia/webcamd, and, indeed, running # webcamd -d ugen0.6 webcamd 4480 - - Attached to ugen0.6[0] webcamd 4480 - - Creating /dev/input/event6 makes me partially happy - X now automagically knows about my touchscreen and touches are 'converted' into clicks at some absolute location. In Xorg.0.log, I found following lines relevant to this: [3835573.898] (II) config/udev: Adding input device AcerA Bell T231HlTouchScreen (/dev/input/event6) [3835573.899] (**) AcerA Bell T231HlTouchScreen: Applying InputClass "libinput touchscreen catchall" [3835573.899] (II) Using input driver 'libinput' for 'AcerA Bell T231HlTouchScreen' [3835573.899] (**) AcerA Bell T231HlTouchScreen: always reports core events [3835573.900] (**) Option "Device" "/dev/input/event6" [3835574.032] (II) event6 - AcerA Bell T231HlTouchScreen: is tagged by udev as: Touchscreen [3835574.035] (II) event6 - AcerA Bell T231HlTouchScreen: device is a touch device [3835574.047] (II) event6 - AcerA Bell T231HlTouchScreen: device removed [3835574.060] (**) Option "config_info" "udev:/dev/input/event6" [3835574.060] (II) XINPUT: Adding extended input device "AcerA Bell T231HlTouchScreen" (type: TOUCHSCREEN, id 12) [3835574.086] (**) Option "AccelerationScheme" "none" [3835574.117] (**) AcerA Bell T231HlTouchScreen: (accel) selected scheme none/0 [3835574.117] (**) AcerA Bell T231HlTouchScreen: (accel) acceleration factor: 2.000 [3835574.117] (**) AcerA Bell T231HlTouchScreen: (accel) acceleration threshold: 4 [3835574.253] (II) event6 - AcerA Bell T231HlTouchScreen: is tagged by udev as: Touchscreen [3835574.257] (II) event6 - AcerA Bell T231HlTouchScreen: device is a touch device So far so good, if I were using single monitor setup for this box, probably everything would be just right. That's not the case, however, and this is where things are starting to be somewhat cmplicated. Reduced output from 'xrandr' is Screen 0: minimum 320 x 200, current 2944 x 1080, maximum 8192 x 8192 DVI-D-1 connected primary 1920x1080+1024+0 (normal left inverted right x axis y axis) 510mm x 287mm 1920x1080 60.00*+ 59.96 59.93 [ deleted inactive resolutions ] VGA-1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 1024x768 60.04 60.00* [ deleted inactive resolutions ] Acer monitor with touch screen is connected via DVI-D-1 connector in this case. Problem is absolute location of touch being not correct, coordinate Y (up/down) is OK, but coordinate X (left/right) is not. When touching near right edge of screen, it is almost correct, as seen where cursor is being placed after touch, but when touching elsewhere, cursor is located left of the place being touched, proportionally, so when touching near left edge of screen, cursor is being located onto left, non touch screen, monitor. This is probably caused by stretching touch area (1920x1080) over whole virtual screen (2944x1080). Could I describe it better? Probably yes, hopefully it is accurate. Could someone give me a hint what I can try to fix this issue? Probably some config file for this device could remedy it, but I have no idea where to start. In past, I used some monolitic static configuration file. As it was not necessary for some time, I am using just what's autoconfigured and changing setup with xrandr in multi monitor case. I found graphics/tslib could be used for various touch screen processing, I just have no understanding now where it would fit into the whole thing... And, one more idea, how could I use multiple touch screen monitors? At present, I have no such setup, but there are various small computers with multiple video connectors, often dual HDMI, so I can imagine it could be usefull. And how about rotated screen? For tablets and touch screen notebooks, it could be often the case (my GPD small notebook, not touch screen, has 1280x720 resolution, but it is actually rotated 720x1280 screen). Regards, Milan