Graphic Tablet Compatibility (basic features)

77 views
Skip to first unread message

Fabrizio Romano Genovese

unread,
Jan 8, 2018, 8:54:40 PM1/8/18
to qubes-users
Hello all,

I'd like to use a wacom bamboo graphic tablet as an alternative pointing device, mainly to draw on virtual whiteboards to do maths in conference calls. At the moment, this is not possible: Connecting the graphic tablet and passing it to the relevant VM produces no effect whatsoever. The tablet is listed among the usb devices but, if for instance one is using the standard fedora template, nothing is shown clicking on the "wacom tablet" application that can be found in /urs/share/applications, nor is it possible to use it to draw stuff.

This looks like an old issue:
https://github.com/QubesOS/qubes-issues/issues/2715

I'd be interested in using only the basic tablet features (essentially moving the mouse and clicking around using the tablet would be enough). In the issue linked above it is said that

"this in theory should be easy (a matter adding proper metadata - min/max - to the protocol handshake, and filtering events based on this info)"

I'd like to help with this, but I am no coder. I just know a bit of bash scripting and trying to check the code in

https://github.com/QubesOS/qubes-app-linux-input-proxy/blob/master/src/protocol.h#L17-L28

didn't really help. I understand that developers are quite busy with much more hardcore problems to solve, but if someone could at least point me to the right research direction I could try to investigate this by myself.

Cheers,
Fab

Tom Zander

unread,
Jan 9, 2018, 5:17:48 AM1/9/18
to qubes...@googlegroups.com, Fabrizio Romano Genovese
On Tuesday, 9 January 2018 01:54:40 GMT Fabrizio Romano Genovese wrote:
> Hello all,
> This looks like an old issue:
> https://github.com/QubesOS/qubes-issues/issues/2715
>
> I'd be interested in using only the basic tablet features (essentially
> moving the mouse and clicking around using the tablet would be enough).
> In the issue linked above it is said that
>
> "this in theory should be easy (a matter adding proper metadata - min/max
> - to the protocol handshake, and filtering events based on this info)"
>
> I'd like to help with this, but I am no coder. I just know a bit of bash
> scripting and trying to check the code in
>
> https://github.com/QubesOS/qubes-app-linux-input-proxy/blob/master/src/pro
> tocol.h#L17-L28
>
> didn't really help. I understand that developers are quite busy with much
> more hardcore problems to solve, but if someone could at least point me
> to the right research direction I could try to investigate this by
> myself.

From;
http://linuxwacom.sourceforge.net/index_old.php/howto/theory

> Initially at least, the USB Wacom tablet is an HID compliant device, and
> when first connected to the computer, will identify itself as such.
> Unfortunately, this is not what you want because in this mode, you will
> not get any of the fancy features. The hid-core.c, mousedev.c, and
> usbmouse.c kernel drivers contain exceptions for the wacom; when the
> device is detected, they ignore the tablet.

So maybe you can use that website to find out how to configure your wacom to
just be a HID (human interface device) and make it send those mouse clicks.

--
Tom Zander
Blog: https://zander.github.io
Vlog: https://vimeo.com/channels/tomscryptochannel


Fabrizio Romano Genovese

unread,
Jan 16, 2018, 8:22:12 AM1/16/18
to qubes-users
I saw this reply only yesterday, unfortunately.

So, I followed your suggestion and looked around. I found this, that should do exactly what you say:
https://cwcode.wordpress.com/2014/01/14/compiling-a-new-kernel-module-to-use-hid-core-for-a-wacom-bamboo-pad/

Now, since this guide is not for fedora, I wanted to try something easier before. In the comments someone says

"I found it easier to add usbhid.quirks=0x056a:0x0318:0x40000000 to the kernel commandline in /etc/default/grub.
0x40000000 is HID_QUIRK_NO_IGNORE. The first two numbers is the device’s ID."

So I tried to do the same. I clone the template-vm on which sys-usb is based and I added in /etc/default/grub
usbhid.quirks=0x056a:0x00dd:0x40000000

where 056a identifies wacom as producer and 00dd is my product number, found in
/sys/kernel/debug/usb/devices.

When I rebooted nothing happened. I also tried to put this line in grub.qubes, with no success whatsoever. Then I tried following the guide, but I fail pretty quicly: Trying to remove

/lib/modules/4.9.56-21.pvops.qubes.x86_64/kernel/drivers/input/tablet/wacom_serial4.ko

Gives me the error

/lib/modules/4.9.56-21.pvops.qubes.x86_64/kernel/drivers/input/tablet/wacom_serial4.ko

Then I tried at least to monitor usb with usbmon. I gave

modprobe usbmon

and then started monitoring my wacom tablet, that is on 2u, with:

sudo cat /sys/kernel/debug/usb/usbmon/2u

usbmon doesn't sense anything when I move the pen on the tablet, it only senses something when I connect/disconnect it. When I connect the tablet I get:

