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

Added support for Lenovo Ideapad Duet #636

Merged
merged 9 commits into from
Mar 2, 2024
Merged

Added support for Lenovo Ideapad Duet #636

merged 9 commits into from
Mar 2, 2024

Conversation

Neolanco
Copy link
Contributor

I'm not sure if the stylus is right, I don't think there are any USI pens that have buttons or erasers.

data/leonovo-ideapad-duet.tablet Outdated Show resolved Hide resolved
Comment on lines 10 to 11
#Styli=@generic-no-eraser
Styli=0x812
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you run libinput record, the ABS_MISC event tells you the tool id and thus the styli to pick. Generally if you support 0x812 that means you also support the various other pens in that group - though 0x812 is the very old intuos pen (15+ years old now).

So my guess is that it's either @generic-no-eraser or the @isdv4-aes group or we need another set of pens defined here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, in the libwacom repository there's ./tools/show-stylus.py which will tell you the tool ID in slightly more human-readable format.

Copy link
Contributor Author

@Neolanco Neolanco Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, in the libwacom repository there's ./tools/show-stylus.py which will tell you the tool ID in slightly more human-readable format.

So this is my output:

./show-stylus.py
Using "hid-over-i2c 27C6:0E30 Stylus": /dev/input/event5
Using stylus file(s): /usr/share/libwacom/libwacom.stylus
Tool id 0x1 serial 0x0 in-proximity: False 
^CTerminating
Suggested line for .tablet file:
Styli=isdv4-aes

But 0x1 has a button and a eraser button, which mine doesn't. I also couldn't find one that has.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0x27C6 says it's a Goodix USB ID so basically what we have here is a stylus that's not a wacom stylus and libwacom implicitly assumes that all styli with IDs are wacoms.

So if the ID is "re-used" we need to fix libwacom to be able to tell the difference between wacom styli and non-wacom styli. Then we can add a new definition for this stylus with 72C6:1. I wonder what the effect of this will be on the API...

@whot
Copy link
Member

whot commented Feb 19, 2024

So given #639 I would say for this tablet file: add the 0x1 stylus with a big fixme in the comments. Yes, it's wrong but if the id doesn't match the actual data it won't work at runtime anyway. Once we fix #639 we can fix the tablet file but meanwhile you get something that's mostly correct.

Right now though I'm almost tempted to wait it out to see if more of these pens appear - it's a fair bit of effort to add the new API (including updating all our consumers) and I'd rather not do this for a unique device.

@Neolanco
Copy link
Contributor Author

To be fair, the duet is a chromebook-tablet-thingy on which I had to jump through a few hoops to get linux installed in the first place, so I don't think there will be many more that would benefit from this. I also installed a port of postmarket os for this device specifically, so it's not impossible that they applied some sort of patch that reports a wrong stylus.
Personally, I just added the .tablet file to fix screen rotation on gnome for me.

The stylus ID here doesn't give us a benefit
@whot
Copy link
Member

whot commented Feb 28, 2024

added a few minor fixes (and commented out the stylus line) but now that I look at this again: the sysinfo is missing, can you please add this? Thanks

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

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.

@Neolanco
Copy link
Contributor Author

Neolanco commented Mar 1, 2024

Fixed a typo in the filename and added the sysinfo.

@whot whot merged commit c52ca0f into linuxwacom:master Mar 2, 2024
12 of 13 checks passed
@whot
Copy link
Member

whot commented Mar 2, 2024

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sysinfo needed Used to indicate sysinfo is missing from the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants