Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pen tilt y is being replaced with tilt x since 0.36 #11

Closed
daniel-ferguson opened this issue Mar 3, 2018 · 4 comments
Closed

Pen tilt y is being replaced with tilt x since 0.36 #11

daniel-ferguson opened this issue Mar 3, 2018 · 4 comments

Comments

@daniel-ferguson
Copy link
Contributor

daniel-ferguson commented Mar 3, 2018

xf86-input-wacom: 0.36
OS: Arch linux
Tablet: Intuos 5 PTH-650/K

I noticed issues with tilt direction being broken in Krita and did some digging...

Is my tablet broken?

Probably not, I plugged the tablet into my laptop running an older version of xf86-input-wacom (0.35.x) and tilt works fine.

Where is the issue occurring

I took a dig into events being emitted by the kernel driver for my wacom pen with:

evtest | grep TILT

ABS_TILT_X and ABS_TILT_Y events are being emitted separately, with values corresponding to the angle I'm holding the pen.

On the other hand, looking at xorg events with:

xinput test $pen_id

Gave me rows like:

motion ... a[3]=39 a[4]=39 ...

Where a[3] and a[4] are always equal, and respond to changes in x tilt. Looking at the source for this project indicates they represent x and y tilt, respectively.


I took a dig through source changes which have occurred since xf86-input-wacom 0.35 and spotted this line, which looks like it'd explain the issue I'm seeing: https://github.com/linuxwacom/xf86-input-wacom/blob/master/src/wcmFilter.c#L317

ds->tilty = wcmFilterAverage(state->tiltx, common->wcmRawSample);

It appears there's a typo here, tiltx is being averaged, then being assigned to tilty - I think the line should read:

ds->tilty = wcmFilterAverage(state->tilty, common->wcmRawSample);

Let me know if there's anything I can do to help with this, and thank you for your efforts maintaining this great project 👍

edit: added a little more info to line of source code

@daniel-ferguson daniel-ferguson changed the title Pen tilt y is being replaced with tilt x Pen tilt y is being replaced with tilt x since 0.36 Mar 3, 2018
@daniel-ferguson
Copy link
Contributor Author

Just a quick follow-up - I've rebuilt 0.36 with the change illustrated above and, after a reboot, seem to be getting correct tiltys showing up when inspecting events with xinput test $pen_id.

Brushes in krita are behaving well too.

@jigpu
Copy link
Member

jigpu commented Mar 5, 2018

Ouch, good find. Looks like I authored the offending commit (527fa95) and was bit by the classic last-line effect...

Would you mind providing a copy of your fix? You can either send a git patch directly to the linuxwacom-devel mailinglist, attach a git patch to this bug, or make a pull request with the fix. In any case, please be sure to include the following three lines at the end of your commit message for tracking purposes:

Ref: https://github.com/linuxwacom/xf86-input-wacom/issues/11
Fixes: 527fa95c29 ("Refactor coordinate averaging to seperate function")
Signed-off-by: $YOUR_NAME <$YOUR_EMAIL>

@daniel-ferguson
Copy link
Contributor Author

^ Sorry for the noise, github's commit message link formatting surprised me a few times.

jigpu pushed a commit that referenced this issue Mar 7, 2018
Refactoring in (527fa95) introduced a typo in wcmFilterCoord which
resulted in the value of tilt x being assigned to tilt y.

Ref: #11
Fixes: 527fa95 ("Refactor coordinate averaging to seperate function")
Signed-off-by: Daniel Ferguson <danielferguson@me.com>
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
@jigpu
Copy link
Member

jigpu commented Mar 26, 2018

Fix has been included with the 0.36.1 release.

@jigpu jigpu closed this as completed Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants