Open quo opened 2 years ago
TODO: retest something and change unupdated date
Warning: testing is not completely done. Comment can be updated soon. Also the test only control factor of Wayland/X11; I found later that kernel is also affect the result, which be later re-test.
Device: Surface Laptop Studio PCI VID:DID: 8086:a0d0 (from lspci -D -n 3rd column) Touch VID:PID: 045E:0C1B (from output of ipstd) dmesg log: dmesg.log Workaround used: intremap=nosid Whether multitouch and/or pen work using the experimental iptsd:
Without IPTSD (kernel version factor is not in controlled, require re-test): Single touch work as touch event Tested on: Ubuntu 22.04 LTS with Linux Surface Kernel GNOME-Shell Wayland and X11 raw config on dmesg: same as specified above ipts.conf: InvertX,InvertY=False; Screen size is set to default (since no matched config file at that time, so value will be 0 for both Width/Heigth)
For more information (such as: other issues) see #8
Thanks! I've opened separate issues for the bugs. I will look into the truncated prd error later. Can you test the workaround for the suspend bug I've posted in https://github.com/quo/ithc-linux/issues/9?
Lenovo X1 Fold: works with modprobe ithc hid=1 poll=1
showing hid-generic 0001:056A:5102.000B in dmesg
I'm using a vanilla Ubuntu 22.04, and trying to compile a 5.17.11 kernel in case more recent drivers are required for other things (ex: i915) After the kernel is compiled, I will try without poll.
Right now, with poll, the Lenovo Wacom pen works (both point and click) but single touch finger doesn't seem to work.
For multitouch, I can't use iptsd due to illegal instruction
errors so my test are limited.
The single touch issue may be due to a lack of config as xinput shows various devices including Touchscreen pad, touch and pad.
Furthermore, evtest on xinput device 13 (Touchscreen) shows on-screen textual activity synchronized with the movement of the finger on the screen, including EV_KEY ... BTN_TOUCH when touching the screen - though no mouse click happens.
I'd be happy to try more things as soon as I can find instructions on how to configure the xinput HID devices on Ubuntu to produce mouse movements and clicks.
9?
@quo the test result is there.
@csdvrx Thanks! It sounds like the device uses standard HID (possibly with some nonstandard Wacom things?) instead of the MS Surface HID protocol. This means that you probably don't need iptsd.
Can you please:
sudo dmesg
output.cat /sys/class/misc/ithc/device/*/report_descriptor > ithc-x1-desc.dat
, and include the generated ithc-x1-desc.dat file (this is the HID report descriptor which should tell us the format of the data that the Wacom device is generating).Thanks again.
@quo thanks a lot for fixing the AVX512 issue on iptsd; I understand this CPU is a bit exotic which is why I provided the details :)
On yesterday ithc, there's no such descriptor, so after recompiling with:
git pull ; dkms uninstall ithc -v 0.1 ; dkms remove ithc -v 0.1 ; make dkms-install
[ 1442.463344] ithc 0000:00:11.0: config: e0000002 00000000 0001c08b 00000004 00000014 43495424 70060a6a 5102056a 00000001 00040050 00000000 00000000 00000000 0004035e 00000000 00000000
[ 1442.464441] ithc 0000:00:11.0: registered device ithc
[ 1442.464511] ithc 0000:00:11.0: using polling instead of irq
[ 1442.586017] input: Intel Touch Host Controller Touchscreen as /devices/pci0000:00/0000:00:11.0/0001:056A:5102.000A/input/input17
[ 1442.586212] input: Intel Touch Host Controller as /devices/pci0000:00/0000:00:11.0/0001:056A:5102.000A/input/input18
[ 1442.586296] input: Intel Touch Host Controller Stylus as /devices/pci0000:00/0000:00:11.0/0001:056A:5102.000A/input/input19
[ 1442.586457] input: Intel Touch Host Controller as /devices/pci0000:00/0000:00:11.0/0001:056A:5102.000A/input/input20
[ 1442.586605] input: Intel Touch Host Controller Mouse as /devices/pci0000:00/0000:00:11.0/0001:056A:5102.000A/input/input21
[ 1442.586948] hid-generic 0001:056A:5102.000A: input,hidraw5: <UNKNOWN> HID v1.00 Mouse [Intel Touch Host Controller] on pci-0000:00:11.0/ithc
Since yesterday, the pen stopped working (both hover and clicking were working): even if it's listed as entry 19 in the dmesg, it's not shown in xinput list anymore.
However, now one finger is now working finger (finger actions bring up Ubuntu OSK)
I'll now try to test iptsd
@csdvrx As I suspected, according to the descriptor the data on the X1 Fold is just normal HID data. The reason iptsd gives the 'block' errors is because it can't understand this data, it only works for MS Surface HID data. But the good news is that everything should just work out of the box, without iptsd, because the Linux kernel already has built-in drivers for normal HID and also for Wacom specifically.
I compared the X1 Fold HID descriptor with some of the descriptors from the linuxwacom project: https://github.com/linuxwacom/wacom-hid-descriptors I didn't find an exact match, but it looks like the descriptor is very similar to some other descriptors, e.g. the one from the X1 Yoga 6.
If you still have issues, please update the ithc driver, because I did fix a small HID bug yesterday. If that doesn't help, you could try asking the linuxwacom people if they have any ideas.
Thank you for the driver, I tested it on my SP8 and it works very well.
The only issue I'm facing off is that the touchscreen doesn't work after waking-up from hibernation. As a workaround I added a script in /usr/lib/systemd/system-sleep/
case $1/$2 in
post/hibernate)
systemctl stop iptsd
modprobe -r ithc
modprobe ithc
;;
esac
Device informations: | Device | PCI VID:DID | Touch VID:PID | Notes | Raw config sample |
---|---|---|---|---|---|
Surface Pro 8 | 8086:a0d0 | 045E:0C37 | Requires nosid |
e0000002 00000000 001fc0ff 00000010 00000014 43495424 09e337e8 0c37045e 00000001 809336c3 2a57a27a 00000000 47a9bdfc 00040302 5e491251 2ba14ad2 |
dmesg:
[ 0.000000] Linux version 5.18.4-arch1-1-surface (linux-surface@archlinux) (gcc (GCC) 12.1.0, GNU ld (GNU Binutils) 2.38) #1 SMP PREEMPT_DYNAMIC Thu, 16 Jun 2022 16:56:46 +0000
[ 0.000000] DMI: Microsoft Corporation Surface Pro 8/Surface Pro 8, BIOS 18.102.141 12/15/2021
[ 0.467458] pci 0000:00:10.6: [8086:a0d0] type 00 class 0x090100
[ 3.433002] ithc: loading out-of-tree module taints kernel.
[ 3.448702] ithc: module verification failed: signature and/or required key missing - tainting kernel
[ 3.450445] ithc 0000:00:10.6: enabling device (0000 -> 0002)
[ 3.668686] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 09e337e8 0c37045e 00000001 809336c3 2a57a27a 00000000 47a9bdfc 00040302 5e491251 2ba14ad2
[ 3.669115] ithc 0000:00:10.6: registered device ithc
[ 3.925189] ithc 0000:00:10.6: enabling multi-touch mode
lspci:
00:10.6 Digitizer Pen: Intel Corporation Device a0d0 (rev 20)
Subsystem: Microsoft Corporation Device 0055
Flags: bus master, medium devsel, latency 0, IRQ 159, IOMMU group 7
Memory at 603e160000 (64-bit, non-prefetchable) [size=32K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [70] Power Management version 3
Kernel driver in use: ithc
Kernel modules: ithc
@csdvrx @quo I have a x1 fold as well and just installed the ithc. after putting in nosid, pen input works. I am unable to get single touch working even after rebuilding the ithc. am I missing a step somewhere?
In my past attempts, when the pen was working, I had problems with touch - and likewise the other way.
The x1 fold might be slightly different and require tweaks to get both working at the same time.
Then there's multi-touch: 3 fingers gestures in windows 11 shows it must be possible with the hardware.
Maybe we should explore more how the Fold differs from Surfaces?
(I'm still working on power savings: I can now get closer to 0.4%/h on S01x in Windows 11, like this weekend I measured 21h of sleep drawing 8%. I need to know how low it can be to first try to match that baseline in Linux before trying to improve it)
Hello, thank you for the driver, working fine on Surface Pro 7+
Surface pro 7+ / 16Go Debian 11 Linux version 5.18.10-surface Wayland
using nosid (mandatory), didn't try poll
Pen is working with quo/iptsd driver (built / not the iptsd driver from deb packages of linux-surface repo)
simple touch working, double touch, selecting (in nautilus), dragging does not in nautilus right clic by pressing long simple touch works only in firefox, but does not in nautilus (it opens 'new favorite' [nouveau signet]), what is the input sent by a long press ?
simple touch working, double clic too, hovering, selecting but not dragging too in nautilus long press does not give me right clic using the right clic with the dedicated button gives me this clic but on hoovering : without clicking I get right clic
PS: how can I test which event is sent by each action ? I use Wayland And Is it remapable : for example, is there a possibility to get right clic with a single long clic ?
In firefox : touching with finger make me scroll the page; but with pen it selects the text. This behavior is editable ?
long press does not give me right clic
for pen on windows/linux, it dont apply right click when long press by pem. and I think it is normal behaviour and should be the good behaviour because long press using pen is quite not good as pen is should be more precise and not optimized for long press like touch.
https://github.com/quo/iptsd/issues/5 maybe you could test this, test on what I test in 1st message.
I think If I not guess it wrong you should have all or almost same test result.
It works with Surface Pro 9.
Device Name Surface Pro 9 (Intel i7)
Full output of dmesg dmesg.log There're thousands of lines with same content like:
[ 4889.066108] i915 0000:00:02.0: [drm] ERROR Fault errors on pipe A: 0x00000080
I think they are irrelative and deleted from the log.
Whether you had to use intremap=nosid, poll, or any other workarounds.
Not used intremap=nosid or poll.
But need to add one line in the src/ithc-main.c
as: (told from Dorian Stoll in matrix channel 'linux-surface')
static const struct pci_device_id ithc_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_THC_LKF_PORT1) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_THC_LKF_PORT2) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_THC_TGL_LP_PORT1) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_THC_TGL_LP_PORT2) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_THC_TGL_H_PORT1) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_THC_TGL_H_PORT2) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x51d0) },
{}
};
- Whether multitouch and/or pen work using the experimental iptsd
Tried the latest `iptsd_0.5.1-1_amd64.deb` from [actions page](https://github.com/linux-surface/iptsd/actions/runs/3401872458)
- Pen not tested, don't have one.
- Singletouch works for both laptop/tablet mode.
- Multitouch not work
Tested with X11.
- Tried to zoom-in web page in firefox with two fingers, not work. Firefox is launched with environment variable `MOZ_USE_XINPUT2=1`.
- Also Tried launch VSCode with param `--touch-events`, cannot zoom-in documents with two fingers.
Outdated Warning: using iptsd from linux-surface/iptsd instead of quo/iptsd
When iptsd from software repo can be used for ithc, will be reported inplace and new comment
@aj3423
Pls see https://github.com/linux-surface/linux-surface/wiki/Installation-and-Setup at section Touch control
You seem to have enable X11 touch in Firefox first, unless using on Wayland (Firefox must also run as Wayland mode)
@NP-chaonay Comment updated.
Thanks. I've added the new PCI ids in 31ad276. The fact that single touch works means that ithc is working fine. So if multitouch doesn't work, iptsd might need some changes.
EDIT: For iptsd, you'll probably have to add a config file. See here: https://github.com/linux-surface/iptsd/tree/master/etc/config You could also try this branch, which tries to read the relevant config parameters from the device: https://github.com/quo/iptsd/tree/pr-metadata
Thanks quo, however I personally suggest the first approach. But I like the metadata function btw.
@aj3423 could you edit some portion of the /etc/ipts.conf to these:
InvertX = false
InvertY = false
Width = 27.40
Height = 18.27
Noted that you have to adjust screen size later but for now these 4 required to work since configuration file does exist.
If it work then using that config, until there is configuration file for your device in https://github.com/linux-surface/iptsd/tree/master/etc/config
So after that, you can revert change in that 4 lines
@NP-chaonay The config file /etc/ipts.conf
already exists, I tried the 4 lines of code, then changed the screen resolution after that, but still not work
@quo I tried the pr-metadata, and then change the screen resolution, the multitouch WORKS now. It works when zoom-in pages in brave-browser, but not work for firefox/vscode. Some output:
~/Downloads/iptsd > ./build/src/daemon/iptsd /dev/hidraw8
[15:06:18.533] [info] Metadata: rows=46, columns=68, width=27389, height=18259, transform=[408.79105, 0, 0, 0, 405.75555, 0], unknown=1, [178, 182, 180, 1, 178, 182, 180, 1, 90, 171, 100, 20, 172, 177, 175, 2]
[15:06:18.534] [info] Connected to device 045E:0C52
@NP-chaonay I did set environment variable MOZ_USE_XINPUT2=1
for firefox, and launched vscode with code ... --touch-events
Surface Laptop 4 Intel - Linux Mint 21 I did use intremap=nosid Multitouch works (I don't have a pen) using the latest iptsd: https://github.com/linux-surface/iptsd/
sudo dmesg | grep -Ei 'ithc|linux version|dmi:|class 0x0901'
[ 0.000000] Linux version 6.0.8-surface (root@031da3e085d3) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #3 SMP PREEMPT_DYNAMIC Sun Nov 13 20:13:58 UTC 2022
[ 0.000000] DMI: Microsoft Corporation Surface Laptop 4/Surface Laptop 4, BIOS 18.301.143 03/30/2022
[ 0.277570] pci 0000:00:10.6: [8086:a0d0] type 00 class 0x090100
[ 4.190917] ithc: loading out-of-tree module taints kernel.
[ 4.193105] ithc 0000:00:10.6: enabling device (0000 -> 0002)
[ 4.316093] ithc 0000:00:10.6: config: e0000402 00000000 000a00ff 0000001c 0000001c 43495424 ffa00a28 0c31045e 00000001 0700648b 00000000 00000000 00000000 0404035e 000001c0 00000002
[ 4.316508] ithc 0000:00:10.6: registered device ithc
[ 4.487803] hid-generic 0001:045E:0C31.0003: input,hidraw2:
Awesome, thanks!
@HunJanLiu Thanks, btw SP8 have been reported before and it all work.
So you might try these
1) check if you using intremap not ntremap 2) At this moment, you must install iptsd from github repo of linux-surface/iptsd but you instead click on action tab, select latest sucessful workflow and download the debian package and (but before install see below first) install it.
3) if you have install iptsd from source, you have to remove it first, btw the iptsd from apt install isnt be affected.
4) after 2) , you can config something in /etc/ipts.conf (config something you seem know, and leave some not know meaning) and then reboot to test it. btw it should work
did now it works thx
@mnilsson76 (or anyone else with a Surface Laptop 5)
I would appreciate it if you could test the current ithc version on the SL5 and report the results here. I'm especially interested if the nosid
workaround if still needed on the SL5. If you've already applied the workaround, please remove it again, reboot and retest.
Thanks in advance!
@mnilsson76 (or anyone else with a Surface Laptop 5) I would appreciate it if you could test the current ithc version on the SL5 and report the results here. I'm especially interested if the
nosid
workaround if still needed on the SL5. If you've already applied the workaround, please remove it again, reboot and retest. Thanks in advance!
I'll get that done tonight
@mnilsson76 (or anyone else with a Surface Laptop 5) I would appreciate it if you could test the current ithc version on the SL5 and report the results here. I'm especially interested if the
nosid
workaround if still needed on the SL5. If you've already applied the workaround, please remove it again, reboot and retest. Thanks in advance!I'll get that done tonight
Ok, here we go:
[ 0.000000] Linux version 6.0.12-surface (root@a4c646d9329b) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #5 SMP PREEMPT_DYNAMIC Sun Dec 11 14:19:44 UTC 2022 [ 0.000000] DMI: Microsoft Corporation Surface Laptop 5/Surface Laptop 5, BIOS 7.10.143 08/29/2022 [ 0.482760] pci 0000:00:10.6: [8086:51d0] type 00 class 0x090100 [ 87.201759] ithc: loading out-of-tree module taints kernel. [ 87.201878] ithc: module verification failed: signature and/or required key missing - tainting kernel [ 87.203758] ithc 0000:00:10.6: enabling device (0000 -> 0002) [ 87.437780] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 09e3d2e8 0c59045e 00000001 30354141 5e7b5d98 00000000 b9be6b38 00040302 c8c4c4e1 0592c2fb [ 87.438768] ithc 0000:00:10.6: registered device ithc [ 87.566722] hid-generic 0001:045E:0C59.0005: input,hidraw4: <UNKNOWN> HID v1.00 Device [Intel Touch Host Controller] on pci-0000:00:10.6/ithc [ 100.554682] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 09e3d2e8 0c59045e 00000001 10354141 5c7b5d88 00000000 b9beeb38 00040302 c0c4c4e1 05d2c2fb [ 100.555615] ithc 0000:00:10.6: registered device ithc [ 100.682393] hid-generic 0001:045E:0C59.0006: input,hidraw4: <UNKNOWN> HID v1.00 Device [Intel Touch Host Controller] on pci-0000:00:10.6/ithc
The touchscreen works with the latest ithc without nosid. I've also been able to get multitouch working somewhat with iptsd from the newest workflow. The released iptsd 0.5.1 doesn't seem to work though.
Great, thanks! I guess that confirms that the source ID issue was a hardware bug that's been fixed with Alder Lake.
I have a ThinkBook 13x Gen 4 in hand, the driver fails to initialize the touchscreen:
[ 0.000000] Linux version 6.8.11-300.fc40.x86_64 (mockbuild@f09cc32e12c24ed6a1a66c2a2e9f1728) (gcc (GCC) 14.1.1 20240522 (Red Hat 14.1.1-4), GNU ld version 2.41-37.fc40) #1 SMP PREEMPT_DYNAMIC Mon May 27 14:53:33 UTC 2024
[ 0.000000] DMI: LENOVO 21KR/LNVNB161216, BIOS MTCN43WW 02/29/2024
[ 0.283665] pci 0000:00:10.0: [8086:7e49] type 00 class 0x090100 conventional PCI endpoint
[ 8475.268177] ithc 0000:00:10.0: enabling device (0000 -> 0002)
[ 8475.271468] ithc 0000:00:10.0: ACPI config: InputHeaderAddr=0x1000 InputBodyAddr=0x1100 OutputBodyAddr=0x2000 ReadOpcode=0x0b WriteOpcode=0x02 ReadMode=0 WriteMode=0 Frequency=16000000 LimitPacketSize=0 TxDelay=0 ActiveLTR=1023 IdleLTR=1023
[ 8475.592545] ithc 0000:00:10.0: received type 255 instead of reset response
[ 8475.592551] ithc 0000:00:10.0: ithc_quickspi_init: ithc_quickspi_init_hidspi failed with -42
[ 8475.592553] ithc 0000:00:10.0: ithc_init_device: ithc_quickspi_init failed with -42
[ 8475.592555] ithc 0000:00:10.0: ithc_start: ithc_init_device failed with -42
[ 8475.592559] ithc: probe of 0000:00:10.0 failed with error -42
Is there any information I should collect?
@craigcabrey Thanks for testing! Can you try the sl6 branch? It has some changes that are probably also necessary for the ThinkBook.
I am happy to report that (at least on 6.8.11), that branch works!
Awesome! Can you post the "device descriptor" line from dmesg?
[ 1204.423167] ithc 0000:00:10.0: enabling device (0000 -> 0002)
[ 1204.424420] ithc 0000:00:10.0: ACPI config: InputHeaderAddr=0x1000 InputBodyAddr=0x1100 OutputBodyAddr=0x2000 ReadOpcode=0x0b WriteOpcode=0x02 ReadMode=0 WriteMode=0 Frequency=16000000 LimitPacketSize=0 TxDelay=0 ActiveLTR=1023 IdleLTR=1023
[ 1204.743332] ithc 0000:00:10.0: Device descriptor: bcdVersion=0x0300 wReportDescLength=563 wMaxInputLength=8192 wMaxOutputLength=8192 wMaxFragmentLength=4096 wVendorID=0x04f3 wProductID=0x427a wVersionID=0x6712 wFlags=0x0000 dwReserved=0x427a0000
[ 1205.777839] hid-multitouch 0001:04F3:427A.0003: failed to fetch feature 68
[ 1205.777912] input: Intel Touch Host Controller as /devices/pci0000:00/0000:00:10.0/0001:04F3:427A.0003/input/input17
[ 1205.778202] input: Intel Touch Host Controller UNKNOWN as /devices/pci0000:00/0000:00:10.0/0001:04F3:427A.0003/input/input18
[ 1205.778225] input: Intel Touch Host Controller UNKNOWN as /devices/pci0000:00/0000:00:10.0/0001:04F3:427A.0003/input/input19
[ 1205.778278] hid-multitouch 0001:04F3:427A.0003: input,hidraw2: <UNKNOWN> HID v1.00 Device [Intel Touch Host Controller] on pci-0000:00:10.0/ithc
Thanks. I'll merge those changes into master once it's been confirmed that they also work on the Surface Laptop 6.
failed to fetch feature 68
That's curious. Looks like a timeout since there's a one second gap in the timestamps. Feature reports work with ithc on Surface devices, so maybe its just this device being weird.
Can you maybe upload the report descriptor (should be at /sys/devices/pci0000:00/0000:00:10.0/0001:04F3:427A.0003/report_descriptor
)? Just so I can check what feature 68 is.
report_descriptor.zip
from /sys/devices/pci0000\:00/0000\:00\:10.0/0001\:04F3\:427A.0004/report_descriptor
I also installed 6.9.3-200.fc40.x86_64
, works on that kernel too.
So feature report 68 is the Microsoft Certification data. I'm surprised that Linux would even try to access that, but apparently it does that to make some Synaptics devices work: https://github.com/torvalds/linux/commit/45c5c6828214605eaefa6755c47bd1a2c7eb203e
The kernel should also load feature report 10 (contact max), and that doesn't seem to cause an error. So my guess is that despite being listed in the descriptor, report 68 simply isn't actually implemented in the device. Maybe on Windows, they use a filter driver or some other hack to provide the Certification blob.
In any case, if the touchscreen works then we can ignore that error.
If you've tested the driver and it doesn't work, please open a new issue if one doesn't already exist for your device.
If the driver works (or at least appears to do something in dmesg), please reply here with the following information (especially if the device still has question marks in the table below or is not listed at all):
sudo dmesg
(or at least the output ofsudo dmesg | grep -Ei 'ithc|linux version|dmi:|class 0x0901'
).intremap=nosid
,poll
, or any other workarounds.nosid
nosid
nosid
not needednosid
nosid
not needednosid
nosid
, does not need iptsd(aka XPG Xenia Xe, Schenker VISION 15, Avell B.ON, ...)
Raw config samples: