Touchscreen support

olli@

Developer
I would like to buy a small monitor with touchscreen feature, e.g. this one or this one (non-affiliate Amazon links).
Since I haven’t used a touchscreen with FreeBSD before, I have a few questions …
  1. Does FreeBSD support the touchscreen feature of monitors like the ones above? (Apparently it’s connected via USB and uses the uhid protocol. Windows doesn’t need a proprietary vendor driver, so I assume the touch function uses some standard protocol.)
  2. I would like to use the touchscreen feature from within my own program (in C or Python). Is this possible?
  3. Does it work in the text console (vt(4)), too, or does it require an X.org driver? Would be cool if I had both options, so I could write text-based (curses(3)) programs that react to touch gestures, as well as X.org-based programs (e.g. Python + Tkinter).
I do not need it as a mouse replacement, e.g. to control a browser with the touchscreen. Would be ok if that worked, too, but I don’t really need it.
 
It would be interesting to know. The touch function uses an usb connector, so if it behaves like a usb mouse / touchpad it could probably work in console too. No personal experience with these, sorry.
 
It's traditionally been spotty, but I haven't tried it in a while. It's likely you'd be better off buying an older model (ELO was once the standard) so there might have been someone who did the work to figure out how to make it work at some point in the past. These monitors tend to disappear as fast as they appear (One of your links is already dead a month later). I have 4 though monitors and only my ELO is still available.
 
Sorry for bringing this thread up again, but I still need an answer. I bought a random touchscreen from Amazon (this one), hoping to be lucky, but alas ... While the HDMI display works, the USB touchscreen feature is not recognized by FreeBSD 13 (I tried every driver I could think of, including webcamd). It works fine with Windows and Linux out of the box, though.

So the question remains. Does anymore know of a small touchscreen monitor that definitely works with FreeBSD? Preferably one that I could order in Germany without having to spend 100 € for shipping from abroad.
 
I have bought a dozen touchscreens. From AIO&Tablets to standalone, I2C and wmt.
Someday I hope to buckle down and figure them out.
wmt devices load the driver automatically. That seems to be my best attempt
So from there you must get it working with evdev and libinput.
I also had some luck with eGalax(4) touchscreens.
 
I know that it works on some laptop: the hp pavillon x2 should work with the wmt driver (combined with evdev driver)
 
I bought a random touchscreen from Amazon
Can we drill down on your needs. Looking at the link that is a Pi Screen. Those are going to take a whole lot more work than an amd64 based device. FDT overlays and the such on Arm.

So you are looking for 7" LCD touchscreen with USB input roughly? For what platform?
 
wmt devices load the driver automatically. That seems to be my best attempt
So from there you must get it working with evdev and libinput.
Unfortunately, typing “wmt” in the search box on Amazon doesn’t give useful results …
 
I am sorry. I failed to leave a reference to wmt(4). It is not a device per say.

How about hitting the bsd hardware lists and see what is in use?


Absent that I would consider contacting Vladimir. He is our touchscreen expert.
 
Can we drill down on your needs. Looking at the link that is a Pi Screen.
That screen can be used with a RasPi, but it’s not RasPi-specific. It can be connected via HDMI + USB to a regular PC (adm64), and the touch feature is recognized as a standard USB HID device by both Windows and Linux out of the box. But I was unable to make it work with FreeBSD, unfortunately. It is listed in the output of usbconfig (“ugen”), but I cannot use it.

So you are looking for 7" LCD touchscreen with USB input roughly? For what platform?
I’m sorry, I should have been clearer.

Basically I’m looking for a smallish touchscreen for a regular amd64 PC:
  • Roughly in the range 7″ to 12″. Somewhat larger would be ok, too.
  • Resolution doesn’t matter much. 720p would be fine.
  • LCD or OLED or whatever, I don’t care, even a monochrome display would be acceptable.
  • I want to connect it to a regular amd64 PC running FreeBSD.
  • Preferably via HDMI or DisplayPort, but DVI or VGA would be ok (I’ve got converter dongles).
  • The touch feature should be connected via USB, because that’s what my PC has.
  • I would like to be able to recognize touch actions from within my own programs (Python or C). If I can do that via regular X11 events (as if it was a regular X11 pointer device or similar), that would be fine.
 
With the eGalax driver it is based on a class of touchscreen controllers.
Nowhere on the touchscreen device packaging will you see 'eGalax'. It is the driver nickname and the same on Linux.
Several brand goods use this eGalax controller.
It is found in both laptops with touch screens and stand alone touch screen displays.

I really can't give a good recommendation. Usually I can point you to an ebay page.
I have 4+ AIO and 4+ tablets and some touch displays. So I need to get cracking.
This is on my bucket list. Kiosk with input. Not a glorified media player.

At least now we are identifying the drivers needed to try.


which I use on one of my laptops.
So are you using evdev under Xorg?
 
No idea about the differences between wmt(4) and hmt(4).

The difference seems to be USB.
1652114431807.png
 
I don't mean to dump on your thread but I finally have time to try out my 'All In One' Flat Panels with Touch Screen..

#1
VISIX 1000P
10.4" Room Meeting Digital Signage. E3845 with 4GB and em0/POE
Code:
ugen0.5: <ILITEK Multi-Touch-V3000> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (200mA)

Code:
em0: link state changed to UP
ugen0.5: <ILITEK Multi-Touch-V3000> at usbus0
ukbd1 on uhub2
ukbd1: <ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 4> on usbus0
kbd3 at ukbd1
wmt0: <ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 4> on usbus0
wmt0: Multitouch touchscreen with 0 external buttons
wmt0: 10 contacts and []. Report range [0:0] - [16384:9600]

Code:
ls /dev/input
event0    event1    event2    event3    event4    event5    event6    event7    event8

Relevant /var/log/Xorg.0.log
Code:
[   264.525] (II) event4  - AT keyboard: is tagged by udev as: Keyboard
[   264.527] (II) event4  - AT keyboard: device is a keyboard
[   264.538] (II) config/udev: Adding input device ILITEK Multi-Touch-V3000 (/dev/input/event5)
[   264.538] (**) ILITEK Multi-Touch-V3000: Applying InputClass "evdev keyboard catchall"
[   264.538] (**) ILITEK Multi-Touch-V3000: Applying InputClass "Evdev keyboard"
[   264.538] (**) ILITEK Multi-Touch-V3000: Applying InputClass "libinput keyboard catchall"
[   264.538] (II) Using input driver 'libinput' for 'ILITEK Multi-Touch-V3000'
[   264.538] (**) ILITEK Multi-Touch-V3000: always reports core events
[   264.538] (**) Option "Device" "/dev/input/event5"
[   264.539] (**) Option "_source" "server/udev"
[   264.544] (II) event5  - ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2: is tagged by udev as: Keyboard
[   264.546] (II) event5  - ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2: device is a keyboard
[   264.553] (II) event5  - ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2: device removed
[   264.553] (**) Option "config_info" "udev:/dev/input/event5"
[   264.553] (II) XINPUT: Adding extended input device "ILITEK Multi-Touch-V3000" (type: KEYBOARD, id 11)
[   264.553] (**) Option "xkb_rules" "evdev"
[   264.559] (II) event5  - ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2: is tagged by udev as: Keyboard
[   264.560] (II) event5  - ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2: device is a keyboard
[   264.567] (II) config/udev: Adding input device ILITEK Multi-Touch-V3000 (/dev/input/event6)
[   264.567] (**) ILITEK Multi-Touch-V3000: Applying InputClass "evdev touchscreen catchall"
[   264.567] (**) ILITEK Multi-Touch-V3000: Applying InputClass "libinput touchscreen catchall"
[   264.567] (II) Using input driver 'libinput' for 'ILITEK Multi-Touch-V3000'
[   264.567] (**) ILITEK Multi-Touch-V3000: always reports core events
[   264.567] (**) Option "Device" "/dev/input/event6"
[   264.568] (**) Option "_source" "server/udev"
[   264.573] (II) event6  - ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2: is tagged by udev as: Touchscreen
[   264.575] (II) event6  - ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2: device is a touch device
[   264.580] (II) event6  - ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2: device removed
[   264.580] (**) Option "config_info" "udev:/dev/input/event6"
[   264.580] (II) XINPUT: Adding extended input device "ILITEK Multi-Touch-V3000" (type: TOUCHSCREEN, id 12)
[   264.580] (**) Option "AccelerationScheme" "none"
[   264.581] (**) ILITEK Multi-Touch-V3000: (accel) selected scheme none/0
[   264.581] (**) ILITEK Multi-Touch-V3000: (accel) acceleration factor: 2.000
[   264.581] (**) ILITEK Multi-Touch-V3000: (accel) acceleration threshold: 4
[   264.586] (II) event6  - ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2: is tagged by udev as: Touchscreen
[   264.588] (II) event6  - ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2: device is a touch device
 
This message from /xf86-input-evdev really does not help much.
I guess you just plug in settings and retry until it works?

Code:
Xorg-server has been installed.

If your kernel is compiled with the EVDEV_SUPPORT option enabled
(default starting from FreeBSD 12.1) it is recommended to enable evdev mode in
pointer device drivers like ums(4) and psm(4). This will give improvements like
better tilt wheel support for mice and centralized gesture support via
xf86-input-synaptics or libinput drivers for touchpads.

This is also needed for PS/2 devices to be properly detected by Xorg when
moused service is disabled in /etc/rc.conf and kernel is compiled with
EVDEV_SUPPORT.

To enable evdev in such a device, run the following:

# sysctl kern.evdev.rcpt_mask=6

To make it persistent across reboots, add the following to /etc/sysctl.conf:

kern.evdev.rcpt_mask=6

In case you're using a serial mouse or any other mouse that *only* works over
sysmouse(4) and moused(8) on an evdev enabled kernel, please run this:

# sysctl kern.evdev.rcpt_mask=3

To make it persistent across reboots, add to this /etc/sysctl.conf:

kern.evdev.rcpt_mask=3
=====
 
For troubleshooting evdev input events: devel/evemu
Here I am attempting to determine if Event 5 or Event 6 is the device used.
Code:
# 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:    AT keyboard
/dev/input/event5:    ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2
/dev/input/event6:    ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2
/dev/input/event7:    vendor 0x1241 USB Keyboard, class 0/0, rev 1.10/2.80, addr 3
Select the device event number [0-7]: 5
# EVEMU 1.3
# Kernel: 13.1-RC6
# Input device name: "ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2"
# Input device ID: bus 0x03 vendor 0x222a 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 0 (KEY_RESERVED)
#     Event code 1 (KEY_ESC)
#     Event code 2 (KEY_1)
#     Event code 3 (KEY_2)
#     Event code 4 (KEY_3)
#     Event code 5 (KEY_4)
#     Event code 6 (KEY_5)
#     Event code 7 (KEY_6)
#     Event code 8 (KEY_7)
#     Event code 9 (KEY_8)
#     Event code 10 (KEY_9)
#     Event code 11 (KEY_0)
#     Event code 12 (KEY_MINUS)
#     Event code 13 (KEY_EQUAL)
#     Event code 14 (KEY_BACKSPACE)
#     Event code 15 (KEY_TAB)
#     Event code 16 (KEY_Q)
#     Event code 17 (KEY_W)
#     Event code 18 (KEY_E)
#     Event code 19 (KEY_R)
#     Event code 20 (KEY_T)
#     Event code 21 (KEY_Y)
#     Event code 22 (KEY_U)
#     Event code 23 (KEY_I)
#     Event code 24 (KEY_O)
#     Event code 25 (KEY_P)
#     Event code 26 (KEY_LEFTBRACE)
#     Event code 27 (KEY_RIGHTBRACE)
#     Event code 28 (KEY_ENTER)
#     Event code 29 (KEY_LEFTCTRL)
#     Event code 30 (KEY_A)
#     Event code 31 (KEY_S)
#     Event code 32 (KEY_D)
#     Event code 33 (KEY_F)
#     Event code 34 (KEY_G)
#     Event code 35 (KEY_H)
#     Event code 36 (KEY_J)
#     Event code 37 (KEY_K)
#     Event code 38 (KEY_L)
#     Event code 39 (KEY_SEMICOLON)
#     Event code 40 (KEY_APOSTROPHE)
#     Event code 41 (KEY_GRAVE)
#     Event code 42 (KEY_LEFTSHIFT)
#     Event code 43 (KEY_BACKSLASH)
#     Event code 44 (KEY_Z)
#     Event code 45 (KEY_X)
#     Event code 46 (KEY_C)
#     Event code 47 (KEY_V)
#     Event code 48 (KEY_B)
#     Event code 49 (KEY_N)
#     Event code 50 (KEY_M)
#     Event code 51 (KEY_COMMA)
#     Event code 52 (KEY_DOT)
#     Event code 53 (KEY_SLASH)
#     Event code 54 (KEY_RIGHTSHIFT)
#     Event code 55 (KEY_KPASTERISK)
#     Event code 56 (KEY_LEFTALT)
#     Event code 57 (KEY_SPACE)
#     Event code 58 (KEY_CAPSLOCK)
#     Event code 59 (KEY_F1)
#     Event code 60 (KEY_F2)
#     Event code 61 (KEY_F3)
#     Event code 62 (KEY_F4)
#     Event code 63 (KEY_F5)
#     Event code 64 (KEY_F6)
#     Event code 65 (KEY_F7)
#     Event code 66 (KEY_F8)
#     Event code 67 (KEY_F9)
#     Event code 68 (KEY_F10)
#     Event code 69 (KEY_NUMLOCK)
#     Event code 70 (KEY_SCROLLLOCK)
#     Event code 71 (KEY_KP7)
#     Event code 72 (KEY_KP8)
#     Event code 73 (KEY_KP9)
#     Event code 74 (KEY_KPMINUS)
#     Event code 75 (KEY_KP4)
#     Event code 76 (KEY_KP5)
#     Event code 77 (KEY_KP6)
#     Event code 78 (KEY_KPPLUS)
#     Event code 79 (KEY_KP1)
#     Event code 80 (KEY_KP2)
#     Event code 81 (KEY_KP3)
#     Event code 82 (KEY_KP0)
#     Event code 83 (KEY_KPDOT)
#     Event code 85 (KEY_ZENKAKUHANKAKU)
#     Event code 86 (KEY_102ND)
#     Event code 87 (KEY_F11)
#     Event code 88 (KEY_F12)
#     Event code 89 (KEY_RO)
#     Event code 90 (KEY_KATAKANA)
#     Event code 91 (KEY_HIRAGANA)
#     Event code 92 (KEY_HENKAN)
#     Event code 93 (KEY_KATAKANAHIRAGANA)
#     Event code 94 (KEY_MUHENKAN)
#     Event code 95 (KEY_KPJPCOMMA)
#     Event code 96 (KEY_KPENTER)
#     Event code 97 (KEY_RIGHTCTRL)
#     Event code 98 (KEY_KPSLASH)
#     Event code 99 (KEY_SYSRQ)
#     Event code 100 (KEY_RIGHTALT)
#     Event code 102 (KEY_HOME)
#     Event code 103 (KEY_UP)
#     Event code 104 (KEY_PAGEUP)
#     Event code 105 (KEY_LEFT)
#     Event code 106 (KEY_RIGHT)
#     Event code 107 (KEY_END)
#     Event code 108 (KEY_DOWN)
#     Event code 109 (KEY_PAGEDOWN)
#     Event code 110 (KEY_INSERT)
#     Event code 111 (KEY_DELETE)
#     Event code 113 (KEY_MUTE)
#     Event code 114 (KEY_VOLUMEDOWN)
#     Event code 115 (KEY_VOLUMEUP)
#     Event code 116 (KEY_POWER)
#     Event code 117 (KEY_KPEQUAL)
#     Event code 119 (KEY_PAUSE)
#     Event code 121 (KEY_KPCOMMA)
#     Event code 122 (KEY_HANGEUL)
#     Event code 123 (KEY_HANJA)
#     Event code 124 (KEY_YEN)
#     Event code 125 (KEY_LEFTMETA)
#     Event code 126 (KEY_RIGHTMETA)
#     Event code 127 (KEY_COMPOSE)
#     Event code 128 (KEY_STOP)
#     Event code 129 (KEY_AGAIN)
#     Event code 130 (KEY_PROPS)
#     Event code 131 (KEY_UNDO)
#     Event code 132 (KEY_FRONT)
#     Event code 133 (KEY_COPY)
#     Event code 134 (KEY_OPEN)
#     Event code 135 (KEY_PASTE)
#     Event code 136 (KEY_FIND)
#     Event code 137 (KEY_CUT)
#     Event code 138 (KEY_HELP)
#     Event code 140 (KEY_CALC)
#     Event code 142 (KEY_SLEEP)
#     Event code 150 (KEY_WWW)
#     Event code 152 (KEY_COFFEE)
#     Event code 158 (KEY_BACK)
#     Event code 159 (KEY_FORWARD)
#     Event code 161 (KEY_EJECTCD)
#     Event code 163 (KEY_NEXTSONG)
#     Event code 164 (KEY_PLAYPAUSE)
#     Event code 165 (KEY_PREVIOUSSONG)
#     Event code 166 (KEY_STOPCD)
#     Event code 173 (KEY_REFRESH)
#     Event code 176 (KEY_EDIT)
#     Event code 177 (KEY_SCROLLUP)
#     Event code 178 (KEY_SCROLLDOWN)
#     Event code 183 (KEY_F13)
#     Event code 184 (KEY_F14)
#     Event code 185 (KEY_F15)
#     Event code 186 (KEY_F16)
#     Event code 187 (KEY_F17)
#     Event code 188 (KEY_F18)
#     Event code 189 (KEY_F19)
#     Event code 190 (KEY_F20)
#     Event code 191 (KEY_F21)
#     Event code 192 (KEY_F22)
#     Event code 193 (KEY_F23)
#     Event code 194 (KEY_F24)
#   Event type 17 (EV_LED)
#     Event code 0 (LED_NUML)
#        State 0
#     Event code 1 (LED_CAPSL)
#        State 0
#     Event code 2 (LED_SCROLLL)
#        State 0
#   Event type 20 (EV_REP)
#     Event code 0 (REP_DELAY)
#     Event code 1 (REP_PERIOD)
# Properties:
N: ILITEK Multi-Touch-V3000, class 0/0, rev 2.00/0.00, addr 2
I: 0003 222a 0001 0000
P: 00 00 00 00 00 00 00 00
B: 00 0b 00 00 00 00 00 00 00
B: 01 ff ff ff ff ff ff ff ff
B: 01 ff ff ef ff df ff be fe
B: 01 ff 57 40 c1 7a 20 87 ff
B: 01 07 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 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 00 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 07 00 00 00 00 00 00 00
B: 12 00 00 00 00 00 00 00 00
B: 14 03 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
################################
#      Waiting for events      #
################################

So I get movement onscreen of my pointer in Xfce4.
Nothing showing in Event 5 so touch must be Event 6.
Yup.
Code:
E: 6.704984 0000 0000 0001    # ------------ SYN_REPORT (1) ---------- +8ms
E: 6.711984 0003 002f 0000    # EV_ABS / ABS_MT_SLOT          0
E: 6.711984 0003 0035 3843    # EV_ABS / ABS_MT_POSITION_X    3843
E: 6.711984 0003 0036 6958    # EV_ABS / ABS_MT_POSITION_Y    6958
E: 6.711984 0003 002f 0001    # EV_ABS / ABS_MT_SLOT          1
E: 6.711984 0003 0035 4410    # EV_ABS / ABS_MT_POSITION_X    4410
E: 6.711984 0003 0036 5745    # EV_ABS / ABS_MT_POSITION_Y    5745
E: 6.711984 0003 002f 0003    # EV_ABS / ABS_MT_SLOT          3
E: 6.711984 0003 0039 -001    # EV_ABS / ABS_MT_TRACKING_ID   -1
E: 6.711984 0003 0000 3843    # EV_ABS / ABS_X                3843
E: 6.711984 0003 0001 6958    # EV_ABS / ABS_Y                6958
E: 6.711984 0000 0000 0001    # ------------ SYN_REPORT (1) ---------- +7ms
E: 6.718982 0003 002f 0000    # EV_ABS / ABS_MT_SLOT          0
E: 6.718982 0003 0035 3720    # EV_ABS / ABS_MT_POSITION_X    3720
E: 6.718982 0003 0036 6975    # EV_ABS / ABS_MT_POSITION_Y    6975
E: 6.718982 0003 002f 0001    # EV_ABS / ABS_MT_SLOT          1
E: 6.718982 0003 0039 -001    # EV_ABS / ABS_MT_TRACKING_ID   -1
E: 6.718982 0003 0000 3720    # EV_ABS / ABS_X                3720
E: 6.718982 0003 0001 6975    # EV_ABS / ABS_Y                6975
E: 6.718982 0000 0000 0001    # ------------ SYN_REPORT (1) ---------- +7ms
E: 6.724980 0003 002f 0000    # EV_ABS / ABS_MT_SLOT          0
E: 6.724980 0003 0039 -001    # EV_ABS / ABS_MT_TRACKING_ID   -1
E: 6.724980 0001 014a 0000    # EV_KEY / BTN_TOUCH            0
E: 6.724980 0000 0000 0001    # ------------ SYN_REPORT (1) ---------- +6ms
 
OK I finally patched together the last piece of the puzzle. Screen Taps.
I could drag the cursor around with my finger but no taps worked. Useless.

Now I tested on another touch AIO and got it working. I have touch and can use xfce4 menu.
/usr/local/etc/X11/xorg.conf.d/30-tap.conf
Code:
Section "InputClass"
Identifier "touchpad"
Driver "libinput"
  MatchIsTouchpad "on"
  Option "Tapping" "on"
  Option "NaturalScrolling" "on"
  Option "ClickMethod" "clickfinger"
EndSection
 
Back
Top