You are not logged in.

#1 2011-03-29 05:57:51

Aesir
Member
Registered: 2011-02-03
Posts: 22

Laptop-mode-tools/cpufrequtils Questions [SOLVED]

I am running a Sony Vaio VGN-FW480J and am trying to optimize these two tools to save battery life and hard drive life span.   I have added @laptop-mode to my daemon array and acpi-cpufreq to modules. A few issues I immediately notice:

1) cpufreq doesn't revert back to higher frequencies if I unplug and plug power source back in (before unplugging: CPU 0 - 800 MHz, CPU 1 - 2.00 GHz; after both are 800 and won't change if I plug power source back in)

2) I believe the hard disk is actually spinning down more frequently (and fan is almost always on, even when no work is being done).  Here are the relevant files/the ones that I have altered.

laptop-mode.conf

###############################################################################
#
# Configuration for Laptop Mode Tools
# -----------------------------------
#
# There is a "system" to the configuration setting names:
#    CONTROL_something=0/1   Determines whether Laptop Mode Tools controls 
#                            something
#    LM_something=value      Value of "something" when laptop mode is active
#    NOLM_something=value    Value of "something" when laptop mode is NOT
#                            active
#    AC_something=value      Value of "something" when the computer is running
#                            on AC power
#    BATT_something=value    Value of "something when the computer is running
#                            on battery power
#
# There can be combinations of LM_/NOLM_ and AC_/BATT_ prefixes, but the
# available prefixes are different for each setting. The available ones are 
# documented in the manual page, laptop-mode.conf(8). If there is no LM_/
# NOLM_ in a setting name, then the value is used independently of laptop
# mode state, and similarly, if there is no AC_/BATT_, then the value is used
# independently of power state.
#
# Some options only work on ACPI systems. They are marked ACPI-ONLY.
#
# Note that this configuration file is a fragment of shell script: you
# can use all the features of the shell scripting language to achieve your
# desired configuration.
#
# 
# Modules
# -------
#
# Laptop Mode Tools modules have separate configuration files, that can be
# found in /etc/laptop-mode/conf.d. Please look through these configuration
# files as well, there are many useful power saving tools in there!
#
###############################################################################


###############################################################################
# Enable/Disable laptop-mode-tools execution
# ------------------------------------------
# Set it to 0 to completely disable laptop-mode-tools from running
###############################################################################
#
ENABLE_LAPTOP_MODE_TOOLS=1


###############################################################################
# Configuration debugging
# -----------------------
###############################################################################

#
# Set this to 1 if you want to see a lot of information when you start/stop 
# laptop_mode.
#
VERBOSE_OUTPUT=0

# Set this to 1 if you want to log messages to syslog
LOG_TO_SYSLOG=1

# Run in shell debug mode
# Enable this if you would like to execute the entire laptop-mode-tools program
# in shell debug mode. Warning: This will create a lot of text output
# If you are debugging an individual module, perhaps you would want to enable
# each module specific debug mode (available in module conf files)
DEBUG=0

###############################################################################
# When to enable laptop mode
# --------------------------
#
# "Laptop mode" is the mode in which laptop mode tools makes the computer
# consume less power. This includes the kernel "laptop_mode" feature, which
# allows your hard drives to spin down, as well as various other settings which
# can be tweaked by laptop mode tools. You can enable or disable all of these
# settings using the CONTROL_... options further down in this config file.
###############################################################################


#
# Enable laptop mode when on battery power.
#
ENABLE_LAPTOP_MODE_ON_BATTERY=1


#
# Enable laptop mode when on AC power.
#
ENABLE_LAPTOP_MODE_ON_AC=1


#
# Enable laptop mode when the laptop's lid is closed, even when we're on AC
# power? (ACPI-ONLY)
#
ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0


#
# Enable all simple zero-configuration auto modules
# This option enables all simple modules (listed below) without requiring
# the user to enable each module individually
#
# List of modules which can be automatically enabled with this setting are:
#
# ac97-powersave
# cpufreq
# dpms-standby
# eee-superhe
# ethernet
# exec-commands
# hal-polling
# hdparm
# intel-hda-powersave
# intel-sata-powermgmt
# runtime-pm
# sched-mc-power-savings
# sched-smt-power-savings
# terminal-blanking
# usb-autosuspend
# wireless-ipw-power
# wireless-iwl-power
# wireless-power
#
# Set this to 1 to enable all simple zero-configuration auto modules listed above.
#
# NOTE: You can explicitly enable/disable any of the above modules by changing their
# values in the individual settings file
#
ENABLE_AUTO_MODULES=1



###############################################################################
# When to enable data loss sensitive features
# -------------------------------------------
#
# When data loss sensitive features are disabled, laptop mode tools acts as if
# laptop mode were disabled, for those features only.
#
# Data loss sensitive features include:
# - laptop_mode (i.e., delayed writes)
# - hard drive write cache
#
# All of the options that follow can be set to 0 in order to prevent laptop
# mode tools from using them to stop data loss sensitive features. Use this
# when you have a battery that reports the wrong information, that confuses
# laptop mode tools.
#
# Disabling data loss sensitive features is ACPI-ONLY, and it only works if
# your battery gives off frequent ACPI events to indicate a change in battery
# level.
#
# NOTE: If your battery does NOT give off battery events often enough, you can
# enable the battery-level-polling module to make this work. Look at the
# file /etc/laptop-mode/conf.d/battery-level-polling.conf for more information.
#
###############################################################################


#
# Disable all data loss sensitive features when the battery level (in % of the
# battery capacity) reaches this value.
#
MINIMUM_BATTERY_CHARGE_PERCENT=3


#
# Disable data loss sensitive features when the battery reports its state
# as "critical".
#
DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=1



###############################################################################
# Controlled hard drives and partitions
# -------------------------------------
#
# For spinning down your hard drives, laptop mode will remount file systems and
# adjust hard drive spindown timeouts. These parameters specify which
# devices and partitions are affected by laptop mode.
###############################################################################


#
# The drives that laptop mode controls.
# Separate them by a space, e.g. HD="/dev/hda /dev/hdb". The default is a
# wildcard, which will get you all your IDE and SCSI/SATA drives.
#
HD="/dev/[hs]d[abcdefgh]"


#
# The partitions (or mount points) that laptop mode controls.
# Separate the values by spaces. Use "auto" to indicate all partitions on drives
# listed in HD. You can add things to "auto", e.g. "auto /dev/hdc3". You can
# also specify mount points, e.g. "/mnt/data".
#
PARTITIONS="auto /dev/mapper/*"


#
# If this is enabled, laptop mode tools will assume that SCSI drives are
# really SATA drives that only _look_ like SCSI drives, and will use hdparm
# to control them. Set this to 0 if you have /dev/sd devices and you want
# laptop mode tools to use the "sdparm" command to control them. 
#
ASSUME_SCSI_IS_SATA=1


###############################################################################
# Hard drive behaviour settings
# -----------------------------
#
# These settings specify how laptop mode tools will adjust the various
# parameters of your hard drives and file systems.
###############################################################################


#
# Maximum time, in seconds, of work that you are prepared to lose when your
# system crashes or power runs out. This is the maximum time that Laptop Mode
# will keep unsaved data waiting in memory before spinning up your hard drive.
#
LM_BATT_MAX_LOST_WORK_SECONDS=600
LM_AC_MAX_LOST_WORK_SECONDS=360


#
# Should laptop mode tools control readahead?
#
CONTROL_READAHEAD=1


#
# Read-ahead, in kilobytes. You can spin down the disk while playing MP3/OGG
# by setting the disk readahead to a reasonable size, e.g. 3072 (3 MB).
# Effectively, the disk will read a complete MP3 at once, and will then spin 
# down while the MP3/OGG is playing. Don't set this too high, because the 
# readahead is applied to _all_ files that are read from disk.
#
LM_READAHEAD=3072
NOLM_READAHEAD=128


#
# Should laptop mode tools add the "noatime" option to the mount options when 
# laptop mode is enabled?
#
CONTROL_NOATIME=0

# Should laptop use relatime instead of noatime? The "relatime" mount option has
# more standards-compliant semantics, and allows more applications to work,
# while retaining a low level of atime updates (i.e., disk writes).
USE_RELATIME=0


#
# Should laptop mode tools control the hard drive idle timeout settings?
#
CONTROL_HD_IDLE_TIMEOUT=1


#
# Idle timeout values. (hdparm -S)
# Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
# for battery and for AC with laptop mode on.
#
LM_AC_HD_IDLE_TIMEOUT_SECONDS=20
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20
NOLM_HD_IDLE_TIMEOUT_SECONDS=7200


#
# Should laptop mode tools control the hard drive power management settings?
#
# Set to 0 to disable
CONTROL_HD_POWERMGMT="auto"


#
# Power management for HD (hdparm -B values)
#
BATT_HD_POWERMGMT=128
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254


#
# Should laptop mode tools control the hard drive write cache settings?
#
CONTROL_HD_WRITECACHE=0


#
# Write cache settings for HD (hdparm -W values)
#
NOLM_AC_HD_WRITECACHE=1
NOLM_BATT_HD_WRITECACHE=0
LM_HD_WRITECACHE=0




###############################################################################
# Settings you probably don't want to touch
# -----------------------------------------
#
# It is usually not necessary to change these parameters. They are included
# for completeness' sake.
###############################################################################


#
# Change mount options on partitions in PARTITIONS? You don't really want to
# disable this. If you do, then your hard drives will probably not spin down
# anymore.
#
CONTROL_MOUNT_OPTIONS=1


#
# Dirty synchronous ratio.  At this percentage of dirty pages the process
# which calls write() does its own writeback.
#
LM_DIRTY_RATIO=60
NOLM_DIRTY_RATIO=40


#
# Allowed dirty background ratio, in percent.  Once DIRTY_RATIO has been
# exceeded, the kernel will wake pdflush which will then reduce the amount
# of dirty memory to dirty_background_ratio.  Set this nice and low, so once
# some writeout has commenced, we do a lot of it.
#
LM_DIRTY_BACKGROUND_RATIO=1
NOLM_DIRTY_BACKGROUND_RATIO=10


#
# kernel default settings -- don't touch these unless you know what you're 
# doing.
#
DEF_UPDATE=5
DEF_XFS_AGE_BUFFER=15
DEF_XFS_SYNC_INTERVAL=30
DEF_XFS_BUFD_INTERVAL=1
DEF_MAX_AGE=30


#
# This must be adjusted manually to the value of HZ in the running kernel
# on 2.4, until the XFS people change their 2.4 external interfaces to work in
# centisecs. This can be automated, but it's a work in progress that still
# needs some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for
# external interfaces, and that is currently always set to 100. So you don't
# need to change this on 2.6.
#
XFS_HZ=100


#
# Seconds laptop mode has to to wait after the disk goes idle before doing
# a sync.
#
LM_SECONDS_BEFORE_SYNC=2

cpufreq.conf

#
# Configuration file for Laptop Mode Tools module cpufreq.
#
# For more information, consult the laptop-mode.conf(8) manual page.
#

###############################################################################
# CPU frequency scaling and throttling
# ------------------------------------
#
# Laptop mode tools can automatically adjust your kernel CPU frequency
# settings. This includes upper and lower limits and scaling governors.
# There is also support for CPU throttling, on systems that don't support
# frequency scaling.
#
# This feature only works on 2.6 kernels.
#
#
# IMPORTANT: In versions 1.36 and earlier, these settings were included in the
# main laptop-mode.conf configuration file. If they are still present, they
# overrule the settings in this file. To fix this, simply delete the settings
# from the main config file.
#
###############################################################################

# Enable debug mode for this module
# Set to 1 if you want to debug this module
DEBUG=0

#
# Should laptop mode tools control the CPU frequency settings?
#
# Set to 0 to disable
CONTROL_CPU_FREQUENCY="auto"


#
# Legal values are "slowest" for the slowest speed that your
# CPU is able to operate at, "fastest" for the fastest speed,
# "medium" for some value in the middle, or any value listed in
# /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies.
# The "governor" can be any governor installed on your system, this usually
# includes "ondemand", "conservative", and "performance". The
# "IGNORE_NICE_LOAD" setting specifies that background programs that have
# a low priority ("nice level") should not cause the CPU frequency to
# be increased. (You generally want this to be enabled in battery mode.)
#
BATT_CPU_MAXFREQ=fastest
BATT_CPU_MINFREQ=slowest
BATT_CPU_GOVERNOR=ondemand
BATT_CPU_IGNORE_NICE_LOAD=1
LM_AC_CPU_MAXFREQ=fastest
LM_AC_CPU_MINFREQ=slowest
LM_AC_CPU_GOVERNOR=ondemand
LM_AC_CPU_IGNORE_NICE_LOAD=1
NOLM_AC_CPU_MAXFREQ=fastest
NOLM_AC_CPU_MINFREQ=slowest
NOLM_AC_CPU_GOVERNOR=ondemand
NOLM_AC_CPU_IGNORE_NICE_LOAD=0


#
# Should laptop mode tools control the CPU throttling? This is only useful
# on processors that don't have frequency scaling.
# (Only works when you have /proc/acpi/processor/CPU*/throttling.)
# 
# This is only useful on older P4 processors that do not support frequency
# scaling. On such processors, this is the only way to reduce power consumption
# but at the cost of higher performance penalty.
#
# Enable this only if you have a processor that does not support frequency scaling
# On most new processors, you might want to disable it.
#
# Set to 0 to disable.
CONTROL_CPU_THROTTLING=0


#
# Legal values are "maximum" for the maximum (slowest) throttling level,
# "minimum" for minimum (fastest) throttling level, "medium" for a value
# somewhere in the middle (this is usually 50% for P4s), or any value listed
# in /proc/acpi/processor/CPU*/throttling. Be careful when using "maximum":
# this may be _very_ slow (in fact, with P4s it slows down the processor
# by a factor 8).
#
BATT_CPU_THROTTLING=medium
LM_AC_CPU_THROTTLING=medium
NOLM_AC_CPU_THROTTLING=minimum

battery-level-polling.conf

#
# Configuration file for Laptop Mode Tools module battery-level-polling.
#
# For more information, consult the laptop-mode.conf(8) manual page.
#

###############################################################################
# Battery level polling settings
# ------------------------------
#
# This module allows laptop mode to react to battery level changes, even if the
# battery does not send out frequent ACPI events for such battery level changes.
#
# Note that this does NOT make ACPI-only features work on non-ACPI hardware.
###############################################################################

# Enable debug mode for this module
# Set to 1 if you want to debug this module
DEBUG=0

#
# Enable this setting to enable battery level polling.
#
ENABLE_BATTERY_LEVEL_POLLING=1

hal-polling.conf

#
# Configuration file for Laptop Mode Tools module hal-polling.
#
# For more information, consult the laptop-mode.conf(8) manual page.
#


###############################################################################
# HAL polling settings
# --------------------
#
# If you enable this module, laptop mode tools will control the polling of
# your CD/DVD drives by HAL. Disabling polling saves a considerable amount of
# power, but for some older CD/DVD drives it means that inserted CDs are no
# longer autodetected. In such cases, you must turn this option off.
# Alternatively, you can configure laptop mode tools to turn HAL polling on only
# when the laptop is running on AC power. This would mean that CDs are not
# autodetected while the laptop is running on battery power, but the power
# savings may be worth the extra manual labour when you insert a CD.
#
###############################################################################

# Enable debug mode for this module
# Set to 1 if you want to debug this module
DEBUG=0

# Control HAL polling?
# Set to 0 to disablei, vs "auto".
CONTROL_HAL_POLLING=0

