-
-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Surface laptop studio 2 #1272
Comments
It's hard to answer that without knowing anything about the device. If we're lucky, not much has changed under the hood. I'll certainly try to support it if I get some reports. |
Thanks! The output of our diagnostics script (see https://github.com/linux-surface/linux-surface/wiki/Testers-and-Contributing#support-for-new-devices) would be great. That basically collects all the data we (generally) need to provide initial support (except for the additional testing that someone with a device would need to do, of course). |
Hi @qzed, Sure! Here is the requested diagnostic files: |
Thanks! I've got something to test for you now. Hopefully, this should enable the EC-related components (battery info, platform profile, tablet switch, keyboard/touchpad and related input devices). Essentially, I've copied the stuff that we use for the SLS1 and applied it to the SLS2, so if nothing changed it should work. It will definitely require a bit of follow-up testing (even if it works), but should hopefully get (at least some) things started. To test, can you follow what I wrote here, just replace the |
Hi @qzed , `user@pop-os:~/Desktop/Surface Linux/surface-aggregator-module/module$ make clean all make -C /lib/modules/"6.5.7-surface-2"/build M=/home/user/Desktop/Surface Linux/surface-aggregator-module/module/src clean user@pop-os:~/Desktop/Surface Linux/surface-aggregator-module/module |
Ahh, took me a while to spot the issue: Paths in the makefile were not quoted, so it broke due to the witespace. This should be fixed now. Can you run |
So apparently the SLS2 has two Touch Host Controller devices:
Presumably the first is the touchscreen, but I wonder what the second one is used for? Unfortunately ithc currently fails to initialize them:
Can you please post your dmesg after restarting ithc with debugging enabled? sudo modprobe -r ithc
sudo modprobe ithc logregs=1 dyndbg=+pflmt |
Here is the output from running make -C /lib/modules/"6.5.7-surface-2"/build M="/home/user/Desktop/Surface Linux/surface-aggregator-module/module/src" clean user@pop-os:~/Desktop/Surface Linux/surface-aggregator-module/module$ ` After restarting ithc with debugging enabled, here is the dmesg file: |
If I understand that error correctly, it's another issue with the space in the path. Only this time it seems to be caused by the kernel makefile and not ours. Could you try moving the directory to some path without a space? |
Thanks. So from the dmesg it looks like the state register isn't doing anything. I had a look inside the driver package for the SLS2. It looks like the THC has been renamed to the "Quick SPI" Host Controller. While the PCI device ID is the same and many of the old THC registers still seem to be used, the new UEFI Quick SPI driver also uses a bunch of previously unused/unknown registers. I haven't looked at the Windows Quick SPI driver yet. I may try to continue reverse engineering this a bit more. But I think it's unlikely I'll be able to get it working without access to the actual hardware. |
Hi @qzed , After running Keyboard is also working now. Touchpad and touchscreen is not working |
@CiaranWinna Thanks! Could you also upload a dmesg log while the modules are loaded so that I can check that there are no other (obvious) issues? For the touchpad, I'm assuming it's a similar issue as on the SLS1, so you could try adapting the quirk from here. You will likely need to change the We should also do some more proper testing on the HID-via-SAM devices and other SAM/EC components to make sure they haven't changed. But that's for after we have some preliminary support in the kernel. |
The In your case, it seems that |
Okay, so it looks like two HID devices have changed. Either they moved their address or removed them:
So the affected devices are
So unless they merged the touchpad and keyboard HID devices, that might explain why the touchpad isn't working. To figure out which HID devices are present on which addresses, can you run (with the modules loaded) the following commands and post their outputs? The script is also in the SAM repo. In particular, run
replacing With We also may need to look at adding an entry for our Surface GPE driver, but that's for later after the other things work I guess. |
I suspect the touchpad is connected to the second THC. From
And from
PCI device ID 8086:51d1 is the second THC. The subsystem ID also matches. The UP:FF0B makes me a little worried that it's not standard HID, and maybe heatmap based like the touchscreen. The THC registers contain some left-over values from the UEFI Quick SPI initialization which contain the VID/PID of the touch devices:
So THC0 = 045e:0c5d, THC1 = 045e:0c46. |
There is a TouchPenProcessor dll with that ID in the name:
These two dlls are also 19M each so maybe they forgot to strip the debug symbols again? |
You're right, I missed that dll somehow! |
Urgh... so looks like even the touchpad now needs a user-space service. That will probably be slightly annoying. |
Hi @qzed ,
|
Hi, As far as I understand, up to now, battery stats and keyboard are working, but not touchpad and touchscreen. I just wanted to know at this stage if you think that linux-surface may support the SLS2 with some work, or Regards |
@deb75 I can't say... Touchpad and touchscreen depend on ITHC, which I know next to nothing about. I guess @quo could make a more educated guess here. If ITHC works, we'll quite likely at least have touchscreen support. Depends on how similar the touchpad is to the touchscreen, but I guess that might also need some special processing or even a separate IPTSd. Unless we're in luck and it sends standard HID data (... but I guess that's unlikely since they ship a processor dll and drive it via ITHC in the first place). So that might take longer. Apart from that, I'm confident that EC support (keyboard, battery stats) will land in our kernel soon, after which I'll send them upstream. |
@CiaranWinna Thanks, that looks good so far. Now, there's two things we should still check: Enabling/disabling of HID devices and the tablet mode switch. For the first, can you (again with the modules loaded) run
and verify that this disables the keyboard? Similarly, running
should enable it again. For the tablet mode/orientation switch, can you run
in various states (e.g. tent-mode, tablet-mode, normal laptop mode). The output should also change accordingly. It would be great if you could also post a dmesg log from doing those things, so that we can check if there were any errors. |
Dumping the HID report descriptor of the touchpad device and some HID traffic from windows could help, then I could start looking at the data and adapting iptsd. Unfortunately, I have no idea how to do that under Windows. |
I've reverse engineered bits of the new touch stuff. Basically, the THC runs in an alternate mode called "Quick SPI". The mode is selected by the platform firmware, so I don't think we can set it back to "normal" mode. Quick SPI aims to be compatible with the HID-over-SPI spec MS published. So theoretically, in this mode ithc should provide an SPI device which could then get picked up by Microsoft's spi-hid driver. (But it'll probably be easier to just handle the HID-over-SPI stuff inside ithc, at least initially.) Initialization is a bit more involved than normal THC init. Some values need to be retrieved using ACPI calls and written to the correct registers. Reading the device config works a little differently. I think DMA works the same, although the buffers now use HID-over-SPI format. I'll try to add Quick SPI support to the ithc driver when I have some time, maybe next month. Of course since I don't have the hardware myself, it's unlikely it'll work first try, we'll probably have to spend some time debugging. |
Hi @qzed ,
I can confirm that the keyboard was successfully disabled and enabled In regards to running |
Thanks for checking! I guess you might need to install |
@StollD The touchpad seems to have the same enable/metadata/data reports as the touchscreen. So maybe it'll just work with iptsd with no/minor changes. It also has generic mouse and touchpad reports, presumably those will be used in fallback mode if multitouch is not enabled. |
Touchpad is working great on my brand-new SLS2! Thank you @StollD |
Code-wise it should be ready, but I still need to document the new helper scripts (e.g. |
@CiaranWinna I am on Fedora 40 and I don't see any option to turn on or off the dGPU. Battery life is terrible (~2 hours), and I am wondering if it is due to this.
Discrete GPU: |
Hi @ndavis6 ,
|
@CiaranWinna Thanks! A quick clarification if you don't mind. Were you able to access the dGPU on main-branch / generic surface-kernel? Or did you need to run a different branch of surface-kernel for the SLS2? I am running 6.8.8-1.surface.fc40.x8 and while I can read the dGPU state, I don't see the dGPU options from your screenshot (see my screenshot above). I am not sure if that is a Fedora vs PopOS problem or if we were running different kernels. I also have #1442 which is annoying |
Booting into a fresh install of vanilla Ubuntu 2024.04 LTS. I was unable to checkout the
And received the following error: Did this branch get merged and deleted? Running
|
@castlenthesky Yeah, the branch got merged. Support for the SLS2 is also in our kernel packages. |
Hi @ndavis6 , |
Understood. Thank you for the clarification! I've followed the Installation and Setup guide and am still having issues. The keyboard is fully functional. The touchscreen is usable but does not recognized gestures and the touchpad is not usable. I have taken the following steps:
When using the touchpad my mouse disappears the moment I interact with it. If I stop using my mouse and use the touchpad with a single the system will scroll whatever window the pointer is over. It almost behaves as the touchpad is a touchscreen and just like the touchscreen, gestures are not recognized. Do you have recommendations on steps I may have overlooked? |
I have mine working, what you describe sounds like what I had prior to installing the dev versions they suggested to use here. I've had it working using the quick-spi branch of the ithc module and the touchpad branch of iptsd (use the pre-built packages from the actions). My touchpad worked from there however I also had to apply some e settings to iptsd in a conf file, which are further back in this conversation. [Contacts] Hope that helps? |
Hey all! I've followed this thread and have been pretty successful getting NixOS 24.05 running on my Laptop Studio 2. Trackpad is working excellent, along with the Pen 2! Multifinger gestures are excellent as well! Thank you to everyone for this hard work 🙏🙏 Below is a link to the configuration file I'm using with NixOS. I started with the configuration linked in the guide and then updated to include some of the latest changes: One last issue I'm having is that when I close the lid, hit suspend, or hit shutdown, the laptop just sits at a black screen and doesn't change the power state. Has anyone come across that at all? Or does anyone see an issue in my Nix config? 😅 I can gather whatever logs would be helpful! |
Hello, I tried to install ubuntu, first 3 boot after install were fine, then it would get stuck during boot and not launch any graphical login or anything. Also my gpu was not getting used and not sure how to fix that |
Hello, I installed arch on surface laptop studio 2 However I have an issue with shutdown, the laptop doesn't power off. I waited for a while thinking there was some process taking place but no. The fan keeps working and I can hear the sound of the laptop still working. By the way the laptop also didn't power off when I used Pop distro bootable USB. I needed Pop's gparted to shrink the C drive. So on both distros: Pop and archlinux the laptop doesn't power off. I attached two logs file. Appreciate your support with this issue |
Just installed ubuntu 24.04 with the linux-surface repository package, and things seem to be running mostly smoothly. Of note, I had to add |
I have also encountered the same touchpad issue mentioned earlier in this thread. I would follow the suggested approach to download IPTSD artifacts from the github actions page, but it seems the build artifacts are expired. I am a noob with github actions--is it possible for a user to refresh the artifacts through the online UI, or is the easiest solution to just build locally? |
I have been running Fedora40 on SLS2 for a few months now. Things are generally good, a few things still aren't working great. Touchpad is very sensitive to clicks. It tends to send clicks when I try to drag and double clicks when I try to click once. I tried adjusting the 50-touchpad settings, but I haven't found the right combination. From iptsd-plot, it seems that the contacts are becoming unstable, but I can't find settings that recognize the fingers reliably and avoid unstable contacts. I believe I installed everything as in the guide. Battery life is poor. I knew this going in, but it only lasts ~2 hrs on battery vs ~12 on windows. I tried powertop tune which helped a bit but still not much. Latop won't power down. I can workaround this, but it is annoying. Let me know if there is a better place to communicate on these bugs. Thanks for all the hard work here!! |
Shutdown seems to work fine with the kernel parameter Suspend also seems to work for me - the fans don't turn off immediately when suspending, but keep running until the CPU gets cool and then stop - but the CPU does reach the s0ix states. |
I'm getting system freezes on high system loads - for example, as some heavy packages build, the system stops responding and I have to hard reset from the power button. Anyone else observing something similar Edit: Happens not only during heavy loads. |
Touchpad IssueOn both Fedora40 and Ubuntu24 I have been unable to get the touchpad to work as a mouse consistently. When I get it to work many of the features such as
still don't work. When I get the touchpad to work, it reverts back to default setting whenever my PC goes to sleep. I re-enable it by finding running Honestly, if I could get the features to work (through configuration or however possible), I could find a way to make this behaviour consistent by having a background process monitoring iptsd devices. I have tried alot of the fixes here .i.e. touchpad config files and a lot more but haven't been able to get the features listed above working. Let me know if you can help, Appreciate all the hard work already put in to get linux-surface to where it is ! |
Just bought a SLS2 today and would love to get things working from a linux standpoint. For some reason I can't download the .deb file to get the touchpad working. It says expired. Does anyone know why this would be? As a side note, Would love to help with testing or getting any data that's needed. Battery life doesn't seem great but I can live with that for now. Excited to contribute to this project! |
My touchpad still acts as if it's the touchscreen and I can't figure out what alterations I need to make to fix that. If anyone could provide some direction I'd appreciate that. |
Just thought I'd include my observations. When I either install or uninstall libinput or libinput-tools after a reboot, the mouse works. But it also causes multi-touch on the touch screen to stop working and disables the pen. After a reboot when the mouse is not working, both of those function perfectly. |
Hey @TannerNelson16, I forked the iptsd repo and tagged the touch branch. That caused the ci branch to run again. Everything but the arch package just built. Here's the link: https://github.com/Anodyine/iptsd/actions/runs/10589327622 I installed the deb one on Ubuntu and the touchpad works well even without adding the config file. However, I have an issue where the laptop won't charge while plugged in. |
@Anodyine your solution to fork iptsd and duplicate the workflow file to build the touchpad branch through Github Actions helped me fixed my issues with Touchpad gestures. Thanks |
@Moareulf Are you experiencing that the touchpad is very sensitive to clicks with those touchpad-conf settings? If I am the only one getting them, maybe I did something wrong on installation. |
Can confirm that this kernel parameter fixed my shutdown issues I was having before, thank you! |
I am having this problem too, even with the iptsd config fix the issue persists, it's better but still present and very annoying. I am running pop os. Especially when drawing circles the cursor halts and registers taps. |
I'm currently using these
|
The surface laptop studio seems well supported by linux-surface.
Do you think linux-surface would also support the surface laptop studio 2 ?
Regards
The text was updated successfully, but these errors were encountered: