Lenovo Miix 520 - Input devices stop working for arbitrary period when other input devices are used (Touchpad, Touchscreen, Wacom Pen)

Hi All,

I’ve been slowly troubleshooting my way toward using my Lenovo Miix 520 as a daily linux driver. Today I’ve been presented with one of those problems that seemingly came out of nowhere.

If I use the touchscreen, the touchpad will stop responding. If I use the Lenovo Active Pen (a Wacom pen), the touchscreen will cease responding to finger touch input. This kind of breaks the whole experience, and seems to have come out of nowhere!

I had been playing with xsetwacomto try and get the buttons on the pen to correspond to right and middle click, to no avail about a week ago. I then used the tablet for a couple of days with no issue, and this appears to have begun to occur today. Interestingly, all the device names have changed.

I had been running 5.xx kernel but tried booting in 4.19.30 to see if this resolved the problem, to no avail.

Finally, I did find this lenovo issue on their support page, but the problem is for Windows. Assuming this is a driver issue but not sure where to start in Manjaro!

https://forums.lenovo.com/t5/ThinkPad-S-Series-ThinkPad-Yoga/Touchscreen-stops-working-after-using-pen/td-p/3391464

$ inxi -Fxzc0
System:
  Host: a-pc Kernel: 4.19.30-1-MANJARO x86_64 bits: 64 compiler: gcc 
  v: 8.2.1 Desktop: Gnome 3.30.2 Distro: Manjaro Linux 
Machine:
  Type: Detachable System: LENOVO product: 20M3 v: MIIX 520-12IKB 
  serial: <filter> 
  Mobo: LENOVO model: LNVNB161216 v: SDK0J40697 WIN serial: <filter> 
  UEFI: LENOVO v: 6NCN33WW date: 11/12/2018 
Battery:
  ID-1: BAT0 charge: 30.9 Wh condition: 40.7/38.0 Wh (107%) 
  model: LENOVO SR Real Battery status: Discharging 
  Device-1: hid-0018:056A:513B.0001-battery model: WCOM513B:00 056A:513B 
  charge: N/A status: Full 
CPU:
  Topology: Quad Core model: Intel Core i7-8550U bits: 64 type: MT MCP 
  arch: Kaby Lake rev: A L2 cache: 8192 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 31880 
  Speed: 800 MHz min/max: 400/4000 MHz Core speeds (MHz): 1: 800 2: 800 
  3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 
Graphics:
  Device-1: Intel UHD Graphics 620 vendor: Lenovo driver: i915 v: kernel 
  bus ID: 00:02.0 
  Display: x11 server: X.org 1.20.4 driver: i915 
  resolution: <xdpyinfo missing> 
  OpenGL: renderer: Mesa DRI Intel UHD Graphics 620 (Kabylake GT2) 
  v: 4.5 Mesa 18.3.4 direct render: Yes 
Audio:
  Device-1: Intel Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Imaging 
  Unit 
  vendor: Lenovo driver: N/A bus ID: 00:05.0 
  Device-2: Intel vendor: Lenovo driver: N/A bus ID: 00:14.3 
  Device-3: Intel Sunrise Point-LP HD Audio vendor: Lenovo 
  driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
  Sound Server: ALSA v: k4.19.30-1-MANJARO 
Network:
  Device-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter 
  vendor: Lenovo driver: ath10k_pci v: kernel port: 4040 bus ID: 01:00.0 
  IF: wlp1s0 state: up mac: <filter> 
  Device-2: Qualcomm Atheros type: USB driver: btusb bus ID: 1-4:2 
Drives:
  Local Storage: total: 990.53 GiB used: 26.68 GiB (2.7%) 
  ID-1: /dev/mmcblk0 model: SD64G size: 59.02 GiB 
  ID-2: /dev/nvme0n1 vendor: Samsung model: SSD 970 EVO Plus 1TB 
  size: 931.51 GiB 
Partition:
  ID-1: / size: 228.18 GiB used: 26.32 GiB (11.5%) fs: ext4 
  dev: /dev/nvme0n1p6 
  ID-2: swap-1 size: 9.31 GiB used: 0 KiB (0.0%) fs: swap 
  dev: /dev/nvme0n1p7 
Sensors:
  System Temperatures: cpu: 36.0 C mobo: 0.0 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 291 Uptime: 1m Memory: 7.58 GiB used: 1.87 GiB (24.7%) 
  Init: systemd Compilers: gcc: 8.2.1 Shell: bash v: 5.0.0 inxi: 3.0.32 

and xsetwacom --list

|WCOM513B:00 056A:513B Touchscreen pad|id: 12|type: PAD       |
|---|---|---|
|WCOM513B:00 056A:513B stylus    |id: 13|type: STYLUS    |
|WCOM513B:00 056A:513B touch     |id: 14|type: TOUCH     |
|WCOM513B:00 056A:513B eraser    |id: 18|type: ERASER    |
|WCOM513B:00 056A:513B pad       |id: 19|type: PAD|

Please share the .xsetwacom commands you did, even tho i don’t think you should have to use it. Gnome has (and should recognize) tablet settings UI either if has or not touch, and there should be no conflict AFAIK.
Provide the content of each file in /usr/share/X11/xorg.conf.d/ and /etc/X11/xorg.conf.d/ and also the output of xinput --list from terminal.

Thanks - the only commands I used were:

$ xsetwacom --get -s "Wacom HID 513B Pen stylus" all
$ xsetwacom set "Wacom HID 513B Pen stylus" "Button" "3" "button +3

The device is no longer recognised - for example, while I could not get any wacom settings to display in settings, the test window would record pen pressure. It no longer does this.

4 --binary-syntax --close-stderr”: Child process exited with code 1
[adam@a-pc ~]$ xinput --list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ SIPODEV Lenovo HID Device Touchpad      	id=10	[slave  pointer  (2)]
⎜   ↳ WCOM513B:00 056A:513B Touchscreen pad   	id=12	[slave  pointer  (2)]
⎜   ↳ WCOM513B:00 056A:513B stylus            	id=13	[slave  pointer  (2)]
⎜   ↳ WCOM513B:00 056A:513B touch             	id=14	[slave  pointer  (2)]
⎜   ↳ WCOM513B:00 056A:513B Mouse             	id=15	[slave  pointer  (2)]
⎜   ↳ WCOM513B:00 056A:513B eraser            	id=18	[slave  pointer  (2)]
⎜   ↳ WCOM513B:00 056A:513B pad               	id=19	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ SIPODEV Lenovo HID Device               	id=8	[slave  keyboard (3)]
    ↳ SIPODEV Lenovo HID Device Consumer Control	id=9	[slave  keyboard (3)]
    ↳ SIPODEV Lenovo HID Device Wireless Radio Control	id=11	[slave  keyboard (3)]
    ↳ Intel Virtual Button driver             	id=16	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=17	[slave  keyboard (3)]

when updating everything using update manager, I noticed this in the logs:

Install DKMS modules
==> Unable to install module input-wacom/0.42.0 for kernel 5.0.5-1-MANJARO: Missing kernel headers.
==> Unable to install module input-wacom/0.42.0 for kernel 4.19.32-1-MANJARO: Missing kernel headers.

/usr/share/X11/xorg.conf.d/ 
10-amdgpu.conf  10-quirks.conf  40-libinput.conf
10-evdev.conf   10-radeon.conf  70-wacom.conf

40-libinput.conf:
# Match on all types of devices but joysticks
#
# If you want to configure your devices, do not copy this file.
# Instead, use a config snippet that contains something like this:
#
# Section "InputClass"
#   Identifier "something or other"
#   MatchDriver "libinput"
#
#   MatchIsTouchpad "on"
#   ... other Match directives ...
#   Option "someoption" "value"
# EndSection
#
# This applies the option any libinput device also matched by the other
# directives. See the xorg.conf(5) man page for more info on
# matching devices.

Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput tablet catchall"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

70-wacom.conf:
# Some of the below input classes appear 3x times, once for each of
# "tablet", "touchscreen", and "touchpad" to ensure that the Wacom
# driver is not accidentally bound to other types of hardware that
# Wacom has made which are not handled by the wacom driver (e.g the
# Wacom Bluetooth Keyboard)
#
# https://sourceforge.net/p/linuxwacom/bugs/294/

Section "InputClass"
        Identifier "Wacom USB tablet class"
        MatchUSBID "056a:*"
        MatchDevicePath "/dev/input/event*"
        MatchIsTablet "true"
        Driver "wacom"
EndSection

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

Section "InputClass"
	Identifier "Wacom tablet class"
	MatchProduct "Wacom|WACOM|PTK-540WL|ISD-V4"
	MatchDevicePath "/dev/input/event*"
	MatchIsTablet "true"
	Driver "wacom"
EndSection

Section "InputClass"
	Identifier "Wacom touchscreen class"
	MatchProduct "Wacom|WACOM|PTK-540WL|ISD-V4"
	MatchDevicePath "/dev/input/event*"
	MatchIsTouchscreen "true"
	Driver "wacom"
