nixos-hardware icon indicating copy to clipboard operation
nixos-hardware copied to clipboard

Surface Pro 5 Touch does not work with updated version of IPTS

Open bfcns opened this issue 2 years ago • 17 comments

Surface pro 5 touch support does not work with the updated version of iptsd 1.0.1

Works with iptsd 0.5.1

It updates automatically.

Edit: The error is DEVICE not found in the service.

I created another service:

let
  # For iptsd 0.5.1
  pkg-0_5_1 = import
    (builtins.fetchTarball {
      url = "https://github.com/NixOS/nixpkgs/archive/ee01de29d2f58d56b1be4ae24c24bd91c5380cea.tar.gz";
      # Hash obtained using `nix-prefetch-url --unpack <url>`

      sha256 = "0829fqp43cp2ck56jympn5kk8ssjsyy993nsp0fjrnhi265hqps7";
    })
    {
      system = "x86_64-linux";
    };
in
{
  systemd.services.iptsd2 = {
    description = "IPTSD";
    path = [
      pkg-0_5_1.iptsd
    ];
    script = "iptsd";
    wantedBy = [ "multi-user.target" ];
  };

and it works.

I also realized the microsoft-surface.ipts.enable = false; option does not work as it seems to be config is already hard-coded to true. I don't know the case for microsoft-surface.surface-control.enable.

bfcns avatar Feb 09 '23 01:02 bfcns

cc @mexisme

Mic92 avatar Feb 18 '23 06:02 Mic92

Surface pro 5 touch support does not work with the updated version of iptsd 1.0.1

Works with iptsd 0.5.1

It updates automatically.

Edit: The error is DEVICE not found in the service.

I created another service:

let
  # For iptsd 0.5.1
  pkg-0_5_1 = import
    (builtins.fetchTarball {
      url = "https://github.com/NixOS/nixpkgs/archive/ee01de29d2f58d56b1be4ae24c24bd91c5380cea.tar.gz";
      # Hash obtained using `nix-prefetch-url --unpack <url>`

      sha256 = "0829fqp43cp2ck56jympn5kk8ssjsyy993nsp0fjrnhi265hqps7";
    })
    {
      system = "x86_64-linux";
    };
in
{
  systemd.services.iptsd2 = {
    description = "IPTSD";
    path = [
      pkg-0_5_1.iptsd
    ];
    script = "iptsd";
    wantedBy = [ "multi-user.target" ];
  };

and it works.

I also realized the microsoft-surface.ipts.enable = false; option does not work as it seems to be config is already hard-coded to true. I don't know the case for microsoft-surface.surface-control.enable.

Hardcoded is def. unhelpful. I'll try to take a look early this coming week (juat flying, atm...)/

mexisme avatar Feb 18 '23 06:02 mexisme

Forgot to mention that the ipts version issue happens in unstable channel.

bfcns avatar Feb 18 '23 13:02 bfcns

It's sufficient to add pkgs.iptsd to services.udev.packages and systemd.packages.

dotlambda avatar Feb 22 '23 04:02 dotlambda

Will not unstable branch still will fetch the version of iptsd 1.0.1?

bfcns avatar Feb 22 '23 14:02 bfcns

Will not unstable branch still will fetch the version of iptsd 1.0.1?

Yes, and that version (and all later ones) ship with the appropriate udev rule and systemd version. You won't need systemd.services.iptsd anymore.

dotlambda avatar Feb 22 '23 15:02 dotlambda

So, finally finding time to follow this up.

I'm not familiar with the Meson builder, @dotlambda.

But from https://github.com/linux-surface/iptsd, it looks like it's installing a systemd config, and the Nixpkgs file fixes the install paths?

Therefore it probably makes sense to add a check into nixos-hardware/.../ipts to only be available for v0.5.1 and earlier?

mexisme avatar Mar 02 '23 20:03 mexisme

Will not unstable branch still will fetch the version of iptsd 1.0.1?

Looks like it's already updated to 1.1.1 @phpcitizen ;-)

mexisme avatar Mar 02 '23 20:03 mexisme

It's sufficient to add pkgs.iptsd to services.udev.packages and systemd.packages.

Just make microsoft-surface.ipts.enable = true do this if the iptsd version is at least 1.0.

dotlambda avatar Mar 02 '23 20:03 dotlambda

It's sufficient to add pkgs.iptsd to services.udev.packages and systemd.packages.

Just make microsoft-surface.ipts.enable = true do this if the iptsd version is at least 1.0.

I think you meant that to disable the nixos-hardware systemd config for iptsd if it's at-least 1.0? As the nixpkgs version provides systemd ?

I quickly knocked together a commit that has an assertion checking older than 1.0.1 as that's what was mentioned above.

However, in retrospect, we want both behaviours, depending on whether iptsd.version == 1.0+ or not.

(Sorry, the higher-level comment didn't show when I read it via the mobile app).

mexisme avatar Mar 02 '23 20:03 mexisme

However, in retrospect, what we want is to add the Nixpkgs udev and systemd to services.udev.packages and systemd.packages for 1.0+, and the local version for everything earlier, yes?

Isn't that exactly what I said?

dotlambda avatar Mar 02 '23 20:03 dotlambda

However, in retrospect, what we want is to add the Nixpkgs udev and systemd to services.udev.packages and systemd.packages for 1.0+, and the local version for everything earlier, yes?

Isn't that exactly what I said?

Yes you did, but the higher-level comment didn't show when I read it via the mobile app. I only saw it when I reopened in my laptop.

mexisme avatar Mar 02 '23 20:03 mexisme

Hi all. Real Life™ delayed me, but I have a draft PR for this. I don't have access to MS hardware that depends on IPTSd, so it would be helpful if someone else could test this?

  • https://github.com/NixOS/nixos-hardware/pull/584#issuecomment-1475390206

mexisme avatar Mar 19 '23 20:03 mexisme

Hi, thanks for working on this.

I had the same systemd issue on my Intel Surface Pro 4. I tested the draft pull request and that at least lets me run nixos-rebuild switch successfully without activation errors. microsoft-surface.ipts.enable = true; doesn't seem to have any effect but that may be by design? In any case, It's easy enough to add the systemd service suggested in the original post and everything works after that.

detroyejr avatar Apr 03 '23 19:04 detroyejr

Hi, thanks for working on this.

I had the same systemd issue on my Intel Surface Pro 4. I tested the draft pull request and that at least lets me run nixos-rebuild switch successfully without activation errors. microsoft-surface.ipts.enable = true; doesn't seem to have any effect but that may be by design? In any case, It's easy enough to add the systemd service suggested in the original post and everything works after that.

OK, good to know; I must've made a mistake in my code. However, perhaps this patch can be deprecated. It would be much better to use the upstream version, of course.

mexisme avatar May 14 '23 20:05 mexisme

in the end, what was the solution for this issue?

fdgefgd avatar Jun 30 '23 08:06 fdgefgd

in the end, what was the solution for this issue?

This might help: https://github.com/NixOS/nixpkgs/issues/240612#issuecomment-1635859341

dotlambda avatar Sep 19 '23 05:09 dotlambda