libwacom icon indicating copy to clipboard operation
libwacom copied to clipboard

Kamvas 13 (Gen 3) It has no support

Open Somaxa8 opened this issue 7 months ago • 7 comments

  • Device name: Kamvas 13 (Gen 3)

  • Device model identifier: gs1333

  • libwacom version: libwacom-2.15.0-1.fc42.x86_64

  • [x] I understand that libwacom does not affect whether the device works (see Troubleshooting)

  • [x] udevadm info output: somaxa8@fedora:/etc/libwacom$ udevadm info --query=all --name=/dev/input/event25 P: /devices/pci0000:00/0000:00:02.1/0000:03:00.0/0000:04:0c.0/0000:0e:00.0/usb1/1-1/1-1.1/1-1.1:1.1/0003:256C:2008.000F/input/input35/event25 M: event25 R: 25 J: c13:89 U: input D: c 13:89 N: input/event25 L: 0 S: input/by-id/usb-HUION_Huion_Tablet_GS1333-if01-event-mouse S: input/by-path/pci-0000:0e:00.0-usbv2-0:1.1:1.1-event-mouse S: input/by-path/pci-0000:0e:00.0-usb-0:1.1:1.1-event-mouse E: DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:03:00.0/0000:04:0c.0/0000:0e:00.0/usb1/1-1/1-1.1/1-1.1:1.1/0003:256C:2008.000F/input/input35/event25 E: DEVNAME=/dev/input/event25 E: MAJOR=13 E: MINOR=89 E: SUBSYSTEM=input E: USEC_INITIALIZED=34307367884 E: ID_INPUT=1 E: ID_INPUT_TABLET=1 E: ID_BUS=usb E: ID_MODEL=Huion_Tablet_GS1333 E: ID_MODEL_ENC=Huion\x20Tablet_GS1333 E: ID_MODEL_ID=2008 E: ID_SERIAL=HUION_Huion_Tablet_GS1333 E: ID_VENDOR=HUION E: ID_VENDOR_ENC=HUION E: ID_VENDOR_ID=256c E: ID_REVISION=0112 E: ID_TYPE=hid E: ID_USB_MODEL=Huion_Tablet_GS1333 E: ID_USB_MODEL_ENC=Huion\x20Tablet_GS1333 E: ID_USB_MODEL_ID=2008 E: ID_USB_SERIAL=HUION_Huion_Tablet_GS1333 E: ID_USB_VENDOR=HUION E: ID_USB_VENDOR_ENC=HUION E: ID_USB_VENDOR_ID=256c E: ID_USB_REVISION=0112 E: ID_USB_TYPE=hid E: ID_USB_INTERFACES=:030102:030000: E: ID_USB_INTERFACE_NUM=01 E: ID_USB_DRIVER=usbhid E: ID_PATH_WITH_USB_REVISION=pci-0000:0e:00.0-usbv2-0:1.1:1.1 E: ID_PATH=pci-0000:0e:00.0-usb-0:1.1:1.1 E: ID_PATH_TAG=pci-0000_0e_00_0-usb-0_1_1_1_1 E: LIBINPUT_DEVICE_GROUP=3/256c/2008:usb-0000:0e:00.0-1 E: DEVLINKS=/dev/input/by-id/usb-HUION_Huion_Tablet_GS1333-if01-event-mouse /dev/input/by-path/pci-0000:0e:00.0-usbv2-0:1.1:1.1-event-mouse /dev/input/by-path/pci-0000:0e:00.0-usb-0:1.1:1.1-event-mouse

  • [x] sysinfo issue in wacom-hid-descriptors: https://github.com/linuxwacom/wacom-hid-descriptors/issues/479

Somaxa8 avatar May 23 '25 15:05 Somaxa8

