HUION 610 Graphics Tablet and Linux

EDIT 27th August 2019: I have found out what caused the problem with the v5 kernels in PCLinuxOS. Having discovered the problem the solution is simple, so on we go!

EDIT: 5th September 2019: This article got unpublished in error. I do intend to rewrite it, but it’s best to have something there in the meantime!

Just over a year ago, I did a piece about using the HUION 610 Graphics Tablet with Linux. It’s time to update what I did last year. But one thing is for certain. The Huion 610 and 610Pro are much cheaper than Wacom tablets, and are said to work on Linux. And it’s not too hard to get them working.

So here’s how to get it set up in two different Linux Operating Systems (you may jump ahead to find out about MX-Linux):

Adding the X11 Configuration File:

If you have the latest version of PCLinuxOS and are fully updated, skip this section, as the necessary files are now installed by default.

X11 in Linux controls graphics, and inputs, including Tablets like your HUION. It won’t even recognise that your tablet exists without a configuration file. Specifically for the HUION H610, the file will read as follows:

    Section "InputClass"
        Identifier "Tablet"
        Driver "wacom"
        MatchDevicePath "/dev/input/event*"
        MatchUSBID "256c:006e"
    EndSection

If you have a non-Wacom tablet you can also try this more comprehensive file which will bring a few more Tablets under control:

#
# InputClass sections for some tablets supported by the DIGImend kernel
# drivers. Organized into separate InputClass sections based on (one of) the
# advertised brands. Mostly because the MatchUSBID options would become too
# long otherwise.
#
Section "InputClass"
	Identifier "Huion tablets with Wacom driver"
	MatchUSBID "5543:006e|256c:006e"
	MatchDevicePath "/dev/input/event*"
	Driver "wacom"
EndSection

Section "InputClass"
	Identifier "Ugee/XP-Pen tablets with Wacom driver"
	MatchUSBID "28bd:007[145]|28bd:0094|28bd:0042|5543:004[57]|5543:0081|5543:0004|5543:3031"
	# Exclude the original WP5540U which PID is reused by Ugee M540
	NoMatchProduct "MousePen"
	MatchDevicePath "/dev/input/event*"
	Driver "wacom"
EndSection

Section "InputClass"
	Identifier "Ugtizer tablets with Wacom driver"
	MatchUSBID "2179:0053"
	MatchDevicePath "/dev/input/event*"
	Driver "wacom"
EndSection

Section "InputClass"
	Identifier "Yiynova tablets with Wacom driver"
	MatchUSBID "5543:004d"
	MatchDevicePath "/dev/input/event*"
	Driver "wacom"
EndSection

One of these files should be saved in the folder /etc/X11/xorg.conf.d, and given the name 60-tablet.conf.

Finishing in MX-Linux (or Debian derivative):

You might find that this is enough to make your tablet run in MX Linux. From version 18.3, and in the Beta of the forthcoming v19, that will probably do it. It you’re using an older system, or another system based on Debian, you may need to install dkms-digimend. Check ahead to “Test if working“, come back if not.

Firstly, you need to go to this web page. From that page, download the file:
digimend-dkms_9_all.deb

Open a file manager and go to the folder where it’s downloaded, and click on it to install it using GDebi Package Installer. That’s the software installed.

Checking the Software in PCLinuxOS:

In PCLinuxOS, the necessary packages to control a tablet are installed by default. Run Synaptic to check they are there. If not, click “Reload”, “Mark All Upgrades” and “Apply”. This may take a while, but do it! Then add the programs.

lib64wacom2
libwacom
x11-driver-input-wacom

huion-tablet

If you are using a kernel before 4.19.x, you also need to install another package:

dkms-digimend

At this point, reboot!

Test if working

All you need to do is open a terminal, and type in the command as shown, and with the H610, you will get a response as shown here:

xsetwacom --list
HUION PenTablet Pen stylus id: 10 type: STYLUS
HUION PenTablet Pad pad id: 11 type: PAD

Hopefully you’ll get something similar for other tablets.

The other thing you can do is type “xev” in the terminal. Keep the mouse pointer over the xev box. In the case of the H610, you should get the values for the buttons, 1, 2, 3, 8, 9, 10, 11, 12. If you get this, or something similar for a different tablet, it’s working!

