One Way to Fix Freezing Upon Resume from Suspend

For some time I had been having a problem with my laptop freezing upon an attempt to resume after suspending.

The Symptoms:

  1. Immediately upon coming out of suspend, the desktop would be displayed in the same state as when suspend was entered. (It should instead have shown the unlock screen and prompt.)
  2. The mouse pointer was frozen. Could not move it with either the touchpad, an external bluetooth mouse, or by tapping the touchscreen.
  3. The keyboard was unresponsive. None of the keys did anything, including Alt+F2.
  4. The only remedy was to long-press the power button to force a restart.

My System:

  • Ubuntu MATE 22.04.5 LTS
  • Lenovo IdeaPad Flex 3 11ADA05
  • Kernel: 6.8.0-52-generic
  • MATE 1.26.0
  • WM: Metacity (Marco)
  • CPU: AMD Athlon Silver 3050e (4) @ 1.400GHz
  • GPU: AMD ATI Radeon Vega Series / Radeon Vega Mobile Series
  • RAM: 1455MiB / 3299MiB

Background:

The freezing didn't happen with every suspend/resume cycle. With some experimentation, I eventually surmised that the problem was probably caused by a network race condition, or perhaps a deadlock. I use both Proton VPN and pCloud. By quitting those two apps before suspending, the incidence of freezing was vastly reduced, but not entirely eliminated.

The Solution:

So I began searching for settings to tweak and finally found this one in dconf editor:

As you can see, I disabled the "Use default value" switch ("False") and selected "True" as my new custom value.

This completely solved the problem. In the week since I made this change, I've not had even a single episode of freezing, and I'm running Proton VPN and pCloud simultaneously, and I don't have to quit either one before suspending.

A web search turned up no information about this setting, so I don't know why MATE provides it. Evidently they know that some hardware/software combinations have issues with suspend/resume in connection with the network.

So far, I haven't noticed any ill effects or drawbacks to disconnecting the Network Manager before suspending. The only potential drawback I can see is that it might interfere with Wake-On-LAN. But my laptop is only connected via WiFi, not ethernet. And since the WiFi radio gets powered down during suspend, this setting doesn't really change anything. I've found that both Proton VPN and pCloud reconnect normally upon resume, as do any open tabs in Brave browser.

6 Likes

I've had the same thing happen, but haven't thought much about how to debug what isn't waking up properly. Thanks for the tip!

3 Likes

I have bee experiencing the same issue. How did you get to that screen? I am running 24.04, so I am not sure if that is why I cannot locate the dconf editor you showed. Thanks.

1 Like

Hi, @Cadfael and welcome to the Ubuntu MATE Community!

The dconf-editor app is not automatically installed. You'll have to install it manually. I'm running 22.04.5, and I'm not sure what replaced the "Software" app in 24.04. Might be something called the "App Store"? In any event, you can install it manually from a terminal by typing the command:

sudo apt update && sudo apt install dconf-editor

Then from the Brisk menu, select "System tools" and then "dconf editor". Or just type "dconf" in the Brisk menu search box.

The solution in my original post helped much, but it isn't quite bullet proof. It worked for almost two weeks, and then I changed my mouse from a Logitech USB nano wireless dongle to Bluetooth and the laptop again started freezing upon resume from suspend.

So I disabled Bluetooth, and that fixed it again. So I switched the mouse back to the USB dongle, and it still worked. Until...

A software update required me to restart the laptop, and it again started freezing upon resume from suspend.

I played around with a few things, and finally found that automatically starting pcloud and proton-vpn at reboot would cause the problem. So, as I originally guessed, this is a race condition or deadlock, at least in my case. Since pcloud occasionally splashes a promo when it starts, I suspect that proton-vpn, if it starts first, is preventing pcloud from starting up correctly. (Proton VPN blocks malware and advertisements.)

So now, (1) if I have the "network-sleep" key set to "true", and (2) I have removed both pcloud and proton-vpn from "Startup Applications" in Preferences, and (3) I start pcloud first and dismiss its promo dialog, if any, and then (4) start proton-vpn....the laptop doesn't freeze upon resuming after suspend.

And I hope that's the final word on the matter, but I'll post again if I have any further problems/solutions.

I'm still hopeful that the trick of using dconf-editor to set the "network-sleep" key to "true" will work for you and others. Please post again with your results, positive or negative. In any event, I see no downside to changing this setting.

Hope this helps.

2 Likes

Thank you for your help!

You're most welcome. Please let us know what happens.

1 Like