Coder Social home page Coder Social logo

ithc-linux's People

Contributors

quo avatar stolld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ithc-linux's Issues

SSL error when dkms-install on Fedora 36

I come back after a long period and rebuild this again. But this time I met with a new issue.

[pairman@fedora ithc-linux]$ sudo make dkms-install
mkdir -p /usr/src/`sed -n '/^PACKAGE_NAME="\(.*\)"$/s//\1/p' dkms.conf`-`sed -n '/^PACKAGE_VERSION="\(.*\)"$/s//\1/p' dkms.conf`
cp -r dkms.conf Makefile src /usr/src/`sed -n '/^PACKAGE_NAME="\(.*\)"$/s//\1/p' dkms.conf`-`sed -n '/^PACKAGE_VERSION="\(.*\)"$/s//\1/p' dkms.conf`
dkms add `sed -n '/^PACKAGE_NAME="\(.*\)"$/s//\1/p' dkms.conf`/`sed -n '/^PACKAGE_VERSION="\(.*\)"$/s//\1/p' dkms.conf`
Creating symlink /var/lib/dkms/ithc/0.1/source -> /usr/src/ithc-0.1
dkms build `sed -n '/^PACKAGE_NAME="\(.*\)"$/s//\1/p' dkms.conf`/`sed -n '/^PACKAGE_VERSION="\(.*\)"$/s//\1/p' dkms.conf`
Sign command: /lib/modules/5.18.11-1.surface.fc36.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Certificate or key are missing, generating self signed certificate for MOK...

Building module:
Cleaning build area...
make -j8 KERNELRELEASE=5.18.11-1.surface.fc36.x86_64 KDIR=/lib/modules/5.18.11-1.surface.fc36.x86_64/build...
Signing module /var/lib/dkms/ithc/0.1/build/build/ithc.ko
At main.c:160:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: crypto/bio/bss_file.c:75
sign-file: /var/lib/dkms/mok.key: No such file or directory
Cleaning build area...
dkms install `sed -n '/^PACKAGE_NAME="\(.*\)"$/s//\1/p' dkms.conf`/`sed -n '/^PACKAGE_VERSION="\(.*\)"$/s//\1/p' dkms.conf`

ithc.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.18.11-1.surface.fc36.x86_64/extra/
depmod....
sync
[pairman@fedora ithc-linux]$ 

Is there anyway to fix it? surface-secureboot is already installed. Idk if this causes modprobe errors.

Failure to resume following suspend under X11 with Nvidia

I mentioned this issue here: linux-surface/linux-surface#1014

But after some additional testing I seem to have narrowed it down.My system fails to resume from suspend if all of the following occur:

  1. ITHC kernel module is installed
  2. I use a Gnome X11 session
  3. I have Nvidia graphics active

To narrow down the issue I installed the ithc kernel module with the generic kernel, not the surface kernel.

Strangely, if I either blacklist the ITHC kernel module, or use Gnome on Wayland, or switch from Nvidia to integrated graphics, I don't seem to have the issue where I fail to resume from suspend. Any clue what is going on or how to debug this?

I had failure to resume issues on both Ubuntu and Pop_OS!, both 22.04 versions, with the surface kernel, ithc module, and nvidia (hybrid) graphics on a surface laptop studio with dGPU. But I have only narrowed the issue down to the 3 items above on Pop OS with kernel version 6.0.6-76060006-generic, with the nvidia dkms 525 driver version. I did try other nvidia versions and was still having failure to resume issues.

Thank you!

to stupid to install?

so I'm really new to linux, and linux on a surface.

i managed to install dkms and the headers, but when i try
sudo make dkms-install
it outputs
make: *** No rule to make target 'dkms-install'. Stop.

Should it be `PM_QOS_CPU_LATENCY_DEFAULT_VALUE` instead of `PM_QOS_DEFAULT_VALUE`?

I’m trying to get my CPU to throttle at least a bit while using touch, and as part of that try to understand what ithc does. I noticed that it calls cpu_latency_qos_update_request(), and resets the value after a timeout. However, if I understand correctly, this is currently resetting to the wrong default value.

See torvalds/linux:include/linux/pm_qos.h, and src/ithc-main.c#L248

As stated elsewhere, I’m travelling and did not bring my Surface with me, I’ll test this once I return and submit a merge request after that.

Please advice whether I understood your code correctly ;)

Supported devices

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):

  1. Device name.
  2. Full output of sudo dmesg (or at least the output of sudo dmesg | grep -Ei 'ithc|linux version|dmi:|class 0x0901').
  3. Whether you had to use intremap=nosid, poll, or any other workarounds.
  4. Whether multitouch and/or pen work using the latest iptsd: https://github.com/linux-surface/iptsd/
Device PCI VID:DID Subsystem VID:DID Touch VID:PID Notes
Surface Pro 7+ 8086:a0d0 1414:0056 045e:0c1a Requires nosid
Surface Pro 8 8086:a0d0 1414:0055 045e:0c37 Requires nosid
Surface Pro 9 8086:51d0 1414:0064 045e:0c52 nosid not needed
Surface Pro 10 8086:7e49 1414:0086 045e:0c7f QuickSPI mode
Surface Laptop 4 8086:a0d0 1414:0052, 1414:0053 045e:0c31 Requires nosid
Surface Laptop 5 8086:51d0 1414:0071 045e:0c59 nosid not needed
Surface Laptop 6 8086:7e49 1414:0089, 1414:0090 045e:0c88, 045e:0c89 QuickSPI mode
Surface Laptop Studio 8086:a0d0 1414:0049 045e:0c1b Requires nosid
Surface Laptop Studio 2 Touchscreen 8086:51d0 1414:0077 045e:0c5d QuickSPI mode
Surface Laptop Studio 2 Touchpad 8086:51d1 8086:7270 045e:0c46 QuickSPI mode
Lenovo X1 Fold 8086:98d0 none 056a:5102 Requires nosid, does not need iptsd
Intel NUC M15 LAPBC510/LAPBC710
(aka XPG Xenia Xe, Schenker VISION 15, Avell B.ON, ...)
8086:a0d0 8086:2097 ? ?
Intel NUC M15 LAPRC710 8086:51d0 none ? ?
HP ENVY x360 8086:51d0 103c:8a28 ? ?

Raw config samples:

       state             bufsizes touchcfg          "$TIC"   spicfg   pid vid  rev      fwid?             fwmode
SP7+   e0000402 00000000 000a00ff 0000001c 0000001c 43495424 fda00a2e 0c1a045e 00000001 05008a8b 00000000 00000000 00000000 0404035e 000001c0 00000002
SP8    e0000002 00000000 001fc0ff 00000010 00000014 43495424 08e300e8 0c37045e 00000001 0c3c4bea fb190781 00000000 e8d1154a 00040302 62f02ab8 628c8830
SP9    e0000002 00000000 001fc0ff 00000010 00000014 43495424 0ce3f5e8 0c52045e 00000001 c0d97627 fd3b7fc1 00000000 9ec337a3 00040302 64dec79e 58095491
SL4    e0000402 00000000 000a00ff 0000001c 0000001c 43495424 ffa00a28 0c31045e 00000001 0700648b 00000000 00000000 00000000 0404035e 000001c0 00000002
SL5    e0000002 00000000 001fc0ff 00000010 00000014 43495424 09e3d2e8 0c59045e 00000001 30354141 5e7b5d98 00000000 b9be6b38 00040302 c8c4c4e1 0592c2fb
SLS    e0000002 00000000 001fc0ff 00000010 00000014 43495424 0ce3a3e8 0c1b045e 00000001 473e2e89 7030bc6f 00000000 a2a137f3 00040302 70159f6b 47ed5bb1
X1Fold e0000002 00000000 0001c08b 00000004 00000014 43495424 70060a6a 5102056a 00000001 00040050 00000000 00000000 00000000 0004035e 00000000 00000000

Improvement on Reinstall

DKMS-Install command cannot use duplicately (I do not know if this kind of problem also occured to non-DKMS approch)

so in order to reinstall I have to remove dkms module first

maybe we should edit the README.md

here is my initial suggestion

from

Installation with DKMS
----------------------

- Install prerequisites (e.g. Debian packages: `dkms` and `linux-headers-amd64`)
- `sudo make dkms-install`
- `sudo modprobe ithc` (or reboot)
- Check dmesg for ithc messages/errors.

to

Installation with DKMS
----------------------

- Install prerequisites (e.g. Debian packages: `dkms` and `linux-headers-amd64`)
- `sudo make dkms-install` (in order to re-install, you have to run `sudo make dkms-uninstall` first (ignore any error))
- `sudo modprobe ithc` (or reboot)
- Check dmesg for ithc messages/errors.

Weird behavior on Nixos and Sway

Hi

First thanks a lot for your amazing work !

I've compiled ithc on nixos. When I load the module with insmod, the ithc module appears in lsmod but it is also listed in hid.
Mouse clicks are working even if I do not use iptsd. I thought that when hid was not passed as an option it would not have worked.
However it is acting weird:

  • without iptsd:
    • Scrolling with two fingers is not working
    • I can move some sway floating windows with the floating modifier (foot) but other not (firefox)
    • Selecting text works in some windows (firefox) but not in others (vscode)
  • without iptsd:
    • Same behaviour as without but according to wev, multitouch seems detected.
    • Impossible to hold a mouse press when drop and dragging

Issues running on Fedora 36

System: Fedora Workstation Edition 36
Device: Surface Pro 7+

Is there a guide for building ithc-linux on Fedora 36? I tried to build but got these error messages:

[pairman@fedora ithc-linux]$ sudo make && sudo make install
[sudo] password for pairman: 
mkdir -p build
find build/ -type l -exec rm {} +
ln -sr src/* build/
make -C /lib/modules/`uname -r`/build M=/home/pairman/Downloads/ithc-linux/build
make[1]: Entering directory '/usr/src/kernels/5.17.9-2.surface.fc36.x86_64'
/bin/sh: -c: line 1: syntax error near unexpected token `('
/bin/sh: -c: line 1: `if [ "gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)" != ""gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)"" ]; then \'
make[1]: *** [Makefile:1727: prepare] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.17.9-2.surface.fc36.x86_64'
make: *** [Makefile:8: default] Error 2
[pairman@fedora ithc-linux]$ 

Thanks in advance.

Install issue

Not sure if I'm installing correctly. Never used dkms. I git cloned the repository then just ran dkms install 'path to dkms.conf file' but can't modprobe it afterwards.

Hibernate cause driver/hw hang and unrecoverable by driver

From #9 (#9 (comment))


(Sorry I think this comment I should move and further telling into new issues instead)

Trying on SLS surface kernel Ubuntu 22.04 LTS both X11/Wayland

For short only last workaround worked
here [dmesg_tail.log](https://github.com/quo/ithc-linux/files/8826725/dmesg_tail.log)

PS: this is about driver hang after resuming from hibernation
PS2: "When IPTSD in used and pen is near screen, hibernate and resume make driver got hang." not only that condition, even pen is not active or iptsd is not running, it also happens see the regularly updated comment [here](https://github.com/quo/ithc-linux/issues/8#issuecomment-1146105769)

Originally posted by @NP-chaonay in #9 (comment)

Installation - No rule to make target 'dkms-install'

when executing the command:
sudo make dkms-install

I allways get following error:
make: *** No rule to make target 'dkms-install'. Stop.

I have installed "dkms" and "kernel-devel kernel-headers" (because I could not find and install "linux-headers-amd64").

ithc in HID Mode fails when using pen

When trying to write with the Surface Pen on Surface Pro 7+ using the latest ithc driver (with enabled hid) with linux-surface iptsd on Fedora, the driver stops working with [ 82.626291] ithc 0000:00:10.6: ithc_dma_rx_process_buf: hid_input_report failed with -1 in dmesg.

Driver fails to initialize when booting with EFISTUB (`invalid dma rx data`)

I’m having troubles getting the touchscreen on a Surface Pro 9 to work. I tested linux-surface kernels 6.3.2, 6.2.13 and 6.1.12 from the [linux-surface] repository on Arch Linux, in all combinations of intel_iommu and intremap settings.

dmesg | grep ithc outputs the following:

[   12.583823] ithc 0000:00:10.6: enabling device (0000 -> 0002)
[   12.815479] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 0ce3d2e8 0c52045e 00000001 f5e81be4 002fcb5b 00000000 a404acd8 00040302 460a0c60 a78e200a
[   12.822904] ithc 0000:00:10.6: invalid dma rx data! channel 1, buffer 0, size 1360, code 0, data size 0
[   13.847092] ithc 0000:00:10.6: ithc_start: hid_add_device failed with -110
[   13.847101] ithc: probe of 0000:00:10.6 failed with error -110

Before wiping Windows off, I still installed the currently newest version of firmware (SurfacePro9_Win11_22621_23.044.40352.0.msi) - was that a mistake?

(not sure whether this belongs here, or into linux-surface, please transfer the issue if appopriate)

Fix irq source-id error

The IOMMU gives the following error when trying to use the irq:

DMAR: DRHD: handling fault status reg 2
DMAR: [INTR-REMAP] Request device [01:05.0] fault index 0x2f [fault reason 0x26] Blocked an interrupt request due to source-id verification failure

No clue how to fix this. May be an ACPI bug?

Module signing key is rejected

Secure Boot-enabled machines require a module to be signed with enrolled MOK keys--the dkms installation is signing the modules, but seemingly with improper keys, as modprobe fails due to the used keys not being enrolled.

SP8 support

Hi there, i installed the module on Surface pro 8 on Ubuntu and when checking it with dmesg got this output

jackgrey@jackgrey-Surface-Pro-8:~/ithc-linux$ sudo dmesg | grep ithc
[ 1.694464] ithc: loading out-of-tree module taints kernel.
[ 1.694484] ithc: module verification failed: signature and/or required key missing - tainting kernel
[ 1.696822] ithc 0000:00:10.6: enabling device (0000 -> 0002)
[ 1.916007] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 08e300e8 0c37045e 00000001 0cbc4bea fb190781 00000000 e8919552 00040302 62f12ab8 628c8830
[ 1.916455] ithc 0000:00:10.6: registered device ithc
[ 1734.766353] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 08e300e8 0c37045e 00000001 0cb84bea fb190781 00000000 e891175a 00040302 62f12ab8 628c8838
[ 1734.767149] ithc 0000:00:10.6: registered device ithc

any solution?

Seems the driver stopped working on kernel 5.19.x

Hi Quo,

Just wanted to give you a heads up, seems the ithc driver, while installed in my KDE Neon 5.25 (Ubuntu 20.04, Kernel 5.19.2), it no longer detects a touch input. It worked well during the 5.18.x kernels (although these ones gave me trouble with virtualbox, but that's unrelated), and also pefectly with 5.17.x, but since the upgrade to 5.19.x, there's now trouble...could you take a look to it?

Thanks so much!

Install errors due to module signing

I get these errors: when I run "make && sudo make install"

mkdir -p build
find build/ -type l -exec rm {} +
ln -sr src/* build/
make -C /lib/modules/uname -r/build M=/home/number6/ithc-linux/build
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-30-generic'
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-30-generic'
make -C /lib/modules/uname -r/build M=/home/number6/ithc-linux/build modules_install
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-30-generic'
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
INSTALL /lib/modules/5.15.0-30-generic/extra/ithc.ko
SIGN /lib/modules/5.15.0-30-generic/extra/ithc.ko
At main.c:160:

  • SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
  • SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
    sign-file: certs/signing_key.pem: No such file or directory
    DEPMOD /lib/modules/5.15.0-30-generic
    Warning: modules_install: missing 'System.map' file. Skipping depmod.
    make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-30-generic'
    depmod -a
    sync

Do you know how I might be able to fix this?

device not available `ithc_probe: hid_add_device failed with -110`

I installed ithc from git commit 02bf0eb using the dkms instructions. However, I have no touchscreen device listed under my libinput list, and ithc module is printing out some suspicious errors (sudo dmesg | grep -i ithc):

[  767.498937] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 0de37ae8 0c1b045e 00000001 34fb1951 22fabca3 00000000 f48e9377 00040302 969ee474 53119add
[  767.499665] ithc 0000:00:10.6: registered device ithc
[  768.521677] ithc 0000:00:10.6: ithc_probe: hid_add_device failed with -110
[  768.521693] ithc: probe of 0000:00:10.6 failed with error -110

I have tried re-initializing the module after startup with modprobe -r ithc && modprobe ithc. After doing this, it prints the same output/error.

uname -a:

Linux daniel-surface 6.0.1-arch2-1-surface #1 SMP PREEMPT_DYNAMIC Fri, 14 Oct 2022 15:47:45 +0000 x86_64 GNU/Linux

Hardware: Microsoft Surface Laptop Studio, i7 16GB

Operating System: Arch Linux (rolling)

Implement low power modes

The THC doesn't seem to draw a significant amount of power as is, but it would still be nice to implement all the low power stuff the Windows driver does.

Question about installation on SP8

So I recently got a SP8 and installed arch with the linux-surface on it.

I now want to try to enable the touchscreen and pen, but before I potentially break anything, I wanted to ask if the process I'll be doing is correct.

I'd do the following:

  1. clone quo / ithc-linux and the latest build from https://github.com/linux-surface/iptsd/actions
  2. install ithc-linux using the non dkms way
  3. follow the installation provided in the iptsd readme.md

and hope that does everything

Is this all I have to do, or have I missed something?

It's my first time compiling and installing, so I want to make sure I don't make any mistakes that might cost me time.

Surface Laptop Studio support

#5 (comment)

Pen left click/hover work (doesnt test if detect as mouse or pen); MultiTouch dont work but logged in dmesg as msg "ithc 0000:00:10.6: truncated prd" when touch is done. (see below)

Rolling into the kernel?

Will these drivers eventually be roled into surface-kernel and then mainline linux?

Thank you so much for your work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.