# Disable HAL polling on battery?
BATT_DISABLE_HAL_POLLING=0

# Disable HAL polling on AC?
AC_DISABLE_HAL_POLLING=0

# Drives to apply HAL polling settings to
HAL_POLLING_DEVICES="/dev/scd?"

Please let me know if you require any additional information. Thank you in advance for any help.

Last edited by Aesir (2011-04-14 14:35:09)

Offline

#2 2011-03-29 12:35:49

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

I'm not using laptop-mode-tools but there is no reason why your frequencies should go up when you plug your laptop. The ondemand governor makes your processor go faster when needed, and makes it slow down when there is nothing (much) to do.

Offline

#3 2011-03-29 13:21:54

redden0t8
Member
Registered: 2011-01-27
Posts: 42

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

stqn wrote:

I'm not using laptop-mode-tools but there is no reason why your frequencies should go up when you plug your laptop. The ondemand governor makes your processor go faster when needed, and makes it slow down when there is nothing (much) to do.

Not only that, but you have the same governor set regardless of battery/ac state.  Run the following to see the governors you have avaible in your kernel:
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

Typical governors are:
conservative - scale the frequency based on load, tuned for battery use
ondemand - scale the frequency based on load, tuned for AC use
powersave - keeps the CPU at it's lowest frequency at all times
userspace - leave it up to a utility to scale power
performance - keeps the CPU at it's highest frequency at all times

I would consider using conservative for battery power.

Offline

#4 2011-03-29 13:36:33

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

1. Change 'LM_AC_CPU_GOVERNOR' and 'NOLM_AC_CPU_GOVERNOR' to performance.
2. I assume that you mean that the harddisk is spinning up, not down. This is normal as background processes use the harddisk every so often.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#5 2011-03-29 17:30:32

Tripsun
Member
Registered: 2011-01-22
Posts: 27

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Set AC to performance in cpufreq.conf, should fix the issue.

Last edited by Tripsun (2011-03-29 17:31:09)

Offline

#6 2011-03-29 17:31:58

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

Shows "performance" and "ondemand"

I changed those two lines for AC to performance and now both cores stay at 2 GHz both when plugged and when on battery (even though battery is supposed to be ondemand).  Can I make
BATT_CPU_GOVERNOR=conservative even if it is not listed in the scaling_available_governors file?

Also, are the following settings correct (I have noatime set in fstab)

From laptop-mode.conf

#
# Should laptop mode tools control readahead?
#
CONTROL_READAHEAD=1


#
# Read-ahead, in kilobytes. You can spin down the disk while playing MP3/OGG
# by setting the disk readahead to a reasonable size, e.g. 3072 (3 MB).
# Effectively, the disk will read a complete MP3 at once, and will then spin 
# down while the MP3/OGG is playing. Don't set this too high, because the 
# readahead is applied to _all_ files that are read from disk.
#
LM_READAHEAD=3072
NOLM_READAHEAD=128


#
# Should laptop mode tools add the "noatime" option to the mount options when 
# laptop mode is enabled?
#
CONTROL_NOATIME=0

# Should laptop use relatime instead of noatime? The "relatime" mount option has
# more standards-compliant semantics, and allows more applications to work,
# while retaining a low level of atime updates (i.e., disk writes).
USE_RELATIME=0


#
# Should laptop mode tools control the hard drive idle timeout settings?
#
CONTROL_HD_IDLE_TIMEOUT=1

Thanks for all the help!

Offline

#7 2011-03-29 18:09:21

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Aesir wrote:

Can I make BATT_CPU_GOVERNOR=conservative even if it is not listed in the scaling_available_governors file?

See https://wiki.archlinux.org/index.php/CP … _governors for adding governors.

Edit2: oh well, scrolling a bit up, the wiki says you don't need to add governors if you're using laptop-mode-tools... I don't know.

Edit: I have to say I hope you've got a good reason for wanting 2 GHz all the time (on AC). Ondemand is the recommended governor because you get full power when needed but reduce your power consumption and heat/noise the rest of the time. Some rare software may work badly when using ondemand though, but I would try it before wasting power with the performance mode.

Last edited by stqn (2011-03-29 18:23:58)

Offline

#8 2011-03-29 19:10:31

redden0t8
Member
Registered: 2011-01-27
Posts: 42

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Aesir wrote:

Can I make BATT_CPU_GOVERNOR=conservative even if it is not listed in the scaling_available_governors file?

If your governor isn't listed in scaling_available_governors, it won't work.  See stqn's link for info on adding governors.

stqn wrote:

Edit2: oh well, scrolling a bit up, the wiki says you don't need to add governors if you're using laptop-mode-tools... I don't know.

You do need governors if you're using laptop-mode-tools, because all laptop-mode-tools does is flip between them automatically.

If you're using cpufrequtils, you'll need the userspace governor for it to work properly.  I don't use cpufrequtils personally, so I'm not sure how to get it to work in conjunction with laptop-mode-tools.  You may have to disable frequency scaling in laptop-mode-tools by changing CONTROL_CPU_FREQUENCY to 0 in cpufreq.conf

Edit - now that I think about it, maybe laptop-mode-tools and cpufrequtils know how to load the modules themselves automatically.  I guess try it and see if they can.  You can check which governor is in use with:
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
You can also manually change governors by running (as root):
#  echo "conservative" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Of course, substitue the governor you want.

Last edited by redden0t8 (2011-03-29 19:27:12)

Offline

#9 2011-03-29 20:30:07

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Ok, well if I boot computer without power plug, /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor shows conservative.  So laptop-mode/cpufrequtils is able to load it on its own (cpufreq-info shows 800 MHz for both which is minimum).  If I plug in powersource, cpufreq-info still shows the governor as "conservative" although it is set to ondemand (waited a few minutes since I didn't know how often it was polling battery).  Why is it not detecting if I am plugged in/switching governor?

Also, in response to what you said stqn, I have been using ondemand for most of the day now and it renders the system much slower.  It's laggy and often has to wait a few seconds to load something (and hard disk spins up).  If I am simply reading a web page for a few seconds things slow down (i.e. less noise) and if I want to do something as simple as type ls in a terminal it takes a few seconds for computer to get going and show output of ls.  This is frequent and quite annoying (which makes me want to use performance unless there is a way around this for when I am plugged in).

EDIT: I am right now running performance, and I still notice this laggyness occasionally; the disk still spins up quite often, which I don't think was the case before installing laptop-mode.  Are there other settings that I need to edit?  Maybe I should just disable laptop-mode when it's plugged in (this is an option), but I then need to fix the above issue dealing with it not realizing when I am plugged in or not.

Last edited by Aesir (2011-03-30 02:21:13)

Offline

#10 2011-03-30 13:05:01

redden0t8
Member
Registered: 2011-01-27
Posts: 42

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

It sounds like laptop-mode-tools isn't getting any power events.  Do you have acpid installed and in your daemons?

Offline

#11 2011-03-30 15:39:30

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

I installed acpid (only had acpi installed previously), added it to daemon array, which now looks like this:

DAEMONS=(syslog-ng dbus @wicd @acpid @netfs @laptop-mode @crond @cups @alsa @mpd)

I have tried the following several times with identical results each time:
If I log in with power source plugged in, cpufreq shows performance (as expected).  If I unplug the power cord, cpufreq-info now shows conservative.  At the same time, however, a small popping noise comes from somewhere near speakers, and my wired internet connection gets lost (using wicd) and I am unable to get it back (it is no longer listed in wicd).  If I plug power cord back in, cpufreq still shows conservative.  Any idea what's going on?

Offline

#12 2011-03-30 15:54:26

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

It sounds like your problem is in the auto modules you are loading, specifically:
ac97-powersave
cpufreq
ethernet

The first is probably guilty of the popping noise, since it controls powersaving mode for audio chips. 
Check cpufreq for cpu throttling as well as the battery settings for governors.  And the ethernet module has
a specific setting for disabling ethernet on battery.  All of these are located in
"/etc/laptop-mode/conf.d/".

Last edited by the sad clown (2011-03-30 15:55:25)


I laugh, yet the joke is on me

Offline

#13 2011-03-30 16:04:31

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Well ethernet on battery is enabled in ethernet.conf

DEBUG=0
CONTROL_ETHERNET="auto"
BATT_THROTTLE_ETHERNET=1
LM_AC_THROTTLE_ETHERNET=0
NOLM_AC_THROTTLE_ETHERNET=0
THROTTLE_SPEED="slowest"
DISABLE_WAKEUP_ON_LAN=1
ETHERNET_DEVICES="eth0"
DISABLE_ETHERNET_ON_BATTERY=0

in cpufreq.conf, this is the part relating to throttling (should remain disbled since I have a newer processor with frequency scaling)

CONTROL_CPU_THROTTLING=0
BATT_CPU_THROTTLING=medium
LM_AC_CPU_THROTTLING=medium
NOLM_AC_CPU_THROTTLING=minimum

here is ac97-powersave.conf

CONTROL_AC97_POWER="auto"
DEBUG=0

Not sure what exactly it is I should change?

Offline

#14 2011-03-31 22:25:36

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Bump, any ideas?  I've gotten closer to solution since it now recognizes power events and switches governor, but internet stops working when I unplug power source and I can't get it back and governor doesn't switch back after plug back in.

Offline

#15 2011-04-01 00:13:30

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

You need to evaluate what is different in your settings between battery and ac.  It is in those differences that your problem lies.

For ac97, change it from "auto" to "0" if you want to disable the controller.  Also, try and disable ethernet throttling and see if that doesn't have an effect.  Also, you could just change CONTROL_ETHERNET to "0" to prevent lm from controlling it as well.  Also, try changing the IGNORE_NICE_LOAD to "0" for all settings.

If I were you, I would do these one step at a time and then assess their impact before moving on to the next one.


I laugh, yet the joke is on me

Offline

#16 2011-04-01 01:53:44

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Hi the sad clown,
Thank you for the suggestions.  CONTROL_ETHERNET to 0 fixed the internet issue.  This is fine since I would almost never be on ethernet without power cable plugged in.  The governor still doesn't switch back though.  I think it's quite strange that it just goes in one way (this is new since I installed acpid and added to daemon array).  Here is my cpufreq.conf again, although I don't see any direct issues:

DEBUG=0

CONTROL_CPU_FREQUENCY="auto"

BATT_CPU_MAXFREQ=fastest
BATT_CPU_MINFREQ=slowest
BATT_CPU_GOVERNOR=conservative
BATT_CPU_IGNORE_NICE_LOAD=1
LM_AC_CPU_MAXFREQ=fastest
LM_AC_CPU_MINFREQ=slowest
LM_AC_CPU_GOVERNOR=performance
LM_AC_CPU_IGNORE_NICE_LOAD=1
NOLM_AC_CPU_MAXFREQ=fastest
NOLM_AC_CPU_MINFREQ=slowest
NOLM_AC_CPU_GOVERNOR=performance
NOLM_AC_CPU_IGNORE_NICE_LOAD=0

CONTROL_CPU_THROTTLING=0

BATT_CPU_THROTTLING=medium
LM_AC_CPU_THROTTLING=medium
NOLM_AC_CPU_THROTTLING=minimum

Offline

#17 2011-04-01 02:23:07

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Try changing these two lines:

BATT_CPU_IGNORE_NICE_LOAD=1
...
LM_AC_CPU_IGNORE_NICE_LOAD=1

to this:

BATT_CPU_IGNORE_NICE_LOAD=0
...
LM_AC_CPU_IGNORE_NICE_LOAD=0

This might be your cpu scaling problem, since the purpose of that setting is to prevent the cpu from jumping to higher frequencies for certain background processes.


I laugh, yet the joke is on me

Offline

#18 2011-04-01 02:31:58

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Thank you for your continued support the sad clown.  This did not resolve the issue (would you suggest I switch those back to 1, since they seem like a good thing when on battery for example?).  Do you think the issue could reside with an acpid setting or cpufrequtils?

Offline

#19 2011-04-01 02:50:28

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Yes, if it didn't work, then switch it back

Try

acpi_listen

and then unplug and plug back in the laptop.  It should show output for both events.  It may be that acpi isn't noticing when you plug your laptop back in.


I laugh, yet the joke is on me

Offline

#20 2011-04-01 05:06:10

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Well I believe it is registering both events; the first segment occurs after I unplug, and the rest after I plug back in.

$ acpi_listen
ac_adapter ADP1 00000081 00000000
battery BAT0 00000080 00000001
processor CPU0 00000081 00000000
processor CPU1 00000081 00000000
battery BAT0 00000080 00000001

ac_adapter ADP1 00000081 00000001
battery BAT0 00000080 00000001
processor CPU0 00000081 00000000
processor CPU1 00000081 00000000
battery BAT0 00000080 00000001

Last edited by Aesir (2011-04-01 07:05:37)

Offline

#21 2011-04-01 12:07:50

redden0t8
Member
Registered: 2011-01-27
Posts: 42

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

From what I understand, more typical output when you plug your laptop back in should be:

ac_adapter ADP1 00000081 00000001
battery BAT0 00000080 00000000
processor CPU0 00000081 00000000
processor CPU1 00000081 00000000
battery BAT0 00000080 00000000

In otherwords, when you plug it back in, it's sending events meaning:
Plugged in...
But battery's still active!

This would explain the problem, but I'm not sure how to fix it, sorry sad

EDIT: Could you post what gets added to /var/log/daemon.log when you do a plug/unplug?

Last edited by redden0t8 (2011-04-01 12:17:32)

Offline

#22 2011-04-01 15:25:01

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

This is what shows up in daemon.log when I unplug and plug back in:

Apr  1 11:23:07 localhost laptop-mode: Laptop mode 
Apr  1 11:23:07 localhost laptop-mode: enabled, active
Apr  1 11:23:09 localhost laptop-mode: Activating Runtime PM for device type PCI
Apr  1 11:23:09 localhost laptop-mode: Activating Runtime PM for device type SPI
Apr  1 11:23:09 localhost laptop-mode: Activating Runtime PM for device type i2c

Offline

#23 2011-04-03 06:57:25

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

So does anyone have any suggestions on how to fix this?  It seems like we have identified the problem but I am not sure what to do next.

Offline

#24 2011-04-12 13:50:11

mindhack
Member
Registered: 2010-03-05
Posts: 14

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

Aesir wrote:

Well I believe it is registering both events; the first segment occurs after I unplug, and the rest after I plug back in.

$ acpi_listen
ac_adapter ADP1 00000081 00000000
battery BAT0 00000080 00000001
processor CPU0 00000081 00000000
processor CPU1 00000081 00000000
battery BAT0 00000080 00000001

ac_adapter ADP1 00000081 00000001
battery BAT0 00000080 00000001
processor CPU0 00000081 00000000
processor CPU1 00000081 00000000
battery BAT0 00000080 00000001

What you need to do is to edit the events in /etc/acpi/events/

change the "event" line in "/etc/acpi/events/lm_battery" to the following

event=ac_adapter ADP1 00000081 00000000.*

and then edit "/etc/acpi/events/lm_ac_adapter" and change the "event" line to this:

event=ac_adapter ADP1 00000081 00000001.*

Restart acpid and try unplugging and plugging power back in. Laptop mode should work now.

Good luck

Offline

#25 2011-04-14 14:35:38

Aesir
Member
Registered: 2011-02-03
Posts: 22

Re: Laptop-mode-tools/cpufrequtils Questions [SOLVED]

This last post solved the cpufrequtils issue!  Thanks for all the help.

Last edited by Aesir (2011-04-14 14:36:05)

Offline

Board footer

Powered by FluxBB