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

adding .tablet file for Ingenic touch and pen display. #621

Merged
merged 4 commits into from
Jan 22, 2024

Conversation

mistertwo
Copy link
Contributor

@mistertwo mistertwo commented Dec 23, 2023

This is in reference to issue #602 . Adds support for the Ingenic touch/pen screens on the Lenovo Yoga Book 9i.

Edited 2Jan23 to correct laptop model name.

@whot whot added the sysinfo needed Used to indicate sysinfo is missing from the PR label Jan 3, 2024
Copy link

github-actions bot commented Jan 3, 2024

Hi, there. I'm a bot and have been asked to have a look at this.

Please run the sysinfo script from https://github.com/linuxwacom/wacom-hid-descriptors and
file a new issue in that repo with the resulting sysinfo tarball. The README in that repo
has more information and instructions.

The .tablet files in this PR should then link to the sysinfo in this form:

# sysinfo.abCdE1234.tar.gz
# https://github.com/linuxwacom/wacom-hid-descriptors/issues/1234

A git grep sysinfo will show how this is currently used in existing data files.

See also https://github.com/linuxwacom/libwacom/wiki/Adding-a-new-device


This is an automated comment created by a bot. Responding to the bot or mentioning it won't have any effect.

data/ingenic-6161.tablet Outdated Show resolved Hide resolved
data/ingenic-6161.tablet Outdated Show resolved Hide resolved
@whot
Copy link
Member

whot commented Jan 5, 2024

I just fixed the sysinfo check in #623, can you please rebase on top of that? Thanks.

@whot whot removed the sysinfo needed Used to indicate sysinfo is missing from the PR label Jan 7, 2024
Copy link

github-actions bot commented Jan 7, 2024

Hi, there. I'm a bot and have been asked to have a look at this.

Thanks for providing the sysinfo. Someone will be along shortly to review the PR.


This is an automated comment created by a bot. Responding to the bot or mentioning it won't have any effect.

@whot
Copy link
Member

whot commented Jan 7, 2024

hmm, looks like this fails meson test -C builddir because the class is Cintiq and for that we require actual styli to be specified. From the gnome-control-center issue I can see your device has a serial number so you would need something like Styli=@isdv4-aes.

The stylus tool ID is the ABS_MISC value in libinput record (as opposed to MSC_SERIAL which is the unique pen serial) - that should (hopefully) have an entry in data/libwacom.stylus - then you specify the whatever group that stylus belongs to. e.g. if the id is 0x81b then the line would be Styli=@intuos3.

@mistertwo
Copy link
Contributor Author

The stylus tool ID is the ABS_MISC value in libinput record (as opposed to MSC_SERIAL which is the unique pen serial) - that should (hopefully) have an entry in data/libwacom.stylus - then you specify the whatever group that stylus belongs to. e.g. if the id is 0x81b then the line would be Styli=@intuos3.

I've checked into the ABS_MISC value via libinput record, and it appears to be something that determines distance of the pen from the display. It's incrementing by ~35 for each input "frame" and increases the increment value as the pen is pulled away from the screen.

    libinput:
    - {time: 0.106812, type: TABLET_TOOL_AXIS, tip: up, point: [7.82, 43.09], tilt: [25.70, 16.68], pressure: 0.00}
  - evdev:
    - [  0, 111793,   3,   0,   27760] # EV_ABS / ABS_X                 27760 (+12)
    - [  0, 111793,   3,   1,   13409] # EV_ABS / ABS_Y                 13409 (-12)
    - [  0, 111793,   3,  26,    2555] # EV_ABS / ABS_TILT_X             2555 (-5)
    - [  0, 111793,   3,  27,    1682] # EV_ABS / ABS_TILT_Y             1682 (+4)
    - [  0, 111793,   3,  40,   21824] # EV_ABS / ABS_MISC              21824 (+38)
    - [  0, 111793,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +5ms
    libinput:
    - {time: 0.111793, type: TABLET_TOOL_AXIS, tip: up, point: [7.75, 43.19], tilt: [25.65, 16.74], pressure: 0.00}
  - evdev:
    - [  0, 113811,   3,   0,   27776] # EV_ABS / ABS_X                 27776 (+16)
    - [  0, 113811,   3,   1,   13396] # EV_ABS / ABS_Y                 13396 (-13)
    - [  0, 113811,   3,  26,    2551] # EV_ABS / ABS_TILT_X             2551 (-4)
    - [  0, 113811,   3,  27,    1685] # EV_ABS / ABS_TILT_Y             1685 (+3)
    - [  0, 113811,   3,  40,   21862] # EV_ABS / ABS_MISC              21862 (+38)
    - [  0, 113811,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +2ms

Would the PenDisplay class fit this situation better? Also, if I'm not reading the libinput record reports right, please let me know.

data/ingenic-6161.tablet Outdated Show resolved Hide resolved
@whot
Copy link
Member

whot commented Jan 22, 2024

The ABS_MISC tool id is constant for a pen and never changes (on wacom devices anyway). So if you get something else in ABS_MISC that's a sign the kernel driver is not doing the right thing.

It's incrementing by ~35 for each input "frame" and increases the increment value as the pen is pulled away from the screen.

That sounds like maybe two separate things in the HID report are combined into one axis?
cc @JoseExposito, @bentiss in case they have time, but please attach a hid-recorder output here too (https://gitlab.freedesktop.org/libevdev/hid-tools/), that should tell us more.

Would the PenDisplay class fit this situation better

Yeah, let's try that, we can change it later if we end up with serial numbers. The Class isn't actually used by anything that I know of, so it's just a matter of getting past the test suite anyway here.

@whot whot merged commit cc1ba9c into linuxwacom:master Jan 22, 2024
13 checks passed
@bentiss
Copy link
Contributor

bentiss commented Jan 22, 2024

Looking at the (too small) hid-recorders from https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2727#note_1910892, isn't ABS_MISC matching the HID usage Scan Time?

In other words, is ABS_MISC decreasing as you get closer to the surface?

@mistertwo
Copy link
Contributor Author

mistertwo commented Jan 25, 2024

@bentiss the delta between frames decreases as the pen tip gets closer to the screen. The actual value of ABS_MISC continues to increment until it hits FFFF, then it recycles.

For completeness, here's a yaml of output from libinput record for the pen tip on the upper screen. Movement contents:

  • slow movement of the pen to the screen
  • two touches of the tip to the screen
  • slow pullback from the screen.

ingenic_stylus.zip

@bentiss
Copy link
Contributor

bentiss commented Jan 25, 2024

@bentiss the delta between frames decreases as the pen tip gets closer to the screen. The actual value of ABS_MISC continues to increment until it hits FFFF, then it recycles.

So in other words, this value always increments, no matter the position of the pen (it rolls over after reaching FFFF). And if you look at your recording, each ABS_MISC value is different from each other (minus the roll over), so this is a Scan Time HID event, which just allows to get a timestamp on the frame. Not something you can use here to guess the position of the pen.

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

Successfully merging this pull request may close these issues.

3 participants