linux-surface / iptsd

Userspace daemon for Intel Precise Touch & Stylus
GNU General Public License v2.0
86 stars 39 forks source link

Surface pro X (SQ1) touch/stylus conflict #65

Closed liuyishengalan closed 1 year ago

liuyishengalan commented 1 year ago

I am following the SPX wiki configuration step and re-assign 4000 to dft_button_min_mag to avoid spurious button presses. stylus fully works after the modification. However, as I touch the screen with finger and stylus simultaneously, the driver stops:

× iptsd@.service.in.service - Intel Precise Touch & Stylus Daemon
     Loaded: loaded (/usr/lib/systemd/system/iptsd@.service; static)
     Active: failed (Result: exit-code) since Mon 2022-08-01 06:01:41 PDT; 5min ago
   Duration: 21.406s
       Docs: https://github.com/linux-surface/iptsd
    Process: 16671 ExecStart=/usr/bin/iptsd /dev/hidraw0 (code=exited, status=1/FAILURE)
   Main PID: 16671 (code=exited, status=1/FAILURE)
        CPU: 253ms

Aug 01 06:01:20 surface-pro-x systemd[1]: Started Intel Precise Touch & Stylus Daemon.
Aug 01 06:01:20 surface-pro-x iptsd[16671]: [06:01:20.513] [info] Connected to device 045E:0996
Aug 01 06:01:41 surface-pro-x iptsd[16671]: [06:01:41.831] [error] narrowing_error
Aug 01 06:01:41 surface-pro-x iptsd[16671]: [06:01:41.831] [info] Stopping
Aug 01 06:01:41 surface-pro-x systemd[1]: iptsd@.service.in.service: Main process exited, code=exited, status=1/FAILURE
Aug 01 06:01:41 surface-pro-x systemd[1]: iptsd@.service.in.service: Failed with result 'exit-code'.

It doesn't happen as default value has been assigned to dft_button_min_mag

The original service is: ExecStart=@bindir@/iptsd %I, from my end, the service cannot start unless I change %I to /dev/hidraw0. It will lead to error: Failed to open hidraw device

StollD commented 1 year ago

You shouldnt need to start the service manually, that should be done by the udev rules automatically.

You can check the status with something like systemctl status iptsd@/dev/hidrawN.service

That error is a mathematical error, but sadly C++ doesnt actually print where the error originates. Could you generate a coredump for me? You would have to build iptsd from source, and then run the following commands.

$ gdb ./build/src/daemon/iptsd
(gdb) catch throw
(gdb) run /dev/hidrawN

[trigger the error here]

(gdb) generate-core-file

Then upload the core.XXXX file it produces in the current working directory.