Results 1 to 7 of 7

Thread: How to change the default suspend mode?

  1. #1
    Join Date
    Sep 2009
    Beans
    24

    How to change the default suspend mode?

    I read here, that there are these available modes of suspend:

    standby
    ACPI state S1. This state offers minimal, though real,
    power savings, while providing a very low-latency transi‐
    tion back to a working system. This is the default mode.

    mem
    ACPI state S3 (Suspend-to-RAM). This state offers signif‐
    icant power savings as everything in the system is put
    into a low-power state, except for memory, which is
    placed in self-refresh mode to retain its contents.

    disk
    ACPI state S4 (Suspend-to-disk). This state offers the
    greatest power savings, and can be used even in the
    absence of low-level platform support for power manage‐
    ment. This state operates similarly to Suspend-to-RAM,
    but includes a final step of writing memory contents to
    disk.

    I use 'sleep' on my laptop all the time instead of shutting it down, but according to the article I read, when I do this it uses "state S1". How would I change this behaviour so that it uses the "state S3" (above)?

    Thanks.
    Last edited by snowweb; April 15th, 2013 at 01:02 PM. Reason: Oops! I want S3 not S2 (corrected in last paragraph)

  2. #2
    Join Date
    Jan 2007
    Beans
    6,542
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How to change the default suspend mode?

    Have a look in your BIOS.

  3. #3
    Join Date
    Sep 2009
    Beans
    24

    Re: How to change the default suspend mode?

    Quote Originally Posted by Paqman View Post
    Have a look in your BIOS.
    Thanks Paqman, but my reading up about this leads me to believe that this is a setting which the OS can set at the time it suspends. For example, I can already command the computer to goto 'S4' by telling it to hibernate. Ubuntu then instructs something to goto S4 in the same way that it does when I tell it to sleep, it then goes to 'S1', which must have been commanded by Ubuntu.

    I want Ubuntu to command 'S2' instead of 'S1', but don't know where the setting I need to change is stored.

  4. #4
    Join Date
    Nov 2010
    Location
    India
    Beans
    4,827
    Distro
    Ubuntu Development Release

    Re: How to change the default suspend mode?

    look at file section of this man page link

    http://manpages.ubuntu.com/manpages/...-action.8.html
    Raja

    రాజ శేఖర్ రెడ్డి

  5. #5
    Join Date
    Jan 2007
    Beans
    6,542
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How to change the default suspend mode?

    Quote Originally Posted by snowweb View Post
    Thanks Paqman, but my reading up about this leads me to believe that this is a setting which the OS can set at the time it suspends. For example, I can already command the computer to goto 'S4' by telling it to hibernate. Ubuntu then instructs something to goto S4 in the same way that it does when I tell it to sleep, it then goes to 'S1', which must have been commanded by Ubuntu.

    I want Ubuntu to command 'S2' instead of 'S1', but don't know where the setting I need to change is stored.
    Nevertheless, there also often a setting for this in BIOS. It would be worth checking there first, just in case that is the problem.

  6. #6
    Join Date
    Sep 2009
    Beans
    24

    Re: How to change the default suspend mode?

    Quote Originally Posted by raja.genupula View Post
    look at file section of this man page link

    http://manpages.ubuntu.com/manpages/...-action.8.html
    Thanks Raja, looks like that has the information I need. Just need to experiment now with the different settings mentioned there, to ascertain what's supported by my hardware.

    Thanks again.

  7. #7
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: How to change the default suspend mode?

    @snowweb, the article you reference is in respect to rtcwake - a utility that is used wake the system up after a certain time in suspension. The default system suspend function is different from this utility.

    @Pacman is correct. You can configure how acpi acts against sleep states by configuring them in the bios. From an acpi sleep perspective, it will use the default sleep state as defined in the bios.

    To see which acpi sleep modes are supported by your system, run:
    Code:
    cat /sys/power/state
    Then review this code at /usr/lib/pm-utils/pm-functions:
    Code:
    if [ -z "$SUSPEND_MODULE" ]; then
    	if grep -q mem /sys/power/state; then
    		SUSPEND_MODULE="kernel"
    		do_suspend() { echo -n "mem" >/sys/power/state; }
    	elif [ -c /dev/pmu ] && check_suspend_pmu; then
    		SUSPEND_MODULE="kernel"
    		do_suspend() { do_suspend_pmu; }
    	elif grep -q standby /sys/power/state; then
    		SUSPEND_MODULE="kernel"
    		do_suspend() { echo -n "standby" >/sys/power/state; }
    	fi
    fi
    In a nutshell:
    1. "if grep -q mem /sys/power/state;" -> if your system supports the mem state, then use it
    2. "elif [ -c /dev/pmu ] && check_suspend_pmu" -> if your system supports pmu (apple?), then use it
    3. "elif grep -q standby /sys/power/state" -> else if your system supports standby, then use it.

    To see which state is actually being used, you can obtain an extended debug log of the suspend cycle by:
    Code:
    sudo bash
    mv /var/log/pm-suspend.log /var/log/pm-suspend.log.BAK
    export PM_DEBUG=true
    pm-suspend
    ...and on resume, look through the /var/log/pm-suspend.log file for an "echo ??? > /sys/power/state" command (where ??? is one of the supported modes).

    As I understand it, when acpi echoes "mem" to /sys/power/state, it will use the sleep state as defined in the bios.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •