Linux and Battery Charge Capacity
Linux and Battery Charge Capacity
This is entirely a subjective observation, but after a couple years and several batteries it really seems to me like my battery charge capacity when full diminishes significantly more rapidly in Linux than in Windows. I'm using Arch64 on a T61, but I've observed this in Ubuntu and Debian as well as on my slightly older T60. Is there anything to be done about this? Does the Lenovo/IBM battery monitor software really handle the battery charging better? Isn't this mostly controlled by the BIOS?
I'm interested if other people have had the same experience and what thoughts you may have about this. Thanks.
I'm interested if other people have had the same experience and what thoughts you may have about this. Thanks.
Re: Linux and Battery Charge Capacity
I tend to disagree. When I first started using Linux on my laptop I would get better battery life in Windows (also the battery was brand new). Now that my battery is older and has less capacity I find that I can get longer life in Linux. I am also using some tweaks to extend the battery life in Linux that I did not initially use. I'm not sure if Linux fairs better with older batteries (doubtful, but that's just my observation) or if the tweaks are more effective in Linux (more likely). To help here's what I do.
- Use powertop
- Screen/Screensaver settings (dim on battery, blank when idle, shorter idle time, etc.)
- CPU Frequency scaling (Since you're using Arch: pacman -S cpufrequtils)
- Setting battery thresholds
The battery thresholds are, IMO, the most important. If you keep it from full charging and discharging you'll keep it's capacity high and, thus, get longer life. Of course this is tough since the whole idea of a laptop is to be mobile and nobody wants a half-charged battery all of the time (I tend to use mine more as a desktop replacement so I don't worry about mobility as much which is why I baby my battery).
In Arch you'll need the tp_smapi package which contains kernel modules for interacting with Thinkpad hardware (battery, HAPS, HDD, etc.). To set the thresholds you just need to do the following:
You can create a script with this if you like and then add it to /etc/rc.local to make it run at startup.
NB: I'm on 32-bit Arch so you'll want to double-check all of this for Arch64 (either the ArchWiki or the forums).
- Use powertop
- Screen/Screensaver settings (dim on battery, blank when idle, shorter idle time, etc.)
- CPU Frequency scaling (Since you're using Arch: pacman -S cpufrequtils)
- Setting battery thresholds
The battery thresholds are, IMO, the most important. If you keep it from full charging and discharging you'll keep it's capacity high and, thus, get longer life. Of course this is tough since the whole idea of a laptop is to be mobile and nobody wants a half-charged battery all of the time (I tend to use mine more as a desktop replacement so I don't worry about mobility as much which is why I baby my battery).
In Arch you'll need the tp_smapi package which contains kernel modules for interacting with Thinkpad hardware (battery, HAPS, HDD, etc.). To set the thresholds you just need to do the following:
Code: Select all
echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 80 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
NB: I'm on 32-bit Arch so you'll want to double-check all of this for Arch64 (either the ArchWiki or the forums).
W510: i7-820QM / 8GB 1066 RAM/ 1 GB NVIDIA Quadro FX 880M / 500GB 7200rpm / 15.6" HD 1080 / Arch Linux
Re: Linux and Battery Charge Capacity
Thanks for the suggestion about how to set battery thresholds. I wasn't aware this was possible in Linux.
I just want to be clear that I wasn't talking about battery life (though I realized no matter how I said this I would likely create a potential confusion). That is, I wasn't talking about battery life in the sense of, how many hours my computer will run on the battery when it is charged up. I was talking only about the overall lifetime of the battery (how many times it can be recharged and the rate at which it's full charge capacity diminishes).
That said, I really don't find that the battery life is better in Linux as you do. The rate of discharge in watts is always lower in windows, than in Linux, in my experience, no matter what I do. I have done all the things you suggest (powertop, etc.) and more (I used laptop-mode to regulate the hard drives). Linux for me isn't bad, but windows is always better. I assumed this is because Lenovo/IBM has written specific software and drivers for the T61 to regulate power use and it's hard to reproduce this in Linux. One question I've always had is how can I be sure the bluetooh and irda radios are disabled (since I don't use them)?
Anyway, I really appreciate the battery threshold suggestion. Thanks.
I just want to be clear that I wasn't talking about battery life (though I realized no matter how I said this I would likely create a potential confusion). That is, I wasn't talking about battery life in the sense of, how many hours my computer will run on the battery when it is charged up. I was talking only about the overall lifetime of the battery (how many times it can be recharged and the rate at which it's full charge capacity diminishes).
That said, I really don't find that the battery life is better in Linux as you do. The rate of discharge in watts is always lower in windows, than in Linux, in my experience, no matter what I do. I have done all the things you suggest (powertop, etc.) and more (I used laptop-mode to regulate the hard drives). Linux for me isn't bad, but windows is always better. I assumed this is because Lenovo/IBM has written specific software and drivers for the T61 to regulate power use and it's hard to reproduce this in Linux. One question I've always had is how can I be sure the bluetooh and irda radios are disabled (since I don't use them)?
Anyway, I really appreciate the battery threshold suggestion. Thanks.
Re: Linux and Battery Charge Capacity
Is there any reason not to just add those two lines (echo 40 > /sys/devices/...) directly to rc.local? Instead of creating a script. That's what I do to set my trackpoint sensitivity and it seems to work fine.Superego wrote:You can create a script with this if you like and then add it to /etc/rc.local to make it run at startup.Code: Select all
echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh echo 80 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
Re: Linux and Battery Charge Capacity
I've never tried to turn off the irda radio through Linux, I just turn off it in the BIOS (you should have a config option to hide it from the OS).
Regarding the bluetooth, there may be a similar option in BIOS but since I use bluetooth sometime I turn it on and off using ACPI. You can turn off power with the command:
You'll need to be root to this as using redirection with sudo is a little funky (I think sudo -s may work). I just mapped my Fn+F5 key to this command so I can turn bluetooth on and off when I need. Hope this helps.
Regarding the bluetooth, there may be a similar option in BIOS but since I use bluetooth sometime I turn it on and off using ACPI. You can turn off power with the command:
Code: Select all
# Turn off
echo "0" > /sys/devices/platform/thinkpad_acpi/bluetooth_enable
#Turn on
echo "1" > /sys/devices/platform/thinkpad_acpi/bluetooth_enable
W510: i7-820QM / 8GB 1066 RAM/ 1 GB NVIDIA Quadro FX 880M / 500GB 7200rpm / 15.6" HD 1080 / Arch Linux
Re: Linux and Battery Charge Capacity
Yes, very helpful. Thanks!
Re: Linux and Battery Charge Capacity
Yeah you could add those lines to rc.local directly. I mentioned the script because I wrote one a while back that allowed me to input what threshholds and which battery to use (for when I used the ultrabay battery).
W510: i7-820QM / 8GB 1066 RAM/ 1 GB NVIDIA Quadro FX 880M / 500GB 7200rpm / 15.6" HD 1080 / Arch Linux
Re: Linux and Battery Charge Capacity
Sounds good. Thanks for the follow up. Yeah, I did that with rc.local and it seems to be working. (By the way, the tp_smapi pacakage in AUR does work with 64 bit Arch).
Now I guess I'm wondering what are the best settings for me to get some benefit in maintaining the battery capacity longer. I read in ThinkWiki that 30 - 85 % charge is the ideal range. But since I do run off my battery a lot, I don' really want a battery that's only 85 % charged. Hmm.
I've noticed the battery rarely seems to go above 99% (to 100%), so I wonder if having it stop at 99% and not keep charging for hours to get to 100% has some benefit.
Of course, I don't want my battery to have to run down to 30% before it starts charging either, in case I find myself in a situation where I need to run off of the battery. So I'm also wondering what benefit there is if it at least has to run down to 95% or 85%.
Or is there a better way to do this for my needs?
Now I guess I'm wondering what are the best settings for me to get some benefit in maintaining the battery capacity longer. I read in ThinkWiki that 30 - 85 % charge is the ideal range. But since I do run off my battery a lot, I don' really want a battery that's only 85 % charged. Hmm.
I've noticed the battery rarely seems to go above 99% (to 100%), so I wonder if having it stop at 99% and not keep charging for hours to get to 100% has some benefit.
Of course, I don't want my battery to have to run down to 30% before it starts charging either, in case I find myself in a situation where I need to run off of the battery. So I'm also wondering what benefit there is if it at least has to run down to 95% or 85%.
Or is there a better way to do this for my needs?
Re: Linux and Battery Charge Capacity
Just a heads up: that might not always disable the BT chipset. On my machine (X61s) it appears to disable Bluetooth, but not in a way that results in a power reduction. In order to *really* disable it, I have a script that brings down the interface with hciconfig, disables it via thinkpad_acpi and then unloads the modules from the kernel. Seems to work -- my power consumption drops using that method, whereas it doesn't if I just do the thinkpad_acpi trick above.Superego wrote: Regarding the bluetooth, there may be a similar option in BIOS but since I use bluetooth sometime I turn it on and off using ACPI. You can turn off power with the command:
Code: Select all
# Turn off echo "0" > /sys/devices/platform/thinkpad_acpi/bluetooth_enable #Turn on echo "1" > /sys/devices/platform/thinkpad_acpi/bluetooth_enable
YMMV though -- it's probably pretty hardware dependent as to whether or not you have the same issue I did.
Need help with Linux or FreeBSD? Catch me on IRC: I'm ThinkRob on FreeNode and EFnet.
Code: Select all
Current laptop: X1 Carbon 3
Current workstation: noneRe: Linux and Battery Charge Capacity
Please post this scripts for inspirationThinkRob wrote: Just a heads up: that might not always disable the BT chipset. On my machine (X61s) it appears to disable Bluetooth, but not in a way that results in a power reduction. In order to *really* disable it, I have a script that brings down the interface with hciconfig, disables it via thinkpad_acpi and then unloads the modules from the kernel. Seems to work -- my power consumption drops using that method, whereas it doesn't if I just do the thinkpad_acpi trick above.
Thanks,
Rasmus
PS: On my X60 I get around 6-7 hours when I have turned off wlan which is comparable to Windows.
Re: Linux and Battery Charge Capacity
Sorry, I just noticed this today.RasmusP wrote:Please post this scripts for inspiration
Here's my script (I put it in /etc/acpi/thinkpad-bluetooth.sh):
Code: Select all
#!/bin/bash
# we dont have /etc/init.d/bluetooth status, so we need a hack
fgrep "enabled" /proc/acpi/ibm/bluetooth &> /dev/null
if [[ $? -eq 0 ]]; then
# BT is on
hciconfig hci0 down; rmmod hci_usb
echo disable > /proc/acpi/ibm/bluetooth
# attempt to unload uhci_hcd if possible
rmmod uhci_hcd &> /dev/null
if [ $? -ne 0 ]; then
logger "Unable to unload uhci_hcd. Still in use?"
fi
killall osd_cat
echo "Bluetooth DISABLED" | osd_cat -d 2 -c green -s 2 --pos bottom -f "-adobe-helvetica-bold-r-normal-*-*-240-*-*-p-*-*-*" &
else
# bluetooth is off, so switch it on
# first load the modules
echo enable > /proc/acpi/ibm/bluetooth
# check if we need to load the USB 1.1 module
lsmod | fgrep "uhci_hcd" &> /dev/null
if [ $? -eq 1 ]; then
modprobe uhci_hcd
fi
modprobe hci_usb && sleep 1 && hciconfig hci0 up
killall osd_cat
echo "Bluetooth ENABLED" | osd_cat -d 2 -c green -s 2 --pos bottom -f "-adobe-helvetica-bold-r-normal-*-*-240-*-*-p-*-*-*" &
fi
Need help with Linux or FreeBSD? Catch me on IRC: I'm ThinkRob on FreeNode and EFnet.
Code: Select all
Current laptop: X1 Carbon 3
Current workstation: none-
- Similar Topics
- Replies
- Views
- Last post
-
-
T61 Battery Has Greater Remaining Capacity Than Design Capacity?
by olex126 » Mon Feb 20, 2017 3:15 pm » in Thinkpad - General HARDWARE/SOFTWARE questions - 5 Replies
- 1229 Views
-
Last post by olex126
Mon Feb 20, 2017 9:11 pm
-
-
-
Brand New Oem X230 Battery Losing Full Charge Capacity Fast!
by TheMagicT410 » Sat Feb 11, 2017 12:58 pm » in ThinkPad X230 and later Series - 5 Replies
- 826 Views
-
Last post by TheMagicT410
Sat Feb 25, 2017 3:04 pm
-
-
-
Battery capacity charts - updated January 2017 (*PICS*)
by dr_st » Tue Jan 10, 2017 4:16 pm » in GENERAL ThinkPad News/Comments & Questions - 27 Replies
- 1925 Views
-
Last post by Puppy
Sun Jan 22, 2017 5:48 am
-
-
- 3 Replies
- 265 Views
-
Last post by Temetka
Wed Apr 12, 2017 1:28 am
Who is online
Users browsing this forum: No registered users and 2 guests




