Re: Touch screen driver for Acer T231H1

From: Milan Obuch <freebsd-usb_at_dino.sk>
Date: Fri, 29 Dec 2023 21:08:35 UTC
On Fri, 29 Dec 2023 16:50:29 +0100 I wrote:

> On Wed, 8 Nov 2023 16:48:32 +0100 I wrote:
> 
> > On Wed, 8 Nov 2023 15:47:32 +0100
> > Tomek CEDRO <tomek@cedro.info> wrote:
> > 
> > > On Wed, Nov 8, 2023 at 11:01 AM Milan Obuch  wrote:
> > > > years ago I bought Acer monitor with touch screen, but did not
> > > > try to use it, it works for me just as an ordinary monitor. I
> > > > decided to give it a try now...
> > > > When plugged into USB port, I see just
> > > > kernel: ugen0.6: <AcerA Bell T231HlTouchScreen> at usbus0
> > > > line in console/dmesg output. Looking into usbconfig output in
> > > > an attempt to get some info, I see
> > > > # usbconfig -d ugen0.6 dump_all_desc
> > > > ugen0.6: <AcerA Bell T231HlTouchScreen> at usbus0, cfg=0 md=HOST
> > > > spd=FULL (12Mbps) pwr=ON (500mA)  
> > > 
> > > Hey there Milan :-) Some time ago I did work with Panasonic
> > > Toughbook laptop touchscreen using x11-drivers/xf86-input-wacom
> > > driver [1]. You may also try the multimedia/webcamd [2] or
> > > sysutils/iichid [3] as the driver. Good luck :-)
> > > 
> > > [1] https://www.freshports.org/x11-drivers/xf86-input-wacom/
> > > [2] https://www.freshports.org/multimedia/webcamd/
> > > [3] https://www.freshports.org/sysutils/iichid/
> > 
> > Do you have some notes from Toughbook? Just to compare...
> > 
> > Also, according to sample config, x11-drivers/xf86-input-wacom uses
> > /dev/input/event for input, I don't know how those get created.
> > (There are four of them.)
> > 
> > With webcam, I am getting
> > 
> > # webcamd -d ugen0.6
> > webcamd 4480 - - Attached to ugen0.6[0]
> > webcamd 4480 - - Creating /dev/input/event6
> > 
> > and now I see some action on touch, but it looks like some
> > calibration is necessary - I have two monitor setup and position
> > set is correct in one axis but offset in the other.
> > 
> > As there is USB used for connection, iichid probably is no help for
> > me :)
> > 
> > So I am a bit better now, with single monitor setup, it would
> > probably work as is (a bit), so some more investigation is
> > necessary.
> > 
> 
> With webcamd, on single monitor it just works, the only issue is I
> need to start it automatically when connected. I think I need some
> custom config file for devd, however, something weird occured here. I
> tried putting following file in /etc/devd directory, and after
> restarting devd, webcamd is started as expected.
> 
> # Acer
> #   Bell
> notify 100 {
> 	match "system"		"USB";
> 	match "subsystem"	"DEVICE";
> 	match "type"		"ATTACH";
> 	match "vendor"		"0x0408";
> 	match "product"		"0x3001";
> 	action "/usr/local/sbin/webcamd -N
> AcerA-Bell-T231HlTouchScreen"; };
> 
> Problem is, for some reason, /dev/input/event6 file is being created,
> but not recognized in X, nothing logged in Xorg.0.log. When starting
> manually, the same file is recognized, logged as
> 
> [786.720] (II) config/udev: Adding input device AcerA Bell
> T231HlTouchScreen (/dev/input/event6) [786.721] (**) AcerA Bell
> T231HlTouchScreen: Applying InputClass "libinput touchscreen catchall"
> [786.721] (II) Using input driver 'libinput' for 'AcerA Bell
> T231HlTouchScreen' [786.721] (**) AcerA Bell T231HlTouchScreen: always
> reports core events [786.721] (**) Option "Device" "/dev/input/event6"
> [786.851] (II) event6  - AcerA Bell T231HlTouchScreen: is tagged by
> udev as: Touchscreen [786.855] (II) event6  - AcerA Bell
> T231HlTouchScreen: device is a touch device [786.881] (II) event6  -
> AcerA Bell T231HlTouchScreen: device removed [786.893] (**) Option
> "config_info" "udev:/dev/input/event6" [786.893] (II) XINPUT: Adding
> extended input device "AcerA Bell T231HlTouchScreen" (type:
> TOUCHSCREEN, id 12) [786.902] (**) Option "AccelerationScheme" "none"
> [786.931] (**) AcerA Bell T231HlTouchScreen: (accel) selected scheme
> none/0 [786.932] (**) AcerA Bell T231HlTouchScreen: (accel)
> acceleration factor: 2000 [786.932] (**) AcerA Bell T231HlTouchScreen:
> (accel) acceleration threshold: 4 [787.060] (II) event6  - AcerA Bell
> T231HlTouchScreen: is tagged by udev as: Touchscreen [787.064] (II)
> event6  - AcerA Bell T231HlTouchScreen: device is a touch device
> 
> [809.940] (II) config/udev: removing device AcerA Bell
> T231HlTouchScreen [809.941] (II) event6  - AcerA Bell
> T231HlTouchScreen: device removed [810.056] (II) UnloadModule:
> "libinput"
> 
> (last 3 lines are from detachment).
> 
> Anybody with some hint? I need starting webcamd automatically, which
> seems to work, but what makes X not recognize created input file?
> 

Some additional info: I did the same test on 13-STABLE and 14-STABLE,
no difference in behavior. Also, no matter how the webcamd was invoked,
manually or via devd entry, device created (/dev/input/eventX) has the
same rights and ownership,

crw-rw----  1 webcamd  webcamd   0x84 Dec 29 22:01 eventX

(X = 6 or 7 depending on system under test). I am out of ideas what the
difference could be there. Could there be some signalling missing when
webcamd is invoked from devd? I should probably ask on X mailing
list... but nevertheless, maybe someone knows :)

Regards,
Milan