benthor / HuionKamvasGT191LinuxDriver

Working user space evdev driver for Huion Kamvas GT-191 for Linux
MIT License
26 stars 2 forks source link

Quick and Dirty Linux support for Huion Kamvas GT-191

NOTE: CURRENTLY REQUIRES WORKAROUND TO PROPERLY FUNCTION!

See Issue #1 for a description of the problem and this post for a (temporary) workaround.

Backstory

In the summer of 2017, I bought a Huion Kamvas GT-191. It's a device that combines a stylus digitizer tablet with a full HD display. The idea is that you use the stylus to draw right on the screen.

Huion has historically had pretty decent Linux support. It seemed likely that support for this latest manifestation would be added soon. Unfortunately however, the DIGImend project that has been the primary force behind driver support for tablet devices is in trouble. Nikolai, the lead dev writes:

Starting today, I’m stopping all research on specific tablet interfaces and protocols required for implementing drivers. I.e. I’m not going to respond to any diagnostics, or requests to make new tablets work. I’m not going to support users, or investigate their problems either. However, I will still be reviewing and accepting patches, including ones already submitted.

This is sad but also problematic on a larger scale. Free Software is still highly relevant for those with low income. This especially means artists, who may not be able to afford the latest Wacom (which has decent Linux support btw) and who'd prefer to use affordable devices from the Asian competition. If the availability of drivers for current hardware is declining, more artists may remain stuck on proprietary platforms in future. (And the vast majority of photoshop users have never even heard of Krita...)

Driver

This is a working user space evdev driver for Linux

It is very quick and dirty but it is also tiny. Literally just 64 lines of Python. So you could actually read the entire thing and be sure it does nothing nasty with your machine before executing it with super user privileges.

Cobbled together in an afternoon as a workaround while waiting for activity in digimend-kernel-drivers#78. More than half of the code is borrowed from dannytaylor's driver for the (much more complicated) Huion Inspiroy G10T. This code also inherits the former's (MIT) License.

Feel free to open an issue or write me a message if you ran into trouble or found this useful.

Status

Requirements

You will likely also need to add the following to your /etc/X11/xorg.conf (create the file if it's not already present):

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

Usage

The stylus should now be moving the cursor on screen and the python process should report a lot of cursor events. If the cursor doesn't move, check out the "Known Bugs & Troubleshooting" section below

Note that it is not necessary to install this driver, just execute with superuser privileges (i.e., as root)

Known Bugs & Troubleshooting

This program requires the uinput module to be loaded. Load it either manually (sudo modprobe uinput) or automatically on boot (see the Arch wiki).

Unresponsive cursor

In case of unresponsive cursor, look for error messages begining with kamvas-pen in /var/log/Xorg.0.log. Errors may indicate that you need to create and populate your /etc/X11/xorg.conf (see above)

If you don't see driver debug messages for each cursor event either, see if you may be having the same issue described as in Issue #1 and if the workaround described there fixes things for you.

If this still doesn't help, go here and follow the steps. Then open a new issue.

Other problems

PS:

In the blog post I mentioned above, Nikolai goes on to write:

I will [...] be available for coaching and support of any able person willing to take my place, as a top priority. Write to me, if you would like to step in, know C well, have experience with kernel and system programming and interest in reverse-engineering USB devices, plus you have the patience to deal with users of widely-varied experience and background.

Lastly, if anybody wishes to employ me to continue working on DIGImend, I’m open to the offers, and I will gladly continue working on the project, provided I’m appropriately compensated.

Maybe the Krita Foundation could consider supporting the guy? Just a thought.