Hi! I created the definition for my Huion Kamvas 13 Gen 3 tablet, but there are some things I couldn't do. The wheel isn't detected even when I monitor the USB inputs (I understand why there's no support in the kernel drivers), and only two of the pen's three buttons can be used.

Aside from that, I created this definition.

[Device]
Name=Huion Kamvas 13 Gen 3
ModelName=GS1333
Class=Cintiq
DeviceMatch=usb|256c|2008|HUION Huion Tablet_GS1333 Pad;usb|256c|2008|HUION Huion Tablet_GS1333 Pen;usb|256c|2008|Tablet Monitor;usb|256c|2008|Tablet Monitor Pad;usb|256c|2008|Tablet Monitor Pen
Width=12
Height=7
Layout=huion-kamvas-13-gs1333.svg
Styli=@huion-kamvas13-pen;
IntegratedIn=Display

[Features]
NumStrips=2
NumRings=0
Reversible=false
Stylus=true
Touch=false
TouchSwitch=false

[Buttons]
Left=A;B;C;D;E;F;G
EvdevCodes=BTN_0;BTN_1;BTN_2;BTN_3;BTN_4;BTN_5;BTN_6

I've even included the layouts, but I can't map anything.

Image

Image

And as you can see, it doesn't allow me to map the pencil either.

huion.stylus

[0x0:0xfffcc]
# HUION Huion Tablet_GS1333 Pen
Name=Huion Kamvas 13 Pen
Group=huion-kamvas13-pen
Buttons=3
Axes=Tilt;Pressure;
Type=General

Somaxa8 avatar May 23 '25 16:05 Somaxa8

You'll need to add this device to udev-hid-bpf first (and use huion-switcher to switch it to vendor mode), then all the buttons/etc. should become available. Once that's done we can add it here because that'll also change the device name a little.

Styli=@huion-kamvas13-pen;

None of the huions I've seen so far support styli with tool ids and serial numbers so I'm guessing the same is true here. Which means these ones just use the generic styli.

whot avatar May 26 '25 23:05 whot

Hi! I've had a go at this following the instructions above (installed the BPF drivers from udev-hid-bpf, setup udev to run huion-switcher and put my device into vendor mode, and tested HID via libinput to see if it's working properly).

This is the tablet file I've came up with so far:


[Device]
Name=Huion Kamvas 13 (Gen 3)
ModelName=GS1333
DeviceMatch=usb|256c|2008
Layout=huion-kamvas-13-gen3.svg
Styli=@generic-no-eraser;

[Features]
Stylus=true
NumDials=2
Reversible=true
Buttons=7

[Buttons]
Left=A;B;C;D;E;F;G
Dial=F
Dial2=G

However I don't think it's quite correct. libwacom-list-local-devices produces a list of 2 independent devices for the keypad and the stylus:

devices:
  - name: 'Huion Kamvas 13 (Gen 3)'
    bus: 'usb'
    vid: 0x256c
    pid: 0x2008
    nodes: 
      - /dev/input/event30: 'HUION Huion Tablet_GS1333 Keypad'
    styli:
      - id: 0xffffd
        vid: 0x0000
        name: 'General Pen with no Eraser'
        type: 'general'
        axes: ['x', 'y' , 'pressure']
        buttons: 2
        erasers: []
  - name: 'Huion Kamvas 13 (Gen 3)'
    bus: 'usb'
    vid: 0x256c
    pid: 0x2008
    nodes: 
      - /dev/input/event29: 'HUION Huion Tablet_GS1333 Stylus'
    styli:
      - id: 0xffffd
        vid: 0x0000
        name: 'General Pen with no Eraser'
        type: 'general'
        axes: ['x', 'y' , 'pressure']
        buttons: 2
        erasers: []

I thought maybe I could match against the device name reported: ID 256c:2008 HUION Huion Tablet_GS1333, but DeviceMatch=usb|256c|2008|HUION Huion Tablet_GS1333 results in no devices matched, and I guess we want to be matching libinput devices. Since we have 2 available, I'm not quite sure how to handle that. I thought PairedIDs might be the solution but I don't think that's the case.

Using libinput debug-events I can see that all the input events are being sent as expected:

Device:                  HUION Huion Tablet_GS1333 Keypad
Kernel:                  /dev/input/event30
...
Device:                  HUION Huion Tablet_GS1333 Stylus
Kernel:                  /dev/input/event29
...
-event29  TABLET_TOOL_PROXIMITY        +0.000s          46.90*/114.47*  tilt: 0.00*/0.00*       pressure: 0.00* pen      (0, id 0) proximity-in axes:pt btn:SS2
 event29  TABLET_TOOL_AXIS             +0.016s          46.94*/114.50*  tilt: 0.00 /0.00        pressure: 0.00 
 event29  TABLET_TOOL_AXIS          2  +0.023s          47.01*/114.58*  tilt: 0.00 /0.00        pressure: 0.00 
 event29  TABLET_TOOL_AXIS          3  +0.031s          47.09*/114.69*  tilt: 0.00 /0.00        pressure: 0.00 