ffff8cefcce66540 3453394997 C Ii:2:001:1 0:2048 2 = 0200
ffff8cefcce66540 3453395017 S Ii:2:001:1 -115:2048 4 <
ffff8cefca1b00c0 3453395039 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8cefca1b00c0 3453395053 C Ci:2:001:0 0 4 = 01010100
ffff8cefca1b00c0 3453395057 S Co:2:001:0 s 23 01 0010 0001 0000 0
ffff8cefca1b00c0 3453395067 C Co:2:001:0 0 0
ffff8cefca1b00c0 3453395072 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8cefca1b00c0 3453395086 C Ci:2:001:0 0 4 = 01010000
ffff8cefca1b00c0 3453422046 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8cefca1b00c0 3453422064 C Ci:2:001:0 0 4 = 01010000
ffff8cefca1b00c0 3453449146 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8cefca1b00c0 3453449166 C Ci:2:001:0 0 4 = 01010000
ffff8cefca1b00c0 3453476120 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8cefca1b00c0 3453476138 C Ci:2:001:0 0 4 = 01010000
ffff8cefca1b00c0 3453503126 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8cefca1b00c0 3453503155 C Ci:2:001:0 0 4 = 01010000
ffff8cefca1b00c0 3453503256 S Co:2:001:0 s 23 03 0004 0001 0000 0
ffff8cefca1b00c0 3453503279 C Co:2:001:0 0 0
ffff8cefca1b00c0 3453555111 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8cefca1b00c0 3453555135 C Ci:2:001:0 0 4 = 11010000
ffff8cefca1b00c0 3453607116 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8cefca1b00c0 3453607141 C Ci:2:001:0 0 4 = 03011000
ffff8cefca1b00c0 3453607152 S Co:2:001:0 s 23 01 0014 0001 0000 0
ffff8cefca1b00c0 3453607162 C Co:2:001:0 0 0
ffff8cefca1b00c0 3453659185 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff8cefca1b00c0 3453659601 C Ci:2:000:0 0 18 = 12010002 00000020 6a05dd00 02010102 0001
ffff8cefca1b00c0 3453659620 S Co:2:001:0 s 23 03 0004 0001 0000 0
ffff8cefca1b00c0 3453659633 C Co:2:001:0 0 0
ffff8cefca1b00c0 3453711790 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8cefca1b00c0 3453711808 C Ci:2:001:0 0 4 = 11010000
ffff8cefca1b00c0 3453763103 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8cefca1b00c0 3453763128 C Ci:2:001:0 0 4 = 03011000
ffff8cefca1b00c0 3453763133 S Co:2:001:0 s 23 01 0014 0001 0000 0
ffff8cefca1b00c0 3453763143 C Co:2:001:0 0 0
ffff8cefca1b00c0 3453827084 S Ci:2:006:0 s 80 06 0100 0000 0012 18 <
ffff8cefca1b00c0 3453827583 C Ci:2:006:0 0 18 = 12010002 00000020 6a05dd00 02010102 0001
ffff8cefca1b00c0 3453827613 S Ci:2:006:0 s 80 06 0600 0000 000a 10 <
ffff8cefca1b00c0 3453827726 C Ci:2:006:0 -32 0
ffff8cefca1b00c0 3453827741 S Ci:2:006:0 s 80 06 0600 0000 000a 10 <
ffff8cefca1b00c0 3453827856 C Ci:2:006:0 -32 0
ffff8cefca1b00c0 3453827871 S Ci:2:006:0 s 80 06 0600 0000 000a 10 <
ffff8cefca1b00c0 3453828010 C Ci:2:006:0 -32 0
ffff8cefca1b00c0 3453828038 S Ci:2:006:0 s 80 06 0200 0000 0009 9 <
ffff8cefca1b00c0 3453828359 C Ci:2:006:0 0 9 = 09023b00 02010080 31
ffff8cefca1b00c0 3453828384 S Ci:2:006:0 s 80 06 0200 0000 003b 59 <
ffff8cefca1b00c0 3453829398 C Ci:2:006:0 0 59 = 09023b00 02010080 31090400 00010301 02000921 10010001 22b80007 0581030a
ffff8cefca1b00c0 3453829420 S Ci:2:006:0 s 80 06 0300 0000 00ff 255 <
ffff8cefca1b00c0 3453829624 C Ci:2:006:0 0 4 = 04030904
ffff8cefca1b00c0 3453829642 S Ci:2:006:0 s 80 06 0302 0409 00ff 255 <
ffff8cefca1b00c0 3453830002 C Ci:2:006:0 0 16 = 10034300 54004c00 2d003400 37003000
ffff8cefca1b00c0 3453830023 S Ci:2:006:0 s 80 06 0301 0409 00ff 255 <
ffff8cefca1b00c0 3453830594 C Ci:2:006:0 0 30 = 1e035700 61006300 6f006d00 20004300 6f002e00 2c004c00 74006400 2e00
ffff8cefca1b0cc0 3453831094 S Co:2:006:0 s 00 09 0001 0000 0000 0
ffff8cefca1b0cc0 3453831265 C Co:2:006:0 0 0
ffff8cefca1b09c0 3453831876 S Co:2:006:0 s 21 0a 0000 0000 0000 0
ffff8cefca1b09c0 3453831999 C Co:2:006:0 0 0
ffff8cefca1b09c0 3453832023 S Ci:2:006:0 s 81 06 2200 0000 00b8 184 <
ffff8cefca1b09c0 3453834969 C Ci:2:006:0 0 184 = 05010902 a1018501 0901a100 05091901 29051500 25019505 75018102 95017503
ffff8cefca68cb40 3453835821 S Co:2:006:0 s 21 09 0302 0000 0002 2 = 0202
ffff8cefca68cb40 3453835999 C Co:2:006:0 0 2 >
ffff8cefca68cb40 3453836038 S Ci:2:006:0 s a1 01 0302 0000 0002 2 <
ffff8cefca68cb40 3453836198 C Ci:2:006:0 0 2 = 0202
ffff8cefcf2c4900 3453836322 S Co:2:006:0 s 21 0a 0000 0001 0000 0
ffff8cefcf2c4900 3453836418 C Co:2:006:0 -32 0
ffff8cefcf2c4900 3453836433 S Ci:2:006:0 s 81 06 2200 0001 001d 29 <
ffff8cefcf2c4900 3453837020 C Ci:2:006:0 0 29 = 0600ff09 80a10285 02750895 3f150026 00108101 85037508 953f8101 c0
ffff8cefca68c240 3453872679 S Ii:2:006:1 -115:2 10 <
ffff8cefcea829c0 3453925170 S Ii:2:006:2 -115:2 64 <
ffff8cefca68c240 3453977193 C Ii:2:006:1 -2:2 0
ffff8cefcea829c0 3453981181 C Ii:2:006:2 -2:2 0

...Clearly I have no idea about how to read this. Is it normal that usbmon doesn't sense anything when it comes to the pen moving on the tablet? This doesn't happen for instance with a mouse: usbmon keeps giving me output when I move it. i have to add that the tablet should be working: The blue led on it blinks when I have the pen near to the surface.

Depressed regards,
Fab

Fabrizio Romano Genovese

unread,
Jan 16, 2018, 8:28:41 AM1/16/18
to qubes-users
Sorry, when I tried to remove
/lib/modules/4.9.56-21.pvops.qubes.x86_64/kernel/drivers/input/tablet/wacom_serial4.ko

I get the error

rm: cannot remove '/lib/modules/4.9.56-21.pvops.qubes.x86_64/kernel/drivers/input/tablet/wacom_serial4.ko': Read-only file system

(Not always I get ctrl+shift+v right :P)

Tom Zander

unread,
Jan 16, 2018, 2:23:03 PM1/16/18
to qubes...@googlegroups.com, Fabrizio Romano Genovese
I think I know why you get that error.

any part of the kernel (and drivers are part of the kernel) are off-limits to change for any Qube VM.

To avoid loading a module you don't have to remove it, you can just blacklist a module.
Your distro may have a specific way of doing it, but a little googling showed me this and that looks about right to me;

https://linux-audit.com/kernel-hardening-disable-and-blacklist-linux-modules/


On Tuesday, 16 January 2018 14:28:41 CET Fabrizio Romano Genovese wrote:
> when I tried to remove
> /lib/modules/4.9.56-21.pvops.qubes.x86_64/kernel/drivers/input/tablet/waco
> m_serial4.ko
>
> I get the error
>
> rm: cannot remove
> '/lib/modules/4.9.56-21.pvops.qubes.x86_64/kernel/drivers/input/tablet/wa
> com_serial4.ko': Read-only file system


Fabrizio Romano Genovese

unread,
Jan 17, 2018, 5:22:28 PM1/17/18
to qubes-users
Well, I blacklisted the relevant module and recompiled the driver as the guide said. The hid-core.c file hasn't the line described in the guide tho: It has a definition by cases that collapses the wacom driver to the standard one if wacom specific driver is not loaded. In doubt, I eliminated any reference to Wacom in the hid-core.c, and replaced the old drivers with the new one. Still, no effect whatsoever.

Interestingly enough, giving
cat /sys/kernel/debug/usb/devices
tells me that
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs= 1
P: Vendor=056a ProdID=00dd Rev= 1.02
S: Manufacturer=Wacom Co.,Ltd.
S: Product=CTL-470
C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr= 98mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 10 Ivl=2ms
I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid
E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=2ms

So the driver used is the right one. Only, usbhid doesn't recognize my tablet as a mouse. I feel like I'm out of options :/

Reply all
Reply to author
Forward
0 new messages