intel-precise-touch icon indicating copy to clipboard operation
intel-precise-touch copied to clipboard

Sensor keeps reseting after load ipts module

Open curioxide opened this issue 3 years ago • 18 comments

I have compiled ipts from hid branch but after sudo rmmod ipts and sudo insmod ipts.ko, ipts keeps reporting sensor was reset and restarting like below, dkms has the same problem, where the problem might be? I'm using Fedora 36 with kernel from linux-surface latest release on surface pro 7 图片

curioxide avatar Jul 25 '22 15:07 curioxide

Yeah, this is currently an issue on the HID branch for gen7 devices. I think I know how to fix it, thanks to someone debugging it with me on matrix, I just havent done the required changes yet.

StollD avatar Jul 25 '22 19:07 StollD

This issue should hopefully be fixed on the HID branch now.

StollD avatar Jul 28 '22 07:07 StollD

The great thing is that now it can respond to my touch but the response is very slow like when dragging a window, it takes about 0.7s to catch the finger. And the response is like my finger is always on the screen even if I have actually put my finger aside. Sometimes there is error message says failed to read buffer : -1 in dmesg

curioxide avatar Jul 28 '22 10:07 curioxide

Could you post the full dmesg? Also, do you have iptsd active or are you testing the singletouch mode?

StollD avatar Jul 28 '22 14:07 StollD

dmesg.log I have iptsd activated

curioxide avatar Jul 28 '22 15:07 curioxide

And how to switch to singletouch mode if needs test

curioxide avatar Jul 28 '22 15:07 curioxide

Stop iptsd to enable singletouch mode.

Also the reset command seems completely cursed on gen7 ...

Could you maybe try this change? Download the attached file into the directory where you run make and run git apply reset.txt. After that please build the module, load it, maybe touch the display once, and then unload it again and upload the dmesg.

reset.txt

StollD avatar Jul 28 '22 16:07 StollD

Sorry about being stupid before dmesg1.log Still the same.

curioxide avatar Jul 28 '22 16:07 curioxide

And there is no touch response without iptsd running

curioxide avatar Jul 28 '22 17:07 curioxide

Okay, I think I somewhat know whats going on now.

Could you do me a favor? I am trying to figure out a way how I can distinguish the gen7 devices from the older ones so I dont always have to find solutions that work across the board. I would be interested to know what some of the device info variables that IPTS returns are on gen7. Could you build the module from the eds branch of this repository, load it, and then upload the dmesg again?

StollD avatar Jul 28 '22 18:07 StollD

Eds.log

curioxide avatar Jul 28 '22 18:07 curioxide

Thank you!

I pushed some more changes to the HID branch, could you try them and see if anything improves? (with and without iptsd)

StollD avatar Jul 28 '22 19:07 StollD

Multitouch is unstable, sometims it just doesn't work but when it does, it works just fine (gnome gets stuck sometimes but I think it's gnome's problem) Singletouch is still the same failed to process buffer: -1. And there aren't more messages in dmesg after turning iptsd on

curioxide avatar Jul 28 '22 22:07 curioxide

btw how can i make it response to the touch of larger size

curioxide avatar Jul 28 '22 22:07 curioxide

Multitouch is unstable, sometims it just doesn't work but when it does, it works just fine (gnome gets stuck sometimes but I think it's gnome's problem) Singletouch is still the same failed to process buffer: -1. And there aren't more messages in dmesg after turning iptsd on

Thank you again! Yes, GNOME can sometimes get a bit crazy with the touchscreen. Make sure that you dont have two instances of iptsd running by accident, I managed to do that in the past and got a completely unusable touchscreen.

Regarding singletouch, it seems that switching the module to using the native HID descriptor of the device (instead of a hardcoded fallback descriptor) might have caused this issue, because the native descriptor for singletouch is broken. I pushed another change that will hopefully fix the descriptor and make singletouch work.

btw how can i make it response to the touch of larger size

Sadly this is currently hardcoded in iptsd: https://github.com/linux-surface/iptsd/blob/master/src/contacts/basic/processor.cpp#L26-L33

You could try switching to the advanced touch processing to see if that responds better to your fingers. Put this into /etc/ipts.conf:

[Touch]
Processing = advanced

StollD avatar Jul 29 '22 10:07 StollD

still the same glitch

curioxide avatar Jul 29 '22 15:07 curioxide

Alright sorry, I made a mistake. I thought the descriptor that the hardware gives you would already contain the singletouch descriptor, but after checking the descriptor someone else dumped a while ago, thats actually not the case. So me fixing the descriptor obviously wont work.

I pushed a new fix that should hopefully make singletouch work now, and get rid of the error message. Thank you for being patient with me so far and helping debug this.

StollD avatar Jul 29 '22 15:07 StollD

No big deal. However, like multitouch the singletouch is unstable, sometimes it needs several times of reloading ipts to make it work. But after all, it can work now. Thanks so much for the hard work.

curioxide avatar Jul 29 '22 16:07 curioxide