You are not logged in.

#126 2012-05-30 19:41:08

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

Quick question: hdparm doesn't need partition labels, does it? I have only one disk, /dev/sda, so could I also give that as an argument? E.g.

run hdparm -S 6 -B 254 -a 2048 /dev/sda

instead of

for dev in $(awk '/^\/dev\/sd/ {print $1}' /etc/mtab); do run hdparm -S 6 -B 254 -a 2048 $dev; done

EDIT: Also, does setting a new hdparm value overwrite a previous one? I already have an entry in /etc/rc.local:

# Control HDD
hdparm -B 254 -a 2048 /dev/sda > /dev/null

Powerdown runs hdparm too, so my question is if I have to add those settings to the entry in powerdown if I want to keep these values? I think I do, but just checking here to be sure!

Last edited by Unia (2012-05-30 19:45:23)


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#127 2012-05-30 20:03:25

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

If you use rc.local to have your hard disk power management set, you can comment the lines doing that in the powerdown script, to be sure they're not executed.
And yes,

for dev in $(awk '/^\/dev\/sd/ {print $1}' /etc/mtab); do run hdparm -S 6 -B 254 -a 2048 $dev; done

is only useful if you have more than one hd!

Last edited by nierro (2012-05-30 20:03:43)

Offline

#128 2012-05-30 21:07:44

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

I meant that for example, if I have -B254 set in rc.local and I then run -S6 from powerdown, would the -B254 still apply or would it have been overwritten?

And thanks for the tip on the hdd!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#129 2012-05-30 21:10:40

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

yes it remains applied! smile

Offline

#130 2012-05-30 21:12:10

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

nierro wrote:

yes it remains applied! smile

Awesome, thanks!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#131 2012-05-30 21:54:55

I am Gianluca
Member
From: London, UK
Registered: 2011-05-22
Posts: 195

Re: 3x+ battery life

nierro wrote:

The real difference between this package and lmt is that :
1) lmt is a daemon + lots of config files, powerdown and powerup are 2 scripts.
2) You won't know what works and what doesn't with laptop-mode-tools, while with this script you can see any error in the log.
3) this package is easily extensible.
4)laptop-mode-tools is slowly developed.
5) you know what powerdown does. You won't know what laptop-mode-tools does (or, at least, with powerdown, you can check easily the code and understand it. Lmt is a series of script performed by the daemon.
6) lmt requires acpid. With this script you can use pm-utils and its powersaving features (plus upowerd, even if i'm having troubles with upowerd + DE + pm-utils, and i have to rely acpid anyway).
BTW i do not use this script but i created my own powersaving script, using the one from crunchbang forum and this, plus other things i needed.
So the key-feature is that it is highly extensible and easily adjustable (at least, for me).

Thank you so much Nierro.
I want to read carefully the thread on #!'s forum and study a bit deeper taylorchu's work. I want to learn more about this subject.


Laptop: Acer Aspire S3 | Linux Mint Cinnamon 64-bit

Offline

#132 2012-05-31 18:43:31

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

Another question.

When I run the default powerdown script, I get an error about the pcie_aspm setting. At first I thought that would be because I can't set this setting, so I checked whether or not I had this path and it turns out that I do. However, the file powerdown wants to write to, contains different stuff than what powerdown wants to write to it:

[root@lappy parameters]# cat /sys/module/pcie_aspm/parameters/policy
[default] performance powersave

That seems to be the default so I guess I could just remove the line from powerdown, but I want to know why I have different contents of this file and how I could edit powerdown to make it work (and thus be able to choose between the settings)

Thanks!

EDIT: Should add that powerdown wants to write the following:

opt /sys/module/pcie_aspm/parameters/policy powersave

Last edited by Unia (2012-05-31 18:44:40)


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#133 2012-05-31 18:45:57

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

By the way, Gianluca, here's a nice link on this topic:
http://www.thinkwiki.org/wiki/How_to_re … onsumption


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#134 2012-05-31 18:57:27

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

I've got that error too, my dear unia smile
I solved commenting that line in my script!

Offline

#135 2012-05-31 19:05:09

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

nierro wrote:

I've got that error too, my dear unia smile
I solved commenting that line in my script!

I have too, for now. I just wondered why my file seems to be of and how I can enable powermanagement on this.


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#136 2012-05-31 19:31:35

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: 3x+ battery life

@Unia: isn't there a more uptodate doc? it seems that some areas of Linux have perpetually out-of-date documentation and "tips"

Offline

#137 2012-05-31 22:49:43

I am Gianluca
Member
From: London, UK
Registered: 2011-05-22
Posts: 195

Re: 3x+ battery life

Unia wrote:

By the way, Gianluca, here's a nice link on this topic:
http://www.thinkwiki.org/wiki/How_to_re … onsumption

Thank you Unia. ASAP I will read it carefully.
I hope to contribute more in the next few weeks, unfortunately in this weekend I'm busy.
By the way, I'll continue to catch up with the thread. I desperately need to maximize my battery life.
More it can lasts, better it is.


Laptop: Acer Aspire S3 | Linux Mint Cinnamon 64-bit

Offline

#138 2012-05-31 23:38:51

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: 3x+ battery life

I added the description about aspm. do not comment out that in powerdown because it saves a lot battery.
I also remove the code to spin down the disk, so there is less dependency.


"After you do enough distro research, you will choose Arch."

Offline

#139 2012-06-01 07:41:57

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

opt /sys/module/pcie_aspm/parameters/policy powersave

In order to do this, you have to pass pcie_aspm=force to the kernel line!

Offline

#140 2012-06-01 08:18:20

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: 3x+ battery life

supposedely you don't need to force it anymore? I can't find the source to back this, but i recall there was a commit to 3.x that made that useless
please correct me if I'm wrong, I may be mixing things..

Offline

#141 2012-06-01 08:52:12

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

Well, i thought it too.
But it seems i can't echo powersave > /sys/module/pcie_aspm/parameters/policy even if i'm root, without that option. Don't ask me why smile  I think that parameter is read only without pcie_aspm=force in the kernel line!

Offline

#142 2012-06-02 17:40:41

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

It indeed works only with pcie_aspm=force in the kernel line. Thanks nierro wink


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#143 2012-06-02 17:42:15

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

smile happy to help

Offline

#144 2012-06-02 18:05:21

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: 3x+ battery life

Thanks!

Offline

#145 2012-06-02 18:12:23

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

That aspm powersave feature really does improve things! Estimated time left when idling before: 1.30 hours.

Now? 2.11!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#146 2012-06-03 15:07:10

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

So I just finished adapting this script for my specific setup and am ready to implement it. Now I am wondering what the best place to put this script is. I have acpid installed, as well as pm-utils.

Here and there I read that people use it with pm-utils, but I can also call it from the acpid handler.sh. What do you think is the best option to use?


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#147 2012-06-03 15:24:49

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

As i said, using pm-utils + upower seems to create some problems (at least, for me), after suspend/hibernate.
So i use acpid, and put "pm-powersave" in rc.local (well i now created a service for systemd), and pm-powersave false/true in the right place in handler.sh .
If you don't want one more daemon running, you can use pm-utils and upower; may be you're not going to have troubles i had with them smile
Good luck!

Offline

#148 2012-06-04 12:10:39

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: 3x+ battery life

Great topic!! My temperatures now are about 50 °C against 70°C before ... But my battery is completely fried (acpi -V tells me that it uses 34 % of its capacity) and it lasts almost 30 minutes....Is there a way to avoid that current is directed to battery when it's fully charged? (Apart removing it phisically of course tongue )

Last edited by TheImmortalPhoenix (2012-06-04 12:11:40)

Offline

#149 2012-06-06 21:46:34

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

Using pm-utils + upower works for me, at least after one test it did.

However, I didn't have upower installed so I'd have to install an extra package to get it to work. Since I initially had acpi already running, I decided to go that way. This is the more cleaner solution for me, as I

1) won't have to install another extra package
2) I already control most of the stuff by handler.sh, and use pm-utils solely for its suspend (quick question: can I substitute another package for this? Do note that I use Catalyst)

Thanks for all the help in this topic! I now finally have a robust powermanagement in place!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#150 2012-06-07 08:28:59

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

Hm, here's a disadvantage of using handler.sh: it will only switch power states when you (un)plug the power. When you boot with power unplugged, it will not automatically trigger powerdown.


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

Board footer

Powered by FluxBB