libwacom
libwacom copied to clipboard
Add Gaomon M106K Support
Hello,
I'm using a Gaomon M106K pad, which is recognized as Gaomon S620
due to identical hardware IDs.
The M106K is a "clone" of the Huion New 1060 Plus (see https://digimend.github.io/tablets/). The Gaomon M106K is already in wacom-hid-descriptors: https://github.com/linuxwacom/wacom-hid-descriptors/tree/master/Gaomon%20M106K I've copied over the S620 data + Huion layout files to /etc/libwacom and modified the DeviceMatch and Buttons, now my pad is recognized correctly and I can configure all buttons in gnome settings.
My question is: Can we add support for the M106K without regression for the S620 support?
dmesg
when I plug in the pad via USB:
usb 1-2: new full-speed USB device number 4 using xhci_hcd
usb 1-2: New USB device found, idVendor=256c, idProduct=006d, bcdDevice= 1.00
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2: Product: Gaomon Tablet
usb 1-2: Manufacturer: GAOMON
hid-generic 0003:256C:006D.0006: hiddev96,hidraw1: USB HID v1.11 Device [GAOMON Gaomon Tablet] on usb-0000:00:14.0-2/input0
input: GAOMON Gaomon Tablet Stylus as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:256C:006D.0007/input/input27
input: GAOMON Gaomon Tablet Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:256C:006D.0007/input/input28
hid-generic 0003:256C:006D.0007: input,hidraw2: USB HID v1.11 Keyboard [GAOMON Gaomon Tablet] on usb-0000:00:14.0-2/input1
input: GAOMON Gaomon Tablet Pen as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:256C:006D.0006/input/input29
input: GAOMON Gaomon Tablet Pad as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:256C:006D.0006/input/input30
input: GAOMON Gaomon Tablet Touch Strip as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:256C:006D.0006/input/input31
input: GAOMON Gaomon Tablet Dial as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:256C:006D.0006/input/input32
uclogic 0003:256C:006D.0006: input,hidraw1: USB HID v1.11 Keypad [GAOMON Gaomon Tablet] on usb-0000:00:14.0-2/input0
input: GAOMON Gaomon Tablet Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:256C:006D.0007/input/input34
uclogic 0003:256C:006D.0007: input,hidraw2: USB HID v1.11 Keyboard [GAOMON Gaomon Tablet] on usb-0000:00:14.0-2/input1
lsusb -tv
/: Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/12p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 002: Dev 005, If 0, Class=Human Interface Device, Driver=usbhid, 12M
ID 256c:006d [unknown] [unknown]
|__ Port 002: Dev 005, If 1, Class=Human Interface Device, Driver=usbhid, 12M
ID 256c:006d [unknown] [unknown]
My custom gaomon-m106k.tablet definition (layout SVG is just a copy of huion-new-1060-plus.svg
):
[Device]
Name=GAOMON M106K
ModelName=
DeviceMatch=usb:256c:006d:GAOMON Gaomon Tablet Pen;usb:256c:006d:GAOMON Gaomon Tablet Pad;
Class=Bamboo
Width=10
Height=6
Layout=gaomon-m106k.svg
IntegratedIn=
Styli=@generic-no-eraser;
[Features]
Stylus=true
Reversible=true
Buttons=12
[Buttons]
Left=A;B;C;D;E;F;G;H;I;J;K;L
EvdevCodes=0x100;0x101;0x102;0x103;0x104;0x105;0x106;0x107;0x108;0x109;0x130;0x131
Original DeviceMatch from the S620 model:
DeviceMatch=usb:256c:006d:GAOMON Gaomon Tablet Pen;usb:256c:006d:GAOMON Gaomon Tablet Pad;
libwacom-list-local-devices
with my custom M106K.tablet:
(libwacom-list-local-devices:100627): libwacom-CRITICAL **: 11:35:15.436: file ../libwacom/libwacom.c: line 1005 (libwacom_set_default_match): should not be reached
/dev/input/event23 is a tablet but not supported by libwacom
/dev/input/event22 is a tablet but not supported by libwacom
devices:
- name: 'GAOMON M106K'
bus: 'usb'
vid: '0x256c'
pid: '0x006d'
nodes:
- /dev/input/event21: 'GAOMON Gaomon Tablet Pad'
- name: 'GAOMON M106K'
bus: 'usb'
vid: '0x256c'
pid: '0x006d'
nodes:
- /dev/input/event20: 'GAOMON Gaomon Tablet Pen'
When I include the "Dial" and "Touch Strip" devices in the DeviceMatch
rule, libwacom-list-local-devices
lists those too, but gnome settings displays 3x Pads + 1x Pen.
I suppose my M106K config would cause all S620 devices the be recognized as M106K because of the identical hardware IDs... Is there any way in libwacom to differentiate between the S620 and M106K models? If that's not possible, can we ship the M106K definition anyway, so users can at least copy over the existing file to /etc to override the S620 definition?
The "best" solution here is to drop the S620 file and update to the M106K instead. This will make any S620 show up as M106K but it's better to expose buttons that don't exist than to limit the number of buttons. We've done this in the past with some other devices though don't ask me which one :)
Mind you, that only pushes the problem out by a bit, sooner or later those vendors will have the great idea of shipping backwards incompatible changes with the same ID. They do work under windows I'd expect which means there's something on the device level that tells the host which specific model is connected, we need to get this exported into userspace. Let's see what #610 amounts to over the next few days.
@TacticalCode I created a PR matching by firmware name the Gaomon S620, the tablet that clashed with your M106K: https://github.com/linuxwacom/libwacom/pull/657
Now that we can match by firmware name, you should be able to add a .tablet file for your tablet. Your tablet's firmware should be OEM02_T151
.
EDIT: Useful links:
- https://gitlab.freedesktop.org/libinput/libinput/-/issues/989#note_2371804
- https://github.com/linuxwacom/libwacom/pull/654#discussion_r1570400869
The link hash doesn't work nicely when I resolve the relevant conversation in PR #654, so I'm going to post José's comment here for posterity.
DeviceMatch=usb|256c|006e|Tablet Monitor Pen|HUION_M184;usb|256c|006e|Tablet Monitor Pad|HUION_M184;usb|256c|006e|Tablet Monitor Touch Strip|HUION_M184;
And checking if your device is detected (after updating libwacom's database as described in the readme) by running libwacom-list-local-devices
or checking your GNOME/KDE table settings.
Have in mind that you'd need to compile and install the latest libwacom code. I don't know if it is documented, but, to run the latest libwacom-list-local-devices
without overriding your system's libwacom:
$ git clone https://github.com/linuxwacom/libwacom.git
$ cd libwacom
$ meson setup builddir --prefix=$(pwd)/builddir/install # It might require installing some dependencies
$ ninja -C builddir
$ ninja -C builddir install
$ LD_LIBRARY_PATH=$(pwd)/builddir/install/lib64:$LD_LIBRARY_PATH \
./builddir/install/bin/libwacom-list-local-devices
That last command should (hopefully) detect your tablet correctly.
If you want GNOME/KDE settings to recognize your tablet, you'd need to override your distro libwacom with the latest master, which I won't recommend unless you are testing in a VM or in a test PC that you plan to format.
Originally posted by @jexposit in https://github.com/linuxwacom/libwacom/pull/654#discussion_r1570400869
We now have the M106K and M106K Pro both in the tablet files thaks to #659. It may not work yet (you'll need kernel 6.10 or Jose's kernel patches locally) but from the libwacom side I think we're good now, so let's close this. (If I'm wrong please re-open).
Any fixes to the tablet file please feel free to submit as MR.