DIGImend / digimend-kernel-drivers

DIGImend graphics tablet drivers for the Linux kernel
GNU General Public License v2.0
1.17k stars 173 forks source link

Huion Kamvas Pro 13 & Raspbian - Tilt, pressure etc... detected by xinput/evtest/debugfs but not by apps #633

Open Eliam76 opened 2 years ago

Eliam76 commented 2 years ago

Hello everyone, I am trying to use my Huion Kamvas Pro 13 on a Raspberry Pi 4 (8go) running raspbian as OS. Plugging the Kamvas as main monitor without specific configuration partially works : pointer position is almost correct and pressure is detected (brush size vary with pressure in Krita) but not pen tilt nor are frame buttons. I tried to install Digimend drivers but it does not improve the tilting/frame buttons problem and I also lose pressure detection in Krita. The tablet is detected using lsusb as “Tablet Monitor” (VID:PID=256c:006d), but not recognized by the Wacom driver (xsetwacom list returns nothing). I’ve run the diagnostics suggested by the troubleshooting section of the website. Here are the results. Uclogic-tools : Using sudo uclogic-probe with the correct bus and device number returns

P 54 00 61 00 62 00 6C 00 65 00 74 00 20 00 4D 00 6F 00 6E 00 69 00 74 00 6F 00 72 00
S 65 04 03 09 00
S 6E 04 03 31 00
S 79 02 03
S 7A 08 03 01 10 00 00 00 00
S 7B 0C 03 48 00 4B 00 20 00 4F 00 6E 00
S C8 13 03 80 E5 00 18 81 00 FF 1F D8 13 03 05 00 01 08 00 40
S C9 24 03 48 00 55 00 49 00 4F 00 4E 00 5F 00 4D 00 31 00 38 00 32 00 5F 00 31 00 39 00 31 00 31 00 30 00 31 00
S CA 46 03 48 00 55 00 49 00 4F 00 4E 00 20 00 41 00 6E 00 69 00 6D 00 61 00 74 00 69 00 6F 00 6E 00 20 00 54 00 65 00 63 00 68 00 6E 00 6F 00 6C 00 6F 00 67 00 79 00 20 00 43 00 6F 00 2E 00 2C 00 6C 00 74 00 64 00

Which gives, using uclogic-decode :

    |                Product: Tablet Monitor
 79 |         Internal model:
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 58752
    |                          Max Y: 33048
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_M182_191101
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd

Debugfs interface : Here is an example of the output when I apply a pen pressure at the center of the frame while tilting the pen on the upper right direction (last two lines seem to indicate pen tilt)

report (size 12) (numbered) =  08 81 2f 76 72 3b 99 18 00 00 2b 28
Digitizers.TipSwitch = 1
Digitizers.BarrelSwitch = 0
Digitizers.TabletPick = 0
Digitizers.InRange = 1
GenericDesktop.X = 30255
GenericDesktop.Y = 15218
Digitizers.TipPressure = 6297
Digitizers.003d = 43
Digitizers.003e = -40

The report seems coherent given the tablet characteristics. Evtest tool : Using the sudo evtest with the correct device event number again returns coherent values given my actions, starting by

pi@raspberrypi:~/Documents $ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event1:      vc4
/dev/input/event2:      vc4
/dev/input/event3:      Tablet Monitor
/dev/input/event4:      Tablet Monitor Pad
/dev/input/event5:      Tablet Monitor Touch Strip
/dev/input/event6:      Tablet Monitor Dial
Select the device event number [0-6]: 3
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x256c product 0x6d version 0x111
Input device name: "Tablet Monitor"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 320 (BTN_TOOL_PEN)
    Event code 330 (BTN_TOUCH)
    Event code 331 (BTN_STYLUS)
    Event code 332 (BTN_STYLUS2)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value  15514
      Min        0
      Max    58752
      Resolution     200
    Event code 1 (ABS_Y)
      Value  25249
      Min        0
      Max    33048
      Resolution     200
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max     8191
    Event code 26 (ABS_TILT_X)
      Value    -53
      Min      -60
      Max       60
      Resolution      57
    Event code 27 (ABS_TILT_Y)
      Value    -31
      Min      -60
      Max       60
      Resolution      57
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
  Property type 0 (INPUT_PROP_POINTER)
Testing ... (interrupt to exit)

Followed by (extract from output)(again applying pressure at the center with pen tilted upper right) :

Event: time 1660696626.837558, -------------- SYN_REPORT ------------
Event: time 1660696626.843539, type 3 (EV_ABS), code 0 (ABS_X), value 30462
Event: time 1660696626.843539, type 3 (EV_ABS), code 1 (ABS_Y), value 16280
Event: time 1660696626.843539, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 5355
Event: time 1660696626.843539, type 3 (EV_ABS), code 26 (ABS_TILT_X), value 43
Event: time 1660696626.843539, -------------- SYN_REPORT ------------
Event: time 1660696626.847475, type 3 (EV_ABS), code 0 (ABS_X), value 30413
Event: time 1660696626.847475, type 3 (EV_ABS), code 1 (ABS_Y), value 16256
Event: time 1660696626.847475, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 3946
Event: time 1660696626.847475, type 3 (EV_ABS), code 27 (ABS_TILT_Y), value -39
Event: time 1660696626.847475, -------------- SYN_REPORT ------------
Event: time 1660696626.853521, type 3 (EV_ABS), code 0 (ABS_X), value 30354
Event: time 1660696626.853521, type 3 (EV_ABS), code 1 (ABS_Y), value 16240
Event: time 1660696626.853521, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 2579
Event: time 1660696626.853521, type 3 (EV_ABS), code 26 (ABS_TILT_X), value 41
Event: time 1660696626.853521, -------------- SYN_REPORT ------------
Event: time 1660696626.857566, type 3 (EV_ABS), code 0 (ABS_X), value 30284
Event: time 1660696626.857566, type 3 (EV_ABS), code 1 (ABS_Y), value 16238
Event: time 1660696626.857566, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 1350
Event: time 1660696626.857566, type 3 (EV_ABS), code 27 (ABS_TILT_Y), value -38

Collect raw input samples : Here are the files : pen_coords.txt pen_tilt.txt pen_pressure.txt pen_buttons.txt frame_dials.txt frame_buttons.txt

Note : Something like one year ago I managed to get my Kamvas Pro 13 to work on my Raspberry Pi 4 with raspbian as OS, including pressure and tilt detection on Krita. This was supposed to be part of a fully autonomous digital painting tablet project (so the tablet is the main monitor) but I had to put this project on hold. I remember trying many solutions but if my memories are correct I succeeded using Digimend drivers, so I'm almost sure that it is possible.

Eliam76 commented 2 years ago

Sorry to bring this up but does anyone have any idea where my problem is coming from? I still can't use the tablet to draw as is.

BatteryConcept commented 1 year ago

Hello, have you found a solution to this problem ? I am exactly in the same situation, I would like to make a standalone drawing tablet with a Huion Kamvas pro and a Raspberry Pi. I did not run all the dagnostics as you did but so far I have similar results. Everything related to inputs seems to be okay including tilt and pressure but it looks like it doesn't affect brushes in digital drawing softwares.