PreshBlog

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

by on May.12, 2011, under Linux, System Administration

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.


18 Comments for this entry

  • hiandras

    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

  • vestir juegos

    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

  • EvillMonkey

    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.

  • Ryan Krizan

    This workaround was unsuccessful for me as well.

  • anu

    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??

  • hiandras

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

  • anu

    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 :)

  • Bandara

    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.

  • Himanshu

    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

  • Aurea

    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, :)

  • Ian

    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….

  • Vo

    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!

  • bigpresh

    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.

  • T

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

  • Roger Williams

    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

  • L

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

  • gsoundsgood

    just found this other site suggesting to simply enable any screensaver, it seems to be working…

    http://www.rajeshrana.net/2011/05/27/ubuntu-11-04-freezes-hangs-idle/

    or remove gnome screensaver, and install xscreensaver

  • PC

    Removing gnome screensaver and installing xscreensaver worked for me (Narwhal on X61s). Thanks!

2 Trackbacks / Pingbacks for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!