Surface Laptop Studio - linux-surface/linux-surface GitHub Wiki

Touchpad Cursor does not move

The default libinput settings can cause false positives in palm detection on the Microsoft Precision Haptic Touchpad. This requires a quirk to be applied to calibrate the sensor.

Identified Issues

  • The cursor does not respond to touch events.
  • The cursor stops working when selecting text or dragging files.

Note: If you are not experiencing issues, you do not need to apply this fix. A future version of libinput may resolve this issue. If unsure, you can either apply the quirk or first confirm the issue by tracking touch events using libinput.

Applying the Quirk for Surface Laptop Studio

  1. Open /etc/libinput/local-overrides.quirks in a text editor:

    sudo nano /etc/libinput/local-overrides.quirks
    
  2. Add the following configuration:

    [Microsoft Surface Laptop Studio Touchpad]
    MatchVendor=0x045E
    MatchProduct=0x09AF
    MatchUdevType=touchpad
    AttrPressureRange=25:10
    AttrPalmPressureThreshold=500
    
  3. Save and exit.

  4. Reload udev rules to apply the changes:

    sudo udevadm control --reload-rules && sudo udevadm trigger
    

Note: If the file does not exist, create it. Otherwise, append the above text to the end.

Calibration with Libinput

If further tuning is required, you can gather pressure values using:

sudo libinput measure touchpad-pressure

For detailed calibration steps, refer to the official guide:
Libinput Touchpad Pressure Debugging.


Poor sound quality when playing on laptop speaker on 44.1kHz sample rate

There is an issue where playing audio at 44.1kHz on the laptop speakers which results in noticeably degraded sound quality. This issue does not occur in Windows, nor is it seen when playing audio via headphones, which also support 44.1kHz in Windows.

This may be caused by poor resampling in the DAC/driver or a misconfigured ALSA setup. The codec reports 44.1kHz support for the speakers, which can be verified by running:

cat /proc/asound/PCH/codec#0

To avoid this issue, do not use 44.1kHz on ALSA hw:0,0 or in PulseAudio.

Fix: Force a 48kHz Sample Rate

If you experience this issue, configure PulseAudio to use 48kHz:

  1. Open PulseAudio's configuration file:

    sudo nano /etc/pulse/daemon.conf
    
  2. Locate (or add) the following lines:

    default-sample-rate = 48000
    alternate-sample-rate = 48000
    
  3. Save the file and restart PulseAudio:

    pulseaudio --kill && pulseaudio --start
    

PipeWire defaults to 48kHz, so no adjustments should be required.


Allow touchpad/keyboard on Wayland in slate mode

Note: You don't have to do this, if you can using touchpad/keyboard on Wayland in slate mode (perhaps you're using a newer version of libinput)

By default, libinput disable usage of touchpad/keyboard when tablet mode is triggered (by slate/tablet position, in case of SLS).

So you cannot use touchpad/keyboard on Wayland in slate-mode, like on Windows.

This is only an issue on Wayland not X11. And only on kernel versions that implement Surface tablet mode for SLS.

To fix this, you need to add the following quirk / hwdb entry to /etc/libinput/local-overrides.quirks (create that file and directory if it doesn't exist):

[Microsoft Surface Laptop Studio Built-In Peripherals] MatchName=Microsoft Surface MatchDMIModalias=dmi:*svnMicrosoftCorporation:pnSurfaceLaptopStudio: ModelTabletModeNoSuspend=1

There is alternative way, by re-modprobe surface_aggregator_tabletsw with parameter of tablet_mode_in_slate_state=N , note that this method also disable Linux tablet mode event from being triggered when put device in slate mode.

For more information see here


NVIDIA GPU locked at 10W power limit

For whatever reason, the NVIDIA dGPU in the SLS will get locked to a 10W power limit (the full power limit is 50W) upon the GPU entering and exiting the D3cold state.

There are two ways to fix this issue:

  • Disable Runtime D3 on NVIDIA driver versions >525.
  • Downgrade to driver version 525.147.05.

Method 1: Disable Runtime D3

You can disable Runtime D3 by adding the following line to /etc/modprobe.d/nvidia-pm.conf:

options nvidia "NVreg_DynamicPowerManagement=0x00"

Or by using the EnvyControl utility.

sudo envycontrol -s hybrid --rtd3 0

You can verify that Runtime D3 is disabled by running:

cat /sys/bus/pci/devices/0000:f3:00.0/power_state

Which should always return D0 even if the GPU is not being utilized. Note that this method will decrease battery life because the GPU is always powered on. Also, disabling Runtime D3 will only restore 35W out of the maximum 50W, the remaining 15W is handled by Dynamic Boost, however the Dynamic Boost daemon, nvidia-powerd does not seem to work properly on the SLS.

Method 2: Downgrade to Driver Version 525.147.05

Step 1: Download the Installer

Download the 525.147.05 installer .run file and extract the contents by running:

./NVIDIA-Linux-x86_64-525.147.05.run --extract-only

Step 2: Patch the Driver Files

To ensure compatibility with newer kernel versions, you will need to patch the driver files. Follow these steps:

  1. Clone the AUR Repository:

    git clone https://aur.archlinux.org/nvidia-525xx-utils.git
    
  2. Navigate to the Kernel Directory:

    Change to the directory of the extracted NVIDIA driver:

    cd NVIDIA-Linux-x86_64-525.147.05/kernel
    
  3. Apply the Patches:

    Run the following commands to apply the necessary patches:

    patch -p1 -i ../nvidia-525xx-utils/gcc-14.patch
    patch -p1 -i ../nvidia-525xx-utils/kernel-6.8.patch
    patch -p1 -i ../nvidia-525xx-utils/kernel-6.10.patch
    

Step 3: Install the NVIDIA Drivers

After patching the files, you can proceed to install the drivers:

  1. Switch to Runlevel 3:

    To install the drivers, switch to a lower runlevel to prevent any graphical sessions from interfering:

    sudo init 3
    
  2. Log Back In:

    After switching runlevels, log back into your account.

  3. Navigate to the Extracted Driver Folder:

    Go to the folder where you extracted the NVIDIA driver.

  4. Run the Installer:

    Execute the installer with the following command:

    sudo ./nvidia-installer
    

Step 4: Troubleshooting

If the driver installs successfully but is not recognized, it may be loading too late. To resolve this, you can embed the driver into the initial RAM disk:

  1. Edit the Initramfs Configuration:

    Add the following lines to the /etc/initramfs-tools/modules file:

    nvidia
    nvidia-modeset
    nvidia-drm
    
  2. Update the Initramfs:

    Run the following command to update the initramfs:

    sudo update-initramfs -u
    

Step 4: Set limit:

The benefits of this approach is that this driver is the final version where you can manually set the GPU power limit using:

nvidia-smi -pl 50

Which will unlock the full performance of the GPU. Also, you do not have to disable Runtime D3 on 525.147.05, meaning you'll be able to squeeze out more battery life by fully powering down the GPU.