Ubuntu 11.04 – X freezing after screensaver active / laptop lid closed

I recently upgraded my laptop (a Dell 17R / N7010) to Ubuntu 11.04 (Natty), and since then, it has been randomly freezing when I come back to it after leaving it for a while.

I see my X session exactly as I left it, and can move the mouse around, but nothing seems to respond to mouse/keyboard events. The system is still alive, I can SSH to it from another box, or switch to a different virtual terminal (e.g. Ctrl + Alt + F1), and I can kill Xorg (sudo pkill X) at which point gdm immediately gets restarted, and I can log back in.

It seems to only strike when the laptop has been left unattended for some time. I can close the lid, wait ten seconds and re-open it, and everything is fine. I can also trigger the screensaver by locking the screen with Ctrl + Alt + L, then unlock, and all is also fine.

I’ve done some Googling, and I’m certainly not the only person experiencing this:

Bug 772925 – Screen freezes after laptop lid closed for more than 1 minute
Bug 781402 – Ubuntu 11.04 / Unity freezing when screen is ‘woken up’
a discussion of bug 781402 on fossplanet.com
Bug 740126 – Disabling an output can cause vblank events to be missed

I’m using ‘Ubuntu Classic’, i.e. using GNOME rather than Unity, but the reports of the problem I’ve seen are split between both.

I’ve found a suggestion of a possible fix – installing compizconfig-settings-manager then disabling Sync to vblankon ubuntuforums.org.

I’ve just tried that out; I’ll update this post when I know whether it has worked or not.

EDIT: I’ve checked logs for anything illuminating and found little, but I did just spot the following in /var/log/Xorg.0.log.old:


[437515.524] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable

I’ve no idea if it’s related to the problem or not.

EDIT 2: So far, it would seem that disabling “Sync to vblank” as mentioned above has fixed the problem, for me. (It’s also possible that it was fixed in one of the updates since, but I haven’t spotted any package updates that looked relevant.)

If you’re having the same problem, feel free to comment here on whether the “Sync to vblank” change stopped the freezes for you.

20 thoughts on “Ubuntu 11.04 – X freezing after screensaver active / laptop lid closed”

  1. Hi,
    I have the same problem (ubuntu 11.04, classic setting).
    I tried the “disabling sync to vblank” idea, but yesterday my notebook froze again.
    Did it work for you?
    Regards, hiandras

  2. Love,
    I soul the same problem (ubuntu 11.04, classic setting).
    I tried the “incapacitating sync to vblank” line, but yesterday my notebook froze again.
    Did it production for you?
    Regards, hiandras

  3. Thanks for the post. I’ve been having the same problem (with Unity) and I’ve just disabled sync to vblank. Hopefully that will do the trick.

  4. the same thing is happening to me as well [11.04]. the thought of leaving my system unattended gives me creeps now a days coz of the freezing!!! i googled and found somewhere that its because of changing the default theme. did anyone using the default ubuntu theme experience freezing??

  5. I changed the default theme. I am using “New wave”.
    I tried it with several different screen savers.

  6. it freezes with the default theme anyway…. the only time it worked was when the update was running… i left the system on all night and no prob :)

  7. I have the same issue, and tried to fix with the same “disabling sync to vblank” but still have the problem. No updates for this bug yet. Frustrating, as I have to lock my screen at least once a day.

  8. I had the same problem..but the fix did not work for me…my dell laptop still freezes on closing the lid…m using classic ubuntu 11.04

  9. I know someone who has been using Ubuntu and he has been complaining about that one, too. Maybe I could lead him to your website and let him try what you have tried, :)

  10. Thanks for this tip as I too am going to try it. Some have not been so successful with this, it seems, but I feel it worth trying after having to reboot my laptop after being up for over 6 days….

  11. Hi, I’ve been having the same freezing problem of X on ubuntu 11.04. Installing compizconfig-settings-manager then disabling Sync to vblankon worked perfectly after restarting X.

    Thanks a lot!

  12. Interesting that the “sync to vblank” ‘fix’ seems to work for some people, but not others.

    In case it’s relevant, I changed my screen saver setting from “blank screen” to an actual screensaver (“Hypertorus”) at about the same time.

    I’m no longer seeing the problem, thankfully.

  13. Same problem here with Ubuntu Classic, 11.04 – I regret my decision to upgrade from the previous version.

  14. I used the method described, the “sync to vblank”. I rebooted after to make sure everything was loaded properly and have not had an issue for 2 days, way more than had been happening before.

    Thanks for the lead!

    Roger

  15. I’m still having troubles with this issue. With or without vblank
    .
    Hope Ubuntu solves the problem..

Comments are closed.