-
Notifications
You must be signed in to change notification settings - Fork 58
Touch Arbitration for USB Tablets
Historically, we turn touch off when stylus is in proximity, in the kernel and X server. So, clients in userland would not get touch events when stylus is active. That was mainly a workaround to cope with the lack of palm rejection on Linux.
To prepare for simultaneous pen and touch support in userland, touch_arbitration parameter is added to kernel 4.9. With touch_arbitration, users have the opportunity to let kernel report touch events along with pen events. This feature has been backported to kernel 3.7 and later in input-wacom.
touch_arbitration can be temporarily changed/set:
1. directly when Wacom kernel driver is loaded: a. modprobe wacom (default state where driver is loaded with arbitration on) b. modprobe wacom touch_arbitration=0 (forced off state) c. modprobe wacom touch_arbitration=1 (forced on state) 2. by the touch_arbitration file at /sys/module/wacom/parameters through commands: a. “echo Y > /sys/module/wacom/parameters/touch_arbitration” (on) b. “echo N > /sys/module/wacom/parameters/touch_arbitration” (off)
Parameter set through above approach will be lost after a system reboot. To make the setting permanent, it needs to go into a static configuration file, which allows the driver to be loaded with the predefined parameter. The configure file can be different with different distributions or versions.
For Fedora and ArchLinux, the following approach is used.
Add wacom.conf to /etc/modprobe.d with the following contents: # this option will load wacom driver with touch arbitration turned on # replace 1 with 0 if you need to turn it off options wacom touch_arbitration=1
Other distributions or versions may use different files. For example, /etc/modules (used by some Ubuntu versions) as well as /etc/modprobe.conf and /etc/rc.modules are found in other Linux distributions.
As the above approach only disables touch arbitration in the kernel, you will also need a way to turn off arbitration in userland. The following approach should serve your testing purposes if you are developing an application that uses simultaneous pen and touch.
The easiest way to enable simultaneous pen and touch in userland is to run a different driver for the pen and the touch.
First, start with a system that supports libinput. The easiest distribution to work with will be one that you will run an X server on, but also supports both Wayland. Wayland support guarantees you will have out of the box libinput support.
Next, From the session manager make sure you are running Xorg, then edit your wacom .conf file in your xorg.conf.d
directory (eg /usr/share/X11/xorg.conf.d/70.wacom.conf
). Comment out the following lines:
#Section "InputClass" # Identifier "Wacom USB touchscreen class" # MatchUSBID "056a:*" # MatchDevicePath "/dev/input/event*" # MatchIsTouchscreen "true" # Driver "wacom" #EndSection #Section "InputClass" # Identifier "Wacom USB touchpad class" # MatchUSBID "056a:*" # MatchDevicePath "/dev/input/event*" # MatchIsTouchpad "true" # Driver "wacom" #EndSection
In this way the touch input will not be handled by xf86-input-wacom but rather by libinput.
Save the file and reboot or re-login to your system.
USB tablets with touch include USB tablet PCs and the Bamboo Pen & Touch series of tablets. Because their stylus/eraser & touch or touch/pad are exported as two separate kernel devices they have some idiosyncrasies we'll explore briefly. BambooPT examples will be shown because except for the pad (tablet buttons) they also apply to a USB tablet PC. See also USB Tablets with Touch in the X driver wiki.
- Installing input-wacom from source
- Tips & Tricks
- Debugging
- Contributing