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

extended Lenovo Yoga X1 Gen5 Support #810

Merged

Conversation

hantangantan
Copy link
Contributor

@hantangantan hantangantan commented Oct 24, 2024

Hello everyone,

i have a Lenovo Yoga X1 Gen5, which has a display with integrated privacy function - think that might be the reason I have a different device id.

the way i implemented it makes it working correctly with the meson test, but creates following warning:

❯ libwacom-list-local-devices
failed to match 'usb|056a|5229' for product/vendor IDs. Skipping.
'usb|056a|5229' is an invalid DeviceMatch in '/usr/share/libwacom/wacom-isdv4-5229.tablet'
failed to match 'usb|056a|522a' for product/vendor IDs. Skipping.
'usb|056a|522a' is an invalid DeviceMatch in '/usr/share/libwacom/wacom-isdv4-5229.tablet'
failed to match 'usb|056a|522b' for product/vendor IDs. Skipping.
'usb|056a|522b' is an invalid DeviceMatch in '/usr/share/libwacom/wacom-isdv4-5229.tablet'

(libwacom-list-local-devices:18887): GLib-CRITICAL **: 16:08:56.547: g_array_free: assertion 'array' failed

(libwacom-list-local-devices:18887): GLib-CRITICAL **: 16:08:56.548: g_array_free: assertion 'array' failed
devices:
- name: 'ISDv4 5229'
  bus: 'usb'
  vid: '0x056a'
  pid: '0x522b'
  nodes: 
  - /dev/input/event5: 'Wacom Pen and multitouch sensor Pen'
  styli:
   - id: 0x1
     name: 'AES Pen'
     type: 'mobile'
     axes: ['x', 'y' , 'pressure']
     buttons: 1
     is_eraser: 'true'
     eraser_type: 'button'
   - id: 0x11
     name: 'AES Pen'
     type: 'mobile'


.....

edit: just checked again - there needs to be : as seperators to make it work without an error instead of |

but then the build fails:

❯ meson compile -C builddir
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /home/.../dev/git/libwacom/builddir
ninja: Entering directory `/home/.../dev/git/libwacom/builddir'
[23/28] Generating hwdb with a custom command (wrapped by meson to capture output)
FAILED: 65-libwacom.hwdb 
/usr/bin/meson --internal exe --capture 65-libwacom.hwdb -- /usr/bin/python3 libwacom-update-db --buildsystem-mode /home/.../dev/git/libwacom/data
--- stderr ---
Failed to process match usb:056a:522a in /home/.../dev/git/libwacom/data/wacom-isdv4-5229.tablet
Traceback (most recent call last):
  File "/home/.../dev/git/libwacom/builddir/libwacom-update-db", line 218, in <module>
    db = TabletDatabase(ns.path)
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/.../dev/git/libwacom/builddir/libwacom-update-db", line 119, in __init__
    self.tablets = sorted(self._load(path))
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/.../dev/git/libwacom/builddir/libwacom-update-db", line 137, in _load
    raise e
  File "/home/.../dev/git/libwacom/builddir/libwacom-update-db", line 134, in _load
    bus, vid, pid, *_ = match.split("|")
    ^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected at least 3, got 1)

[28/28] Linking target test-stylus-validity
ninja: build stopped: subcommand failed.

@hantangantan
Copy link
Contributor Author

btw: is the file supposed to be named wacom-* instead of lenovo-*? That seems to me somehow a litte bit inconsistent as there are also files named by the computer vendor.

@whot
Copy link
Member

whot commented Oct 27, 2024

edit: just checked again - there needs to be : as seperators to make it work without an error instead of |

you probably have an older version of libwacom, we had to change the format for 2.12 - prior to that it was : now it is |.

btw: is the file supposed to be named wacom-* instead of lenovo-*?

From our perspective it's still a wacom tablet (056a), the fact that it's inside a lenovo device doesn't really matter. And the main purpose of the wacom- prefix is to make it easier to find devices which again matters more for huions than wacoms since those give us more headaches...

Looks good otherwise, let's get this merged. For a local backport you can just s/|/: in the DeviceMatch

@whot whot merged commit 051385a into linuxwacom:master Oct 27, 2024
15 checks passed
@whot
Copy link
Member

whot commented Oct 27, 2024

side-note: for git commit messages it's best to use imperative style, i.e. fix blah instead of past-tense fixed blah.

also, I just noticed that github mangled your email to the users.noreply version on squash, not sure wtf happend there but i think this may be a setting in your profile? Either way, sorry about that, if you want your email to show up in the record I can revert and re-commit with your gmail.

@hantangantan
Copy link
Contributor Author

Thanks for pointing that out - wasn't really aware of using an imperative style, but I will be from now on^^

Yess, u r right, it's a setting in my account - for me it's fine like that, but thank you for offering to update it!

@hantangantan hantangantan deleted the lenovo-x1-gen5-support-extension branch October 28, 2024 18:17
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.

2 participants