linux-surface / iptsd

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

Failed to run iptsd on PostmarketOS (Alpine Linux) #42

Open robante15 opened 3 years ago

robante15 commented 3 years ago

After compiling iptsd without problems, when wanting to execute it, it throws the following error:

microsoft-surface-pro4:~/iptsd$ sudo ./build/iptsd
Connected to device 1B96:006A
ERROR: ../src/devices.c:117: Failed to open uinput device: No such file or directory
ERROR: ../src/devices.c:292: Failed to create touch device: No such file or directory
ERROR: ../src/main.c:128: Failed to create uinput devices: No such file or directory
ERROR: ../src/devices.c:309: UI_DEV_DESTROY failed: Not a tty
microsoft-surface-pro4:~/iptsd$ 

Context: I am trying to "port" PostmarketOS (Alpine Linux) to the Microsoft Surface Pro 4.

I made a first attempt with Kernel 5.10.56 from Kernel.org and applying the corresponding patches from linux-surface, I managed to compile it and get it to work. But after compiling iptsd, wanting to execute it, it throws the error.

Later I tried to compile directly the Linux-surface Kernel, branch v5.10-surface, I was able to do it again without problems, this time without including the patches (Since I assume they come with the Kernel), I compile iptsd again, and when I want to execute it, it launches the same runtime error.

Executing the command "ls -l / dev / ipts /" I get the following result:

microsoft-surface-pro4:~/iptsd$ ls -l /dev/ipts/
total 0
crw-------    1 root     root      238,   0 Aug  8 00:21 0
crw-------    1 root     root      238,   1 Aug  8 00:21 1
crw-------    1 root     root      238,  10 Aug  8 00:21 10
crw-------    1 root     root      238,  11 Aug  8 00:21 11
crw-------    1 root     root      238,  12 Aug  8 00:21 12
crw-------    1 root     root      238,  13 Aug  8 00:21 13
crw-------    1 root     root      238,  14 Aug  8 00:21 14
crw-------    1 root     root      238,  15 Aug  8 00:21 15
crw-------    1 root     root      238,   2 Aug  8 00:21 2
crw-------    1 root     root      238,   3 Aug  8 00:21 3
crw-------    1 root     root      238,   4 Aug  8 00:21 4
crw-------    1 root     root      238,   5 Aug  8 00:21 5
crw-------    1 root     root      238,   6 Aug  8 00:21 6
crw-------    1 root     root      238,   7 Aug  8 00:21 7
crw-------    1 root     root      238,   8 Aug  8 00:21 8
crw-------    1 root     root      238,   9 Aug  8 00:21 9

I must clarify that Alpine Linux uses openrc, and musl libc, I do not know if it is relevant. I don't know if I should use another branch of the kernel, or if I need something additional? Any ideas or suggestions? Or if I need some firmware package?

StollD commented 3 years ago

Is CONFIG_INPUT_UINPUT enabled in your kernel? Since iptsd runs in userspace, it needs uinput to feed the data back to the kernel.

robante15 commented 3 years ago

Yes, currently in my configuration it is like CONFIG_INPUT_UINPUT = m

What I had activated was CONFIG_INTEL_IOMMU, I just deactivated it, and at the moment it is compiling the kernel again

StollD commented 3 years ago

Is the uinput module loaded? You should have a file called /dev/uinput, which iptsd will try to open. Most distributions seem to build it into the kernel directly, so that it is always available.

The IOMMU option shouldnt change anything as long as the iommu isnt enabled on the kernel commandline. That broke the ipts kernel driver in the past.

robante15 commented 3 years ago

No, apparently I don't have that file

robante15 commented 3 years ago

Apparently I needed to load the module manually with the command modprobe uinput

Now it allowed me to run iptsd, but it only shows Connected to device 1B96: 006A and does not perform any other action, the touch does not work either

StollD commented 3 years ago

Can you check if the events go through with evtest or libinput debug-events? i.e. run sudo evtest and select the IPTS Touch device, then touch the screen and see if it logs anything. If that happens, iptsd is correctly generating the events, but nothing reacts to them.

robante15 commented 3 years ago

I just tried both ways, and it does detect "IPTS Touch" that exists, but touching the screen does not generate any log

StollD commented 3 years ago

Can you post your dmesg?

robante15 commented 3 years ago

Of course, this is my dmesg

https://pastebin.ubuntu.com/p/wYV343RmXm/