-event30  TABLET_PAD_DIAL              +0.000s  dial 1 delta 120.00 (mode 0)
 event30  TABLET_PAD_DIAL              +0.134s  dial 1 delta 120.00 (mode 0)
 event30  TABLET_PAD_DIAL              +4.482s  dial 0 delta -120.00 (mode 0)
 event30  TABLET_PAD_DIAL              +5.281s  dial 0 delta -120.00 (mode 0)
 event30  TABLET_PAD_DIAL              +5.833s  dial 0 delta -120.00 (mode 0)
 event30  TABLET_PAD_BUTTON              5 pressed (mode 0)
 event30  TABLET_PAD_BUTTON              5 released (mode 0)
 event30  TABLET_PAD_BUTTON              6 pressed (mode 0)
 event30  TABLET_PAD_BUTTON              6 released (mode 0)
 event30  TABLET_PAD_BUTTON              0 pressed (mode 0)
 event30  TABLET_PAD_BUTTON              0 released (mode 0)
 event30  TABLET_PAD_BUTTON              1 pressed (mode 0)
 event30  TABLET_PAD_BUTTON              1 released (mode 0)
 event30  TABLET_PAD_BUTTON              2 pressed (mode 0)
 event30  TABLET_PAD_BUTTON              2 released (mode 0)
 event30  TABLET_PAD_BUTTON              3 pressed (mode 0)
 event30  TABLET_PAD_BUTTON              3 released (mode 0)
 event30  TABLET_PAD_BUTTON              4 pressed (mode 0)
 event30  TABLET_PAD_BUTTON              4 released (mode 0)

Is there something I should be doing to aggregate these 2 input devices into a single tablet?

garyttierney avatar Sep 19 '25 16:09 garyttierney

Okay! So I got most of the Huion Kamvas 16 Gen 3 mostly working, and have seen a lot of the info for the Kamvas 13 Gen 3 to make a tablet and svg file for that too which should work, and can reference the Kamvas 13 sysinfo. So I can write up both at once at least.

I am having just one small hiccup maybe @whot can help me with?

I've made a bpf testing file for the Kavmas 16 for udev-hid-bpf, since it's very similar to the Kamvas 13. I got the buttons and dials working on it. (It has 1 more than the 13.)

The screen width of the 16 however exceeds the 16-bit value for the maximum width, and I thought changing it to a LogicalMaximum_i32 would fix it. The value is 69920, and the behavior of the stylus is it gets about 90% of the way to the right side then loops back around to the left side to continue, which makes me think it's hitting the 65535 value and returning back to 0.

Not sure where the limit for this is stored, or if it's even in udev-hid-bpf. Still getting used to the codebase.

I'd be happy to fix this, and will probably find the answer eventually, but a nudge might help speed things up and be appreciated.

higginsdragon avatar Oct 08 '25 08:10 higginsdragon

@garyttierney Could you (or anyone else with a 13 Gen 3) check to see if huion-kamvas-13-gs1333.tablet works well with your tablet? If so I got the .tablet file and .svg ready to PR.

higginsdragon avatar Oct 08 '25 21:10 higginsdragon

None of the huions I've seen so far support styli with tool ids and serial numbers so I'm guessing the same is true here. Which means these ones just use the generic styli.

Does the generic stylus support 3 buttons, or just 2 + eraser?

I was doing the trace for the kamvas 16 issue and captured the 3rd button press:

button 3 stylus up
0040   08 88 17 bb 58 63 00 00 00 00 33 fd 03 00         ....Xc....3...
          --

button 3 stylus down
0040   08 89 75 bb b4 63 4a 05 00 00 32 fd 03 00         ..u..cJ...2...
          --

Just more info. evtest shows it's recognized at least:

Event: time 1760137263.270261, -------------- SYN_REPORT ------------
Event: time 1760137263.273295, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9004a
Event: time 1760137263.273295, type 1 (EV_KEY), code 329 (BTN_STYLUS3), value 0
Event: time 1760137263.273295, type 3 (EV_ABS), code 0 (ABS_X), value 56601
Event: time 1760137263.273295, type 3 (EV_ABS), code 1 (ABS_Y), value 22303
Event: time 1760137263.273295, -------------- SYN_REPORT ------------
Event: time 1760137263.274276, type 1 (EV_KEY), code 320 (BTN_TOOL_PEN), value 0
Event: time 1760137263.274276, -------------- SYN_REPORT ------------
Event: time 1760137263.275274, type 1 (EV_KEY), code 320 (BTN_TOOL_PEN), value 1
Event: time 1760137263.275274, type 3 (EV_ABS), code 0 (ABS_X), value 56539
Event: time 1760137263.275274, type 3 (EV_ABS), code 1 (ABS_Y), value 22193

Would this just be a matter of creating a stylus entry like generic-3button-no-eraser ?

Either way, KDE only recognizes a generic as a 2 button stylus, but that's desktop environment issue, so even if it's added here it would still have to make its way downstream.

higginsdragon avatar Oct 10 '25 22:10 higginsdragon