Setting Up The Buttons

The next thing is to allocate the buttons down the side of the unit. What I have done, is to use the default layout for Krita, as it’s really made for this sort of thing! Rather than make separate scripts for other paint programs such as GIMP, I’ve gone into GIMP and changed the Keyboard shortcuts to match the ones I’ve set up on the tablet.

The 8 buttons down the side (with their Krita shortcuts in brackets) are:

Undo (ctrl-z) Erase Mode (e), Brush (b), Zoom In (ctrl-KP_add), Zoom Out (ctrl-minus) Increase Brush Size (]), Decrease Brush Size ([) Move whole drawing (space). And the middle button on the stylus is Show Brush Tool (F5).

The program xsetwacom enables you to select actions for the buttons on your tablet and stylus which are seen as mouse buttons by the system, without changing the actions for the actual mouse. Without it, the top three buttons on your tablet would just duplicate the left, middle and right buttons on your mouse.

In the configuration file, ‘+’ indicates to hold a key down, ‘-‘ is to lift it up, and neither is just a single press of the key. So, for example, “ctrl-z” is described as, press down control, hit z, then lift up control: +ctrl z -ctrl . If you just define the key with “+”, it will repeat until you release the button.

The start of the file consists of two lines to obtain the ID numbers of the Pad (buttons) and the Stylus. They may vary from one boot to the next. So the script is:

#!/bin/bash

# script to prepare tablet

## Get ID number of Tablet:

TABLET_ID=`xsetwacom list | grep -i pad | awk -F: '{ print $2}' | awk '{print $1}'`
STYLUS_ID=`xsetwacom list | grep -i stylus | awk -F: '{ print $2}' | awk '{print $1}'`
##TABLET_ID and STYLUS_ID above commenced single lines ending $1}'` 

## KRITA

xsetwacom --set $TABLET_ID Button 1 "key +ctrl z -ctrl" #undo
xsetwacom --set $TABLET_ID Button 2 "key e" #erase mode toggle
xsetwacom --set $TABLET_ID Button 3 "key b" #select brush (as opposed to shape)
xsetwacom --set $TABLET_ID Button 8 "key +ctrl KP_Add -ctrl" #zoom in
xsetwacom --set $TABLET_ID Button 9 "key +ctrl minus -ctrl" #zoom out
xsetwacom --set $TABLET_ID Button 10 "key +bracketright" #increase brush size
xsetwacom --set $TABLET_ID Button 11 "key +bracketleft" #decrease brush size
xsetwacom --set $TABLET_ID Button 12 "key +space"
xsetwacom --set $STYLUS_ID Button 2 "key f5" #Show Brush Tool
## Button 3 is already set to bring up the colour picker.

You save the script in /usr/local/bin and call it krita-setup. You need to mark it as executable.

In PCLinuxOS, and optionally in MX-Linux, you could add the script to a shortcut. There is no point in running it when the tablet is not plugged in.

However in MX-Linux, and in PCLinuxOS if you are using XFCE, there is a facility in the control centre to autorun a program when an item is plugged in. In the Settings Manager, select Removable Drives and Media. On the last Tab headed “Input Devices”, the final option (Tablet), add /usr/local/bin/krita-setup, and every time you plug in the tablet, the line that initialises the hardware, runs!

If you are using a KDE based system, you can install an app from Synaptic called wacomtablet and make all the settings from the KDE Control Centre.

Best of luck! It took me a while to get this going in Linux, but then again, I never managed it in Windows at all!

3 responses

  1. Can’t get it to work for a H610Pro on MX Linux 4.19.5 kernel. Did everything you said in this blog… ???? what do I need to do with GIMP to get it to work? Krita?

  2. Okay, so I re-read your “red” highlighted comment from 11 August. So you are saying that PCLinuxOS is the only one that has a kernel that works out of the box, without downloading a driver?? Kind of confusing to me. Sorry.

  3. Hi, Kim. I think I replied to you on the MXLinux forum. I’m going to rewrite this soon. For now, if you put the longer of the two 60-tablet.conf files in the /usr/share/X11/xorg.conf.d folder, and reboot, what happens if you plug in the tablet and type into a terminal (as user):

    xsetwacom –list

    ? (that’s two minus signs before list, as WordPress alters it to a –)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: