linux-surface / iptsd

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

Surface Laptop Studio No HIDRAW Device Available #98

Closed swinzy closed 1 year ago

swinzy commented 1 year ago

Hi everyone,

I'm wondering should I still use quo/iptsd or the update for SLS has been rolled into this repo?

Back in the days quo/iptsd was working fine on my SLS. Now since README.md on quo/iptsd says it's been merged into upstream I wanna give this a try.

Up until ninja -C build there has been no issue. It did print some message but returned 0, which should mean nothing's wrong.

The message printed by ninja -C build ``` ninja: Entering directory `build' [53/59] Linking target subprojects/spdlog-1.10.0/tests/tests_exe In member function ‘operator=’, inlined from ‘on_fill’ at ../subprojects/fmt-9.0.0/include/fmt/core.h:2186:17, inlined from ‘parse_align’ at ../subprojects/fmt-9.0.0/include/fmt/core.h:2355:24, inlined from ‘parse_format_specs’ at ../subprojects/fmt-9.0.0/include/fmt/core.h:2546:22, inlined from ‘on_format_specs’ at ../subprojects/fmt-9.0.0/include/fmt/format.h:4103:33, inlined from ‘parse_replacement_field’ at ../subprojects/fmt-9.0.0/include/fmt/core.h:2633:38: ../subprojects/fmt-9.0.0/include/fmt/core.h:2072:48: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 2072 | for (size_t i = 0; i < size; ++i) data_[i] = s[i]; | ^ ../subprojects/fmt-9.0.0/include/fmt/core.h: In function ‘parse_replacement_field’: ../subprojects/fmt-9.0.0/include/fmt/core.h:2065:8: note: at offset 4 into destination object ‘data_’ of size 4 2065 | Char data_[max_size] = {Char(' '), Char(0), Char(0), Char(0)}; | ^ [59/59] Linking target src/debug/iptsd-perf ``` (Command returned 0)

Then when I run sudo ./etc/iptsd-find-hidraw I get nothing. I have these devices in /dev:

hidraw0
hidraw1
hidraw2
hidraw3
hidraw4
hidraw5
hidraw6

I tried all of them as argument, they all returns [13:58:04.756] [error] No display config for this device was found!

What is going on?

System Information: HW: Surface Laptop Studio OS: Fedora 37 Kernel: 6.0.9-1.surface Windowing: Wayland Desktop: GNOME 43.1 SELinux: Disabled quo/ithc Installed intremap=nosid Added to GRUB_CMDLINE_LINUX Section of /etc/default/grub && sudo grub2-mkconfig Executed

NP-chaonay commented 1 year ago

you have to do these

0) remove old stuff as root 0.1) you can see if dkms is installed by using command dkms list 0.2) using command dkms remove <the one you see in 0.1) started with "ithc" and may from ithc installation ex. ithc/0.1> --all 1) install and this below driver instead of ipts driver

Github repo: quo/ithc recommended do on part "Building (DKMS)" and seeing "Notes" too 2) reinstall userspace driver from (at this moment) github linux-surface/iptsd ; this can be done by getting from prebuilt noted that if iptsd have been installed in way that not from pacakge manager, pls remove it first, see message A for how to.

3) after that, setting /etc/ipts.conf if you want andapply kernel parameter intremap=nosid and thenthen reboot

,message A (do this if I bring you here)

1) download source from linux-surface/iptsd and open terminal on source directory
2) run this (# mean required root)

$ meson build
# ninja -C build uninstall
StollD commented 1 year ago

@m1nicrusher When did you last update ithc? To use it with the new iptsd, it needs to run in HID mode, which has not been the default previously. If you are running a commit before https://github.com/quo/ithc-linux/commit/02bf0eb009dcb6d037a1c10bd70e7fb5d29718bb, you need to enable HID mode by adding ithc.hid=1 to the kernel commandline.

swinzy commented 1 year ago

@m1nicrusher When did you last update ithc? To use it with the new iptsd, it needs to run in HID mode, which has not been the default previously. If you are running a commit before https://github.com/quo/ithc-linux/commit/02bf0eb009dcb6d037a1c10bd70e7fb5d29718bb, you need to enable HID mode by adding ithc.hid=1 to the kernel commandline.

That's weird, I just installed a fresh ithc this morning. Shouldn't have to change it according to your information. 🤔

StollD commented 1 year ago

Can you please post your dmesg then?

NP-chaonay commented 1 year ago

@m1nicrusher ok then could you do 2) and see if it solve.

but maybe dmesg may contains useful info

swinzy commented 1 year ago

@StollD

Can you please post your dmesg then?

Here it is, as a file, cuz it's super long.

dmesg.log

swinzy commented 1 year ago

@NP-chaonay

@m1nicrusher ok then could you do 2) and see if it solve.

I did sudo dnf remove iptsd and re-build the source of linux-surface/iptsd from github, and I did ninja -C build install. Still no luck and now iptsd service doesn't exist anymore.

I did notice in the result from ninja -C build install, there seems to be no config for Surface Laptop Studio?

result ``` ninja: Entering directory `build' [0/1] Installing files. Installing subdir /home/m1nicrusher/source/iptsd/etc/config to /usr/local/share/ipts Installation failed due to insufficient permissions. Attempting to use polkit to gain elevated privileges... Installing subdir /home/m1nicrusher/source/iptsd/etc/config to /usr/local/share/ipts Installing /home/m1nicrusher/source/iptsd/etc/config/surface-book-1.conf to /usr/local/share/ipts Installing /home/m1nicrusher/source/iptsd/etc/config/surface-book-2-13.conf to /usr/local/share/ipts Installing /home/m1nicrusher/source/iptsd/etc/config/surface-book-2-15.conf to /usr/local/share/ipts Installing /home/m1nicrusher/source/iptsd/etc/config/surface-laptop-1+2.conf to /usr/local/share/ipts Installing /home/m1nicrusher/source/iptsd/etc/config/surface-pro-4-a.conf to /usr/local/share/ipts Installing /home/m1nicrusher/source/iptsd/etc/config/surface-pro-4-b.conf to /usr/local/share/ipts Installing /home/m1nicrusher/source/iptsd/etc/config/surface-pro-4-c.conf to /usr/local/share/ipts Installing /home/m1nicrusher/source/iptsd/etc/config/surface-pro-5.conf to /usr/local/share/ipts Installing /home/m1nicrusher/source/iptsd/etc/config/surface-pro-6.conf to /usr/local/share/ipts Installing subprojects/inih-r54/libinih.a to /usr/local/lib64 Installing subprojects/inih-r54/libINIReader.a to /usr/local/lib64 Installing src/daemon/iptsd to /usr/local/bin Installing src/debug/iptsd-calibrate to /usr/local/bin Installing src/debug/iptsd-dump to /usr/local/bin Installing src/debug/iptsd-perf to /usr/local/bin Installing /home/m1nicrusher/source/iptsd/subprojects/inih-r54/ini.h to /usr/local/include/ Installing /home/m1nicrusher/source/iptsd/subprojects/inih-r54/cpp/INIReader.h to /usr/local/include/ Installing /home/m1nicrusher/source/iptsd/etc/iptsd-find-hidraw to /usr/local/bin Installing /home/m1nicrusher/source/iptsd/build/etc/iptsd@.service to /usr/lib/systemd/system Installing /home/m1nicrusher/source/iptsd/etc/udev/50-ipts.rules to /usr/lib/udev/rules.d Installing /home/m1nicrusher/source/iptsd/etc/ipts.conf to /etc Installing /home/m1nicrusher/source/iptsd/build/meson-private/inih.pc to /usr/local/lib64/pkgconfig Installing /home/m1nicrusher/source/iptsd/build/meson-private/INIReader.pc to /usr/local/lib64/pkgconfig ```
NP-chaonay commented 1 year ago

, there seems to be no config for Surface Laptop Studio?

normal

now iptsd service doesn't exist anymore.

if you have not reboot after install, reboot it first then below

using this instead systemctl status iptsd@$(iptsd-find-hidraw) because the service name is changed to the same name "iptsd" but with dynamic name-paremeter.

if that dont show service then try running this (without root) iptsd-find-hidraw

NP-chaonay commented 1 year ago

@m1nicrusher oh I have see something wrong

ithc is never loaded to system, according to dmesg log

NP-chaonay commented 1 year ago

@m1nicrusher could you run command dkms list?

and do you install using dkms method? (i mean installation of ithc)

swinzy commented 1 year ago

and do you install using dkms method? (i mean installation of ithc)

Yes I used dkms method, but let me check with it later on. Thanks for your quick response.

StollD commented 1 year ago

Try disabling secureboot and check if that makes it load. (lsmod | grep ithc)

swinzy commented 1 year ago

@m1nicrusher could you run command dkms list? and do you install using dkms method? (i mean installation of ithc)

$ dkms status
ithc/0.1, 6.0.9-1.surface.fc37.x86_64, x86_64: installed

So it seems it's installed properly.

Try disabling secureboot and check if that makes it load. (lsmod | grep ithc)

Yes by disabling secureboot now it works, but I had configured LUKS with TPM, which won't work without secureboot. Is there a way so that I can sign the module?

OK my bad, I didn't enrol the key that signed the module. Plus I didn't have openssl installed so it didn't even manage to generate one. I think this should be stated somewhere so that people don't forget to do these steps, or just implement the steps into the code?

StollD commented 1 year ago

I think this should be stated somewhere so that people don't forget to do these steps, or just implement the steps into the code?

The long term goal is to have the modules built into the surface kernel and signed with our key. The current situation is a bit special, normally, you are not supposed to install the module through DKMS unless you know what you are doing.

NP-chaonay commented 1 year ago

@m1nicrusher and yeah

if

you are not supposed to install the module through DKMS unless you know what you are doing.

then you are not supposed (more unrecommended than DKMS, especially for not-experiecned user) to install the module through normal method/ out-of-tree unless you have good reason or experiecned enough to do so. too

IMO btw

swinzy commented 1 year ago

Ok, but does the iptsd in our linux-surface kernel work with Surface Laptop Studio? I can't get it working and that's why I chose to build from source.

NP-chaonay commented 1 year ago

@m1nicrusher

it works on my SLS Ubuntu with following condtion: 1) Secure Boot disabled 2) ithc from 1-month latest by quo, via DKMS 3) iptsd from 1-month latest by linux-surface github repo, install by download iptsd package and install, non-pacakage-manager-method-installed iptsd have been erased before install this.

NP-chaonay commented 1 year ago

btw iptsd from linux-sruface pkg-manager repo dont work with newr device, this is normal

swinzy commented 1 year ago

@StollD @NP-chaonay I've noticed the whole iptsd/ithc thing for Surface Laptop Studio has rolled into linux-surface kernel (or upstream)?

If so, should I do anything so to not keep using my self-built iptsd and ithc and switch to whatever the kernel offers?

StollD commented 1 year ago

If so, should I do anything so to not keep using my self-built iptsd and ithc and switch to whatever the kernel offers?

You definitly need to remove any DKMS installs of the module. Run sudo make dkms-uninstall in the ithc repo, followed by dkms status to check if there is still anything there.

You should also remove all traces of iptsd from the system to make sure the version from the package works correctly.

$ find /usr -name '*ipts*'
$ find /etc -name '*ipts*'
swinzy commented 1 year ago

You definitly need to remove any DKMS installs of the module. Run sudo make dkms-uninstall in the ithc repo, followed by dkms status to check if there is still anything there.

That helps. Thanks a lot.

$ find /usr -name '*ipts*'
$ find /etc -name '*ipts*'

Those returned too many irrelevant stuffs. I guess I'll leave them there for the moment...

Anyway, I have done dkms-uninstall and updated the new kernel. It's working now. Thanks!