EndSection

Section "InputClass"
	Identifier "Wacom touchpad class"
	MatchProduct "Wacom|WACOM|PTK-540WL|ISD-V4"
	MatchDevicePath "/dev/input/event*"
	MatchIsTouchpad "true"
	Driver "wacom"
EndSection

# Serial Wacom devices should always be one of tablet, touchscreen, or
# touchpad so we can safely get away with just one match section in
# these cases
Section "InputClass"
        Identifier "Wacom PnP device class"
        MatchPnPID "WACf*|WCOM*|WACM*|FUJ02e5|FUJ02e7|FUJ02e9"
        MatchDevicePath "/dev/input/event*"
        Driver "wacom"
EndSection

Section "InputClass"
	Identifier "Wacom serial class"
	MatchProduct "Serial Wacom Tablet"
	Driver "wacom"
EndSection

Section "InputClass"
        Identifier "Wacom serial class identifiers"
        MatchProduct "WACf|FUJ02e5|FUJ02e7|FUJ02e9"
        Driver "wacom"
EndSection

# Hanwang tablets
Section "InputClass"
	Identifier "Hanwang class"
	MatchProduct "Hanwang"
	MatchDevicePath "/dev/input/event*"
	Driver "wacom"
EndSection

# Waltop tablets
Section "InputClass"
	Identifier "Waltop class"
	MatchProduct "WALTOP"
	MatchIsTablet "on"
	MatchDevicePath "/dev/input/event*"
	Driver "wacom"
EndSection

# N-Trig Duosense Electromagnetic Digitizer
Section "InputClass"
	Identifier "Wacom N-Trig class"
	MatchProduct "HID 1b96:0001|N-Trig Pen|N-Trig DuoSense"
	MatchDevicePath "/dev/input/event*"
	Driver "wacom"
	Option "Button2" "3"
EndSection

# Dell Canvas 27 (touch part is an Advanced Silicon, pen part a Wacom)
Section "InputClass"
        Identifier "Dell Canvas 27 Touch"
        MatchUSBID "2575:0204"
        MatchDevicePath "/dev/input/event*"
        MatchIsTouchscreen "true"
        Driver "wacom"
EndSection


/etc/X11/xorg.conf.d/ 
00-keyboard.conf

Don’t want to flood you with files - please let me know if you think any of the others might be relevant.

This command is wrong.
First:

Remove any DKMS you tried to install, there is no need for it. Reboot your system so all the xsetwacom commands you used are reset to default, and install/reinstall only this packages:
sudo pacman -S libwacom xf86-input-wacom
Create the file /etc/X11/xorg.conf.d/11-evdev.conf with this content:

#
# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Because the kernels above 4.14 had introduced a strange *event that connects and disconnects all wacom devices simultaneously, rendering them unusable, requiring to be connected and disconnected again manually, i propose, for this test, to install the 4.14 kernel and reboot into it.

From Gnome Settings you should be able to set the Stylus and calibrate the Tablet/Display

1 Like

Thank you - removing the DKMS package did get the touch screen working again. Strangely, this had probably been installed for a few reboots before the issue started to arise.

The Wacom Tablet settings part of Gnome Settings still does not appear to detect any styluses / tablets, but pressure sensitivity is working again. So, it’s possible to use the pen but not configure the buttons.

Thanks for your help - if you have any ideas about the above that you’d feel like sharing, I’d appreciate it, but things are back to a point of being usable!

Give me again the output of xinput --list
There should be a difference, except probably the Stylus. I’ll think to something …

Thank you - I’m still a bit new to all of this.

xinput --list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ SIPODEV Lenovo HID Device Touchpad      	id=10	[slave  pointer  (2)]
⎜   ↳ Wacom HID 513B Pen stylus               	id=12	[slave  pointer  (2)]
⎜   ↳ Wacom HID 513B Finger touch             	id=13	[slave  pointer  (2)]
⎜   ↳ Wacom HID 513B Pen eraser               	id=16	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ SIPODEV Lenovo HID Device               	id=8	[slave  keyboard (3)]
    ↳ SIPODEV Lenovo HID Device Consumer Control	id=9	[slave  keyboard (3)]
    ↳ SIPODEV Lenovo HID Device Wireless Radio Control	id=11	[slave  keyboard (3)]
    ↳ Intel Virtual Button driver             	id=14	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=15	[slave  keyboard (3)]

Much better. :slight_smile:
Now let’s see how xsetwacom identifies them
xsetwacom --list
Then we move forward. Sorry to take it in small increments of step by step :slight_smile:

Edit:
Anyway, it think it will be the same name as in xinput --list, so here is how i see it:

  • To map the upper side button to middle click:
    xsetwacom set "Wacom HID 513B Pen stylus" Button 2 3

  • Similarly you can map the lower button (eraser button 1) to mouse button 2 (middle click) using:
    xsetwacom set "Wacom HID 513B Pen eraser" Button 1 2

If you switch between tablet mode and desktop mode, but also keep the stylus working on both cases, this is a script for it placed in a folder in your home directory called tabletswitch and the script tabletswitch.sh and made executable:

#!/bin/bash

token="~/tabletswitch";

if [ -e $token ]
then
	rm $token
	xrandr --output eDP-1 --rotate normal
	sleep 0.2
	xinput enable "Wacom HID 513B Finger touch"
	xinput enable "SIPODEV Lenovo HID Device Touchpad"
	sleep 0.1
	gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 1800
	gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 900
	gsettings set org.gnome.desktop.session idle-delay 0
	gsettings set org.gnome.desktop.screensaver lock-delay 0

	xsetwacom set "Wacom HID 513B Pen stylus" rotate none
    xsetwacom set "Wacom HID 513B Pen stylus" Button 2 3
	xsetwacom set "Wacom HID 513B Pen eraser" rotate none
    xsetwacom set "Wacom HID 513B Pen eraser" Button 1 2

	notify-send "Desktop mode"
else
	touch $token
	xrandr --output eDP-1 --rotate normal
	sleep 0.2
	xinput disable "Wacom HID 513B Finger touch"
	xinput disable "SIPODEV Lenovo HID Device Touchpad"
	sleep 0.1
	gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 3600
	gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 900
	gsettings set org.gnome.desktop.session idle-delay 0
	gsettings set org.gnome.desktop.screensaver lock-delay 3600

	xsetwacom set "Wacom HID 513B Pen stylus" rotate none
    xsetwacom set "Wacom HID 513B Pen stylus" Button 2 3
	xsetwacom set "Wacom HID 513B Pen eraser" rotate none
    xsetwacom set "Wacom HID 513B Pen eraser" Button 1 2

	notify-send "Tablet mode"
fi
	sleep 0.2

Then you can create a dekstop file with:

#!/usr/bin/env xdg-open

[Desktop Entry]
Name=ChangeMode
Comment=To change the screen from desktop to tablet
Exec=~/tabletswitch.sh
Icon=input-tablet
Terminal=false
Type=Application

Note: Please make sure the xsetwacom commands are working first, separate from the script.

1 Like

That’s okay! Apologies it’s taken me a while to get back to you

xsetwacom --list
Wacom HID 513B Pen stylus       	id: 12	type: STYLUS    
Wacom HID 513B Finger touch     	id: 13	type: TOUCH     
Wacom HID 513B Pen eraser       	id: 16	type: ERASER 

Does 1 correspond to left click, 2 to right click, and three to middle click?

Thank you for the scripts! I’ll try and work it out once we get to the bottom of assigning the buttons.

I only guess so based on a few readings i did.

1 Like

Amazing. Apologies it's taken me a while to get back to you.

 xsetwacom set "Wacom HID 513B Pen eraser" Button 1 3

will make the bottom button on the pen act as right click when the pen is pressed against the screen.

However this led to some rather bizarre behaviour when inputting text - e.g cursor jumping randomly through input fields. Resetting button 1 to 1 then to 3 appears to have resolved this.

I'll update a bit later as to whether this remains stable.

Thanks again.

1 Like

To get touchscreen and stylus detected by Gnome Settings, at first you have to submit information about touchscreen to wacom-hid-descriptors GitHub repository with sysinfo.sh script (see README.md in wacom-hid-descriptors repository). Example of result is here (in case of Dell Venue 8 Pro 5855 tablet there is two different hardware revisions of touchscreen, so two folders).

After that libwacom developers can take data from your report and add touschreen description to libwacom integrated touchscreen database. Here is example for Dell Venue 8 Pro 5855.

When next stable libwacom release will find it's way to Manjaro repositories, touschreen and stylus of your device will be succesfully detected by Gnome Settings. And of course you could speedup process by submitting not only sysinfo.sh report, but also tablet description for libwacom, and then rebuild libwacom with your tablet description.

Anyway, I writing this post to ask you check if you still can reproduce issue you described in first post ("If I use the touchscreen, the touchpad will stop responding") in Gnome Shell Wayland session? Some things work differently here as Mutter and libinput will take care of input events instead of Xorg and xf86-input-wacom.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by