Bug 95459 - UC-Logic WP5540U tablet - erratic strokes with pressure sensitivity enabled on Blender 3D
Summary: UC-Logic WP5540U tablet - erratic strokes with pressure sensitivity enabled o...
Status: RESOLVED NOTOURBUG
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/evdev (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-17 18:22 UTC by YAFU
Modified: 2016-05-19 23:47 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
evemu-record for UC-Logic WP5540U (95.86 KB, text/plain)
2016-05-17 18:22 UTC, YAFU
no flags Details
evemu-record_blend files (164.80 KB, application/zip)
2016-05-18 03:45 UTC, YAFU
no flags Details
xinput outputs (12.25 KB, application/zip)
2016-05-18 13:18 UTC, YAFU
no flags Details

Description YAFU 2016-05-17 18:22:51 UTC
Created attachment 123839 [details]
evemu-record for UC-Logic WP5540U

Hardware: the graphic tablet is a Genius EasyPen i405 (UC-Logic WP5540U)

Related report on Blender and DIGImend mailing list:

https://developer.blender.org/T48204

https://sourceforge.net/p/digimend/mailman/digimend-devel/?viewmonth=201605

The problem is that in Blender 3D strokes are erratic/dotted (it is not continuous) when pressure sensitivity is enabled. The problem is much more noticeable in vertical strokes than horizontal strokes.
Blender 3D and tablet on Windows are working well. In Linux I have problems only with Blender 3D, I have not noticed strange behavior in GIMP, Krita or MyPaint. Blender developers have suggested that perhaps these other programs soften the problem somehow.
Here I share the evemu-record output while drawing a vertical line in Blender 3D. In the Blender report you can download other files where shown evtest, xinput and blender outputs.

Thanks.

Kubuntu Linux 14.04 64bits
Kernel: 4.5.2-040502-generic
xserver-xorg-input-evdev version: 1:2.8.2-1ubuntu2
Comment 1 Peter Hutterer 2016-05-18 01:26:27 UTC
Analysis: the pressure data from the tablet itself is fine, you can check this with this script:
https://github.com/whot/input-data-analysis/tree/master/pressure-over-time
so this rules out any low-level device/kernel issues.

But the xinput test and xinput test-xi2 also show the x/y axis updates to be just fine. This indicates that the problem may be either fixed or in blender after all.


(In reply to YAFU from comment #0)
> Kubuntu Linux 14.04 64bits
> xserver-xorg-input-evdev version: 1:2.8.2-1ubuntu2

those are quite old packages and ubuntu has a tendency to patch a lot. I suggest you try a more recent version of evdev and/or the server.
Comment 2 Peter Hutterer 2016-05-18 01:27:43 UTC
also, I'm assuming that this is an evemu-record of a sequence that did reproduce the issue?
Comment 3 YAFU 2016-05-18 03:45:44 UTC
Created attachment 123864 [details]
evemu-record_blend files
Comment 4 YAFU 2016-05-18 03:56:21 UTC
Hi. In Kubuntu 16.04 I still have the same problem.
Kernel 4.4.0-21-generic
xserver-xorg-input-evdev version: 1:2.10.1-1ubuntu2

I attached a new file with evemu-record while I drew in blender. I also share the .blend files. If you have a tablet with pressure sensitivity using evdev, you can open those .blend files in Blender 3D and draw on the square. You remember to do slow strokes.
I have the confirmation that another person with  UC-Logic WP5540U has the same problem, but I do not know if it happens in every tablet using evdev driver.

I really do not know much about these technical data. There in the Blender report developers explain what the problem they see.
Comment 5 Peter Hutterer 2016-05-18 05:17:29 UTC
what's the output from xinput test "UC-LOGIC Tablet WP5540U Pen" when you move the stylus? and then the same again for xinput test-xi2 please (with the window maximised)
Comment 6 YAFU 2016-05-18 13:17:27 UTC
In Kubuntu 14.04 (kde/plasma 4) "xinput test" works only when I work over Gtk applications. In Kubuntu 16.04 (Plasma 5) "xinput test" works on Gtk and kde/Qt apps, but does not work on Blender.
So, the output of "xinput test" I share here is working on the desktop in Kubuntu 16.04. And the output of "xinput test-xi2" when work on Blender (maximized window). All of them with vertical movements.
Comment 7 YAFU 2016-05-18 13:18:17 UTC
Created attachment 123881 [details]
xinput outputs
Comment 8 Peter Hutterer 2016-05-19 01:02:26 UTC
thanks. note that xinput is an X application like GTK/KDE applications, it receives the same events. Unlike evemu it doesn't sit above/below anything, it's side-to side with other applications.

anyway, in this output I cannot see the symptom bastien describes in https://developer.blender.org/T48204#373424

Technical details: x input events don't always contain all axes, they contain either a first+num valuators (XI 1.x) or a valuator mask (XI 2.x). So when only y and pressure update you'd get a first valuator: 1, num_valuators 2.

In the comment there is the example of 1:391 and 2:0 which would indicate that the first+num valuators is incorrect and triggers a 0 pressure. If that was the case we'd see this in the xinput test output too. But there is no indication that happens so I'm now rather convinced that blender messes up the first + num valuator handling somehow.
Comment 9 Peter Hutterer 2016-05-19 01:08:45 UTC
the last comment https://developer.blender.org/T48204#374467 shows the correct handling of axes, so now I'm mostly confused as to why the axes_count (same as num_valuators, just different names to call it by) is wrong.

Keep trying to reproduce it with evemu-record and xinput test running. when the xinput test shows something like
    motion a[1]=16587 a[2]=0
then stop the recording and attach the evemu-record and xinput test output here.

Please restart frequently so that the evemu-record output is short. You'll get a a[2]=0 whenever you stop touching the surface, please ignore those.
Comment 10 YAFU 2016-05-19 04:20:21 UTC
Thank you.
What I do not understand is this: The problem happens all the time in Blender with vertical strokes and pressure sensitivity enabled, is always reproducible. According to my little understanding, if this were an xinput or evdev problem this problem should be visible in each log which I have sent you (and all of whom I have shared in Blender bug report).

Anyway I will try to get/reproduce that you ask me.
Comment 11 Peter Hutterer 2016-05-19 04:31:10 UTC
yes, it should be visible. But moreover - it should also be visible in other applications but so far only blender seems to have these issues. So that does hint at blender being at fault here.
Comment 12 Bastien Montagne 2016-05-19 18:27:34 UTC
Uuuuuuh… reading xinput code I see:

for(loop=0; loop<button->axes_count; loop++) {
    printf("a[%d]=%d ", button->first_axis + loop, button->axis_data[loop]);
}

…while in Blender we are currently doing something like that:

for(loop=button->first_axis; loop<button->axes_count+button->first_axis; loop++) {
    printf("a[%d]=%d ", loop, button->axis_data[loop]);
}

Stupid mistake, and easy to fix… Will commit this evening so that YAFU can confirm tomorrow whether it works or not. Sorry for the noise. :/
Comment 13 YAFU 2016-05-19 19:49:17 UTC
Compiled Blender from Master. Yes, it's working fine now!

Thanks Peter and Bastien!
Comment 14 Peter Hutterer 2016-05-19 23:47:49 UTC
excellent, thanks for fixing!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.