6

Lap Detection

I run Ubuntu on a ThinkPad T15 Gen 2i and I constantly have issues with performance mode being disabled due to lap detection.

I'm not that impressed with lap detection in general, as it's just a motion detector which also gets activated if the device is stable but tilted, but please correct me if "motion detector" is not right.

This causes issues if I just move my laptop on my desk, or when I keep it tilted on a hard flat surface.

How can I disable lap detection?

I'd like to know if there are some workarounds, but also how can it be totally disabled. If there aren't any software approaches, can it be disabled on the hardware itself?

4
  • It is still a laptop -- it is meant o stay on your lap! -- but maybe just not in performance mode, when it stops behaving like a "laptop"...
    – cipricus
    Commented Jun 30, 2022 at 6:38
  • 1
    The issue is there even if you move it or keep it tilted on your desk, not only when in your lap.
    – eja
    Commented Jun 30, 2022 at 7:34
  • 1
    I compiled some informations about this problem and proposed workarounds at gist.github.com/sylvainfaivre/512fe8c171582caca3cabaed023188b4. Hope this helps people who find this question.
    – trent--
    Commented Jul 4, 2022 at 16:05
  • The issues also happens if you are on a proper table... that shakes! I could see this notification for the first time while working on board a train, even if using the tray table.
    – DavGin
    Commented Jul 28 at 11:47

5 Answers 5

3

This is a hardware problem. The firmware reports to Ubuntu it is on your lap and so you are not allowed to switch to "performance" mode as it is to prevent your lap from burns from the heat from the notebook.

The surface you place your notebook on might be hot so the system thinks it is on your lap? Try to put something cool underneath the laptop.

Temp fix might be...

sudo -i
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

A GNOME dev commented on it:

It is reported by the firmware, we have no control over it. Please try updating to the latest firmware that Lenovo provides. If that doesn't help, we can try to figure out whether there is a bug in the kernel or firmware code. You can also verify that /sys/devices/platform/thinkpad_acpi/dytc_lapmode is 1 when the message appears. It should be 0 if the device is on a table, but it might take quite a while before it switches.

1
  • This unfortunately won't work. You can put your device into Performance, but if "Lap Detection" is activated, the profile will be Degraded Performance, effectively locking you to 400MHz-800MHz depending on conf.
    – eja
    Commented Jun 30, 2022 at 9:23
2

I ran into the same issue on my Thinkpad T590! It's caused by a little accelerometer, designed to disable performance mode when the laptop isn't flat & steady.

After spending a few hours trying to figure out the solution, the best way to fix it is to just modify the kernel to always report that the sensor is negative. It's a very simple fix, you only need to change one line in the thinkpad_acpi module.

I've written a patcher to do this automatically using dkms, so it'll persist as you update your kernel.

If you're against patching the kernel module, you might be able to "monkey patch" the kernel which is a lot less invasive. There are some details on that in the previously linked repo too.

3
  • 2
    Could this be added to upstream thinkpad_acpi as a module option?
    – Ari
    Commented Nov 1, 2022 at 14:10
  • 1
    This no longer works for me. It disables the warning , but still switches the power mode.
    – Tejas Kale
    Commented Jun 22, 2023 at 21:13
  • Same issue as @TejasKale - thikpad_acpi patcher hides the warning, powerprofilesctl shows "degraded: No", but CPU still is down to 400Mhz. github.com/JosiahBull/thinkpad_acpi/issues/13 Commented Nov 8, 2023 at 9:06
0

If all else fails there is always bruteforce :

while true;
do
    A=$(cat /sys/firmware/acpi/platform_profile)
    if [ ${A} != 'performance' ]; then
        echo ${A}
        echo performance |  sudo tee  /sys/firmware/acpi/platform_profile   
    else
        echo ${A}
    fi
    sleep 0.5;
done
0

Had this problem on my t490 just now which runs Ubuntu 22.04 LTS. i just reset bios to defaults and re-enabled virtualization settings. everything works now.

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jul 17 at 23:12
-3

I don't know if this same thing happened to you or not, but on my T490, I found the same issue and the problem was not about lap detection at all. In my UEFI setting there was a power section, and in that power section the power mode for OnBattery profile was set to Balanced. I set that to Performance mode and after a reboot I could use the Performance profile on Gnome, and the popup was gone/ Just search your UEFI settings for power. Your problem can be the same too!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .