Last visit was: It is currently 24/07/2014, 23:59


All times are UTC [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 18/02/2010, 15:36 
Newbie
Newbie

Joined: 18/02/2010, 10:31
Posts: 9
Hello everybody,

just for everyone interested I post my /etc/rc.local optimized for powersaving with my NC10 \w Supertalent 64Gb SSD . I'm using the PHC-enabled kernel and Intel-PHC for cpu undervolting and a self-compiled iwlagn driver for the Intel 5100agn wifi card which is replacing the built-in atheros.

Estimated battery time right now: 80% battery, ~6:30h (screen dimmed to 1/8, compiz, firefox, mail, feedreader, wifi). Realistic usage time is about ~5:30-6:00h. Powertop minimum watt usage reported 6,9W.

Problem #1: Soundchip powersaving does not work, sound remains muted :(

Problem #2: Setting suspend mode for HSDPA modem to "auto" only seems to work by doing "by hand" in a terminal after gnome has been fully loaded, setting the mode in rc.local or /usr/lib/pm-utils/sleep.d does not work. Any help would be greatly appreciated.



Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# cpu voltage powersaving
echo "12:20 10:15 8:15 6:15" | tee /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
echo "12:20 10:15 8:15 6:15" | tee /sys/devices/system/cpu/cpu1/cpufreq/phc_controls

# wifi powersaving
iwconfig wlan0 power on

# laptop mode
echo 5 | tee /proc/sys/vm/laptop_mode
echo 1 | tee /sys/devices/system/cpu/sched_smt_power_savings

# drive polling
hal-disable-polling --device /dev/scd0

# disc usage
echo noop | tee /sys/block/sda/queue/scheduler
echo 1 | tee /proc/sys/vm/swappiness
echo 1500 | tee /proc/sys/vm/dirty_writeback_centisecs
echo 20 | tee /proc/sys/vm/dirty_ratio
echo 10 | tee /proc/sys/vm/dirty_background_ratio

#echo 10 | tee /sys/module/snd_hda_intel/parameters/power_save
# disabled since with this line there is no sound at all

# HSDPA
#echo "auto" | tee /sys/bus/usb/devices/1-7/power/level
# disabled since "auto" cannot be set via /etc/rc.local. Timing issue?

# Webam
echo "auto" | tee /sys/bus/usb/devices/1-8/power/level

for dir in apparmor apt ConsoleKit cups dist-upgrade fsck gdm installer news ntpstats samba unattended-upgrades ; do
    if [ ! -e /var/log/$dir ] ; then
        mkdir /var/log/$dir
    fi
done


for d in /sys/bus/usb/devices/* ; do
     if [ -e "$d/power/autosuspend" ]; then
            echo "0" > $d/power/autosuspend
     fi
done
exit 0


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 18/02/2010, 18:15 
Administrator
Administrator
User avatar

Joined: 12/02/2009, 18:08
Posts: 1377
Location: Italy
Hello,
welcome to the forum and thanks for sharing these infos, they are really interesting. :)

In my opinion a better way to set almost all of the options you have in your rc.local is by using laptop-mode.
Doing so your problems with sound card and HSDPA modem should also be resolved.

To be more specific:
  • In '/etc/laptop-mode/laptop-mode.conf', set:
    Code:
    LM_SECONDS_BEFORE_SYNC=5
    LM_DIRTY_RATIO=20
    LM_DIRTY_BACKGROUND_RATIO=10
    LM_BATT_MAX_LOST_WORK_SECONDS=15
    in substitution, respectively, of:
    Code:
    echo 5 | tee /proc/sys/vm/laptop_mode
    echo 20 | tee /proc/sys/vm/dirty_ratio
    echo 10 | tee /proc/sys/vm/dirty_background_ratio
    echo 1500 | tee /proc/sys/vm/dirty_writeback_centisecs
  • In '/etc/laptop-mode/conf.d/sched-mc-power-savings.conf', set:
    Code:
    CONTROL_SCHED_MC_POWER_SAVINGS=1
    in substitution of:
    Code:
    echo 1 | tee /sys/devices/system/cpu/sched_smt_power_savings
  • In '/etc/laptop-mode/conf.d/hal-polling.conf', set:
    Code:
    CONTROL_HAL_POLLING=1
    in substitution of:
    Code:
    hal-disable-polling --device /dev/scd0
  • In '/etc/laptop-mode/conf.d/intel-hda-powersave.conf', set:
    Code:
    CONTROL_INTEL_HDA_POWER=1
    in substitution of:
    Code:
    #echo 10 | tee /sys/module/snd_hda_intel/parameters/power_save
    # disabled since with this line there is no sound at all
  • In '/etc/laptop-mode/conf.d/usb-autosuspend.conf', set:
    Code:
    CONTROL_USB_AUTOSUSPEND=1
    in substitution of:
    Code:
    # HSDPA
    #echo "auto" | tee /sys/bus/usb/devices/1-7/power/level
    # disabled since "auto" cannot be set via /etc/rc.local. Timing issue?

    # Webam
    echo "auto" | tee /sys/bus/usb/devices/1-8/power/level

    for d in /sys/bus/usb/devices/* ; do
         if [ -e "$d/power/autosuspend" ]; then
                echo "0" > $d/power/autosuspend
         fi
    done
In addition to these, laptop-mode has many other options that can be configured. Take a look at '/etc/laptop-mode/laptop-mode.conf' and at all the config files inside the directory '/etc/laptop-mode/conf.d/'.

Also, you can set the swappiness to 1 in '/etc/sysctl.conf', by adding at the end of the file:
Code:
vm.swappiness = 1

Concerning the cpu undervolting, this is an interesting topic. :)
I'm building right now a new kernel with the PHC patch applied. If everything is ok, I will add it to the kernel on the repository too.

_________________
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 18/02/2010, 18:38 
Newbie
Newbie

Joined: 18/02/2010, 10:31
Posts: 9
Thank you for the laptop-mode suggestions, I'll try that. On the other hand I like the idea of having all settings in one single file...

I tried the undervolting/PHC in order to maybe turn off the (annoying) fan more often but this did not work. The fan switches on/off for every ~10 minutes after using the NC10 for ~20 minutes from boot :(


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 18/02/2010, 19:08 
Administrator
Administrator
User avatar

Joined: 12/02/2009, 18:08
Posts: 1377
Location: Italy
cywhale wrote:
Thank you for the laptop-mode suggestions, I'll try that. On the other hand I like the idea of having all settings in one single file...
The fact is, laptop-mode manages the various options dinamically, by changing them as needed. Instead, by setting them statically once only at boot, the changes may be lost after a while. For instance, if you connect an USB device when the system is already running, the autosuspend would not be enabled for that device.
cywhale wrote:
I tried the undervolting/PHC in order to maybe turn off the (annoying) fan more often but this did not work. The fan switches on/off for every ~10 minutes after using the NC10 for ~20 minutes from boot :(
I don't know if this is normal, I rarely hear the fan noise from my NC10. But it might just be because I never paid much attention to it.
What about power consumption? Have you noticed any significant difference by using undervolt?

_________________
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 20/02/2010, 12:53 
Administrator
Administrator
User avatar

Joined: 12/02/2009, 18:08
Posts: 1377
Location: Italy
The new kernel with the PHC patch applied is on the repository now. :)
After some tests, I've found the better VIDs for my NC10:
24 16 15 15
defaults were:
39 31 23 15
When CPU is under heavy load, I've gained 0.5W, not bad. :)
I have to say, I'm impressed by your VIDs, they are very low... did you do some tests to check if the system is stable (expecially when working at 1.6GHz)?

Anyway, now my system reports 6:20h as battery time, with battery at 100%, screen dimmed to 1, wifi on, bluetooth on, compiz enabled (just for the record, the battery max capacity is at 88% after ~1 year of life).

Well, it's time to update the laptop-mode thread with more optimizations.

_________________
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 20/02/2010, 13:08 
Newbie
Newbie

Joined: 18/02/2010, 10:31
Posts: 9
Nice :)

Well, I'm using those values for nearly the whole time since buying the NC10, never tested long-time 1,6Ghz cpu load but using them in my usual workflow (mail, browser, chat, image converting, moving files,... even once converting an avi movie with mencoder) never gave me a system freeze.

Does your kernel have any other NC10/Atom specific optimizations?


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 20/02/2010, 13:19 
Administrator
Administrator
User avatar

Joined: 12/02/2009, 18:08
Posts: 1377
Location: Italy
No, it just fixes the FN keys release problem on various netbook models, and a SATA freezing problem on Samsung N130/N140.

_________________
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 20/02/2010, 19:06 
Newbie
Newbie

Joined: 20/02/2010, 19:00
Posts: 3
cywhale wrote:
I tried the undervolting/PHC in order to maybe turn off the (annoying) fan more often but this did not work. The fan switches on/off for every ~10 minutes after using the NC10 for ~20 minutes from boot :(


Perhaps you can try easy-slow-down-manager from
http://code.google.com/p/easy-slow-down-manager/
But I don't know if it works.


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 20/02/2010, 20:07 
Newbie
Newbie

Joined: 18/02/2010, 10:31
Posts: 9
*wwwoooow* !!
Can't count the times I wished someone would develope a tool like this for Linux - and finally it happened.

Thank you very much for this link. Tried it a few moments ago (quick look at the source, installed linux-headers and the DEB) - module loaded , switched to silent-mode -> as I'm typing this my NC10 is silent, absolutely silent! I'll test this and report here... thank you very much (btw. a silent fan should give us some more battery time, shouldn't it?) :)


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 20/02/2010, 20:25 
Newbie
Newbie

Joined: 20/02/2010, 19:00
Posts: 3
No problem. I'm testing your PHC-settings at the moment under Arch Linux with modified kernel-netbook from AUR. There I also found the easy-slow-down-manager.


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 21/02/2010, 11:45 
Newbie
Newbie

Joined: 18/02/2010, 10:31
Posts: 9
Nice.
As in Windows the CPU temperature seems te be allowed to go up to 54°-55°, then the fan starts and brings temp back down to ~ 51°. Without this module fan triggering temp was about 45°C :)


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 21/02/2010, 14:25 
Administrator
Administrator
User avatar

Joined: 12/02/2009, 18:08
Posts: 1377
Location: Italy
Thank you for letting us know about easy-slow-down-manager. ;)

I've uploaded a custom package on the repository, containing this kernel module.
I think I'll rewrite the 'samsung-scripts' in order to use this new module, as soon as I can. :)

_________________
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 22/02/2010, 21:41 
Newbie
Newbie

Joined: 18/02/2010, 10:31
Posts: 9
Nice, using the NC10 from time to time since this morning I never heard the fan running, sensors applet says ~51°C. The big difference here was switching off Compiz/AWN and returning to Metacity/Gnome-Panel.

Edit: K, right now as I'm typing this the fan starts spinning :)


Top
 Profile  
 
 Post subject: Re: Powersaving rc.local ubuntu karmic/NC10
PostPosted: 11/04/2010, 11:25 
Administrator
Administrator
User avatar

Joined: 12/02/2009, 18:08
Posts: 1377
Location: Italy
cywhale wrote:
Thank you for the laptop-mode suggestions, I'll try that. On the other hand I like the idea of having all settings in one single file...
Just for the record, I've just added laptop-mode support to the new 'Samsung Tools' application I'm writing. My idea is to add support for all customizable settings (PHC/undervolt support too), in order to configure them from a centralized place, in a friendly way. :)

_________________
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net & kodeki