You are not logged in.

#1 2009-12-15 08:50:48

zowki
Member
From: Trapped in The Matrix
Registered: 2008-11-27
Posts: 582
Website

Laptop mode permanently on

I added laptop-mode to the daemons list my rc.conf. My laptop_mode.conf is set to only enable laptop_mode when on battery and disable it on AC but it seems to permanenty on. I'm stuck with a CPU underclocked at 800mhz with slow hard disc access now. How can I disable laptop_mode whenever plugged into AC?


How's my programming? Call 1-800-DEV-NULL

Offline

#2 2009-12-15 09:45:33

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: Laptop mode permanently on

This isn't really an answer to your problem, but I noticed that my laptop-mode doesn't seem to access any of the configuration files, and so I stopped using it and hard-coded all my powersaving features in if statements within scripts.  You might just want to check to see if your laptop-mode is changing the settings to what you'd like (besides the on battery/off battery bit).

As an actual answer, I would suggest that you write a script that goes something like this:

if cat /proc/acpi/ac_adapter/ADP1/state | grep -q off-line
then
    sudo /etc/rc.d/laptop-mode start
else
   sudo /etc/rc.d/laptop-mode stop
fi

You can stick that in the root user's cronjob to check to see if the AC is plugged in or not regularly (best solution I could think of).  Before doing so, however, I'd suggest you double-check to see if the state is recorded properly in the file (and it may be on a slightly different path on your machine).

Hope that helps,
Lswest

Last edited by lswest (2009-12-15 09:46:05)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#3 2009-12-16 01:56:32

zowki
Member
From: Trapped in The Matrix
Registered: 2008-11-27
Posts: 582
Website

Re: Laptop mode permanently on

Are you to say that all my config files are rendered useless? Then why did the programmers of laptop-mode-tools even place config files there? Is it just to confuse users? The wiki should be corrected to relect this. My apologies but I don't find your solution very satisfying since I made a lot of changes from the default configurations and I want them to all take effect. But I am using it as a short term solution at the moment. I set up the cronjob to run every minute.


How's my programming? Call 1-800-DEV-NULL

Offline

#4 2009-12-16 11:58:04

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: Laptop mode permanently on

zowki wrote:

Are you to say that all my config files are rendered useless? Then why did the programmers of laptop-mode-tools even place config files there? Is it just to confuse users? The wiki should be corrected to relect this. My apologies but I don't find your solution very satisfying since I made a lot of changes from the default configurations and I want them to all take effect. But I am using it as a short term solution at the moment. I set up the cronjob to run every minute.

What I'm trying to say is that, to the best of my knowledge and experience, laptop-mode-tools stopped reading the config files.  I haven't used it for the last 2 releases, so that issue may have been fixed.  It's also quite likely that the problem lies within the Arch package, or the way Arch is set up.  I didn't look into it too much, as I use minimal powersavings options (at least, minimal ones that I need to run only on battery).  The programmers placed the config files there, because they are intended to configure the options.  If they don't do so, it's either a bug, or a problem with the implementation of laptop-mode on Arch, since the last time I used it on Ubuntu it worked just fine.  I am by no means an authority on this topic, I was merely posting my solution to the problem that I noticed, spent a day or two trying to fix about 3 months ago, and then stuck with my quick work around, since I have no pressing need (or desire) to fix laptop-mode, or to test to see if it's working again.  I also do not know if this problem is present for all users or not, so the Wiki, at most, should have a disclaimer that for some users the config files don't influence anything (and it's a wiki, so you can edit it, just like everyone else).  Your apologies are unnecessary.  I never said that this would be the one and only solution to the problem, nor did I say you had to adapt it.  The config files all simply change settings, and, with enough time and research, you can implement a script for each settings that does it properly for your system if you really insist on doing so.  I ended up doing that for all of my settings.  Do you want to do that?  Probably not.

A few things I can suggest you try are:
- Check the laptop-mode-tools homepage/bugtracker (if they have one, I can't remember if they do), and see if there are any bugs relating to you problem
- Contact the developer(s), and describe the problem to them, and see if they can offer insight into why it may occur (I can't, since I don't know how laptop-mode works, nor have I bothered figure it out)
- Compile laptop-mode-tools from source/see if there is a git version on the AUR, and see if the re-built package fixes that problem for you (feel free to back up the configs and such beforehand, just in case)
- Wait until someone else posts a more suitable (for you) solution, if one exists.

Also, have you googled for this problem using the following method:
<searchterms> site:bbs.archlinux.org

If not, it may yield some better results than the search function of the forum.

I'm sorry that my solution wasn't adequate for your needs, but I felt I should offer my experience and work around, in order to get you through the time until you find a solution that works for you (or the problem is resolved by the developers/package maintainer).

Good luck and I hope I've helped a bit,
Lswest

*Update* I have spent some time playing with laptop-mode again, and it appears that it does, indeed, read and use the config files.  I can tell this is true, since it enables/disables my bluetooth upon AC and battery (respectively), whereas it should always be disabled (the setting I "force" upon boot).  The only script that doesn't seem to work for me is the start/stop programs one, since my laptop has no LCD monitor brightness file laptop-mode can't handle it normally, and so I wrote a script to start on battery and stop on AC to regulate brightness, which is never run.  That means (for you), that the crontab entry to start/stop laptop-mode upon AC/Battery should be all that you need, since the rest of the settings are preserved and executed.  I can't be 100% sure that all of them are run (since I don't use all of them), but there are ways for you to check it, by changing certain settings and using powertop/checking the config files to ensure that changes are regulated between AC and battery.

*Update #2*  I have contacted the developer of laptop-mode-tools about the start-stop-programs.conf issue, and we discovered that my acpid wasn't logging events (event logging disabled), and the problem was completely solved by running sudo acpid -d -l (meaning the problem seems to lie within the acpid package).  It also correctly enabled/disabled laptop-mode-tools on AC and on Battery.  Check to make sure if this results in laptop-mode-tools working.  I'll start a thread regarding this problem after searching through the forums first.  I'll leave a link here so you can follow the progress.  Thread started: http://bbs.archlinux.org/viewtopic.php? … 24#p673024  I have now solved it to the best of my abilities.  Below is my "work around" that should be suitable for you as well.

*EDIT I've come up with a work around that works for me without user intervention.  According to a bug I read on launchpad for Ubuntu, the problem seems to lie with HAL.  The hald-addon-acpi starts reading acpi events, but does nothing with them (it seems, it may have changed, since the bug was from 2008).  Either way, my "fix" is this:
1. Edit the visudo file with:

sudo VISUAL=vim visudo

2. Add this line to the groups section:

%power ALL = NOPASSWD:/usr/sbin/acpid
%power ALL = NOPASSWD:/etc/rc.d/acpid

3. Add this to your .xinitrc:

sudo /etc/rc.d/acpid stop
sudo /etc/rc.d/acpid start

This gives all users in the group "power" the ability to start/stop acpid without requiring a password for sudo.  I then stick the commands in the .xinitrc script, which runs when you log in.  Not a great fix, but it works.  I'm not sure what else you could do, or how to fix it permanently.  Hopefully this is helpful to anyone who has the same problem.

Last edited by lswest (2009-12-22 16:16:18)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#5 2009-12-19 12:14:11

freebuilder
Member
Registered: 2009-09-08
Posts: 2

Re: Laptop mode permanently on

my config

vi /etc/laptop-mode/laptop-mode.conf {
ENABLE_LAPTOP_MODE_ON_AC=1
ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=1

MINIMUM_BATTERY_CHARGE_PERCENT=11
DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=7

CONTROL_HD_IDLE_TIMEOUT=0

CONTROL_HD_POWERMGMT=1
BATT_HD_POWERMGMT=192
LM_AC_HD_POWERMGMT=192
NOLM_AC_HD_POWERMGMT=192
}

# no cpufrequtils
vi /etc/laptop-mode/conf.d/cpufreq.conf {
CONTROL_CPU_FREQUENCY=1
}

# more vi /etc/laptop-mode/conf.d/*

vi /etc/rc.conf {
MODULES=(powernow-k8)

DAEMONS=(acpid hal laptop-mode)
}

Last edited by freebuilder (2009-12-19 12:14:40)

Offline

#6 2009-12-19 15:46:53

zowki
Member
From: Trapped in The Matrix
Registered: 2008-11-27
Posts: 582
Website

Re: Laptop mode permanently on

freebuilder, does laptop-mode-tools successfully read your config file?


How's my programming? Call 1-800-DEV-NULL

Offline

#7 2009-12-19 17:41:48

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: Laptop mode permanently on

zowki wrote:

freebuilder, does laptop-mode-tools successfully read your config file?

I've already corrected myself that the laptop-mode tools does, in fact, read the config files properly, and the only issue I had was caused by acpid, which I've fixed.  You can also check to see if laptop-mode-tools works properly by running:

sudo laptop_mode force auto

and see if it adjusts your settings properly.


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#8 2009-12-29 12:59:51

freebuilder
Member
Registered: 2009-09-08
Posts: 2

Re: Laptop mode permanently on

zowki wrote:

freebuilder, does laptop-mode-tools successfully read your config file?

Sure, no problem.

Offline

Board footer

Powered by FluxBB