Feb 23

All laptop users have something in common: we want our device’s batteries to last longer. Whether it’s for the daily commute or the flight home for Christmas, an extra 30 minutes of power means an extra 30 minutes of entertainment. If you’re running a Linux-based distribution on your netbook, there’s a lot you can do to squeeze every last negatively charged ion from your power source. Here we’re going to cover the best techniques that we’ve discovered. Don’t worry if you’re not a netbook user, as much of this information can be used on Linux laptops too. However, we’ve specifically tailored our advice for netbooks as these seldom include full-blown distros (and hence any easy way of compiling and installing new software). We’re going to focus on Intel’s Moblin and Canonical’s UNR (Ubuntu Netbook Remix), two of the most popular Linux distributions for netbooks, but there’s absolutely no reason why you can’t use a full-fat distribution on your device and make the same changes to its power management.

You deserve to be able to drag every last tiny drop of power out of your laptop’s battery. It’s only fair.

Netbook Linux is still in its infancy. This means that there’s still a great deal that can be done to make these devices more power efficient, and each release of distributions like Moblin or UNR gets better at it. But it also means that hardware compatibility and power saving is experimental for each distribution, especially when you’ve installed it yourself. Until netbook distributions are built for specific netbooks, though, there’s always something you can change in a generic installation to make it work better on your own machine. We’re not talking about massive improvements, but each incremental change may stretch your battery life by around five per cent. Even if just one or two of them work out, you’ll see some extra life from your machine. Like most things to do with Linux, it just takes a little trial and error.

The easy targets

Sometimes it’s the most predictable power saving options that can reap the biggest benefits. Wireless and Bluetooth are our first targets. Even when you’re not using these connections, the radio device tucked away within your machine is still expending energy, either keeping a connection in contention or looking for new networks and devices for you to connect to. Both Moblin and UNR allow you to disable these devices from the desktop, but these options won’t necessarily completely disable the radio. The best option is to use a hotkey combination that’s dedicated to your devices. These are usually labelled in blue across the laptop’s keyboard, and typically involve you having to press the [Fn] key in conjunction with a number. The number key will normally feature a somewhat ambiguous icon that you’ll need to decode in order to figure out which number is the correct one. If you’re lucky, you’ll also see an on-screen message updating you on any progress once you’ve pressed the key.

However, some netbooks don’t have function keys to disable the wireless or Bluetooth radios, and you can’t take any chances with the software disable function. Samsung’s popular NC10 is one example of a machine that doesn’t have a keypress option. In these cases, your only course of action is to change a setting in your netbook’s BIOS – a setting that will stay fixed until you restart your machine and manually undo the change.

It might sound obvious, but switching off your laptop’s internal radios can give a significant boost to battery life.

Like many desktop machines, you can normally enter your netbook’s BIOS by quickly pressing [F2], although like the hotkeys, this is dependent on your manufacturer (as is what you can and can’t turn off within the BIOS). With the NC10, for instance, you can switch your wireless devices to ‘Always Off’ from the Boot menu within the BIOS. While you’re there, you might also want to disable the ‘Internal LAN’ setting in the Advanced menu, as the Ethernet port can steal power even while not being used. You should also make sure that any power saving modes for your device are enabled.

Screen brightness

Dimming the screen is a great way of saving some power, but this can sometimes be problematic with certain netbooks running a Linux distribution. This is because the hotkey combination may not work from the desktop, and the software isn’t always capable of changing brightness either. The Linux kernel needs to have support for your specific device. If it does, the distribution you use also needs to use the correct version of the kernel and provide a means of changing the brightness. If this isn’t the case, you might still be able to adjust the brightness of your screen from the command line.

The trick is to use a special kind of file that accesses your display hardware. As with most devices, this can be found by typing ls /sys/class/backlight/. If you’ve not encountered the ‘/sys’ series of directories before, it contains dozens of folders and files that refer to each of the devices on your system. Rather than representing the files and folders on a storage device, this structure is a portal for configuring any plug-and-play hardware discovered on your system, and that includes devices like your netbook’s screen, CPU and drive.

To change values in the /sys tree, you will need to switch to the administrator’s account on your machine. Ubuntu users won’t be able to use sudo in the way they might be used to because the command to change values is really two commands, one piping output to another. The sudo privileges will only apply to the first and won’t stretch to allow you to change the parameter in the second. You can get around this by launching a new bash session using sudo, which will start a pseudo-administrator mode where every subsequent command is executed with root privileges. Moblin users just need to type su followed by their root password to get the same thing.

The contents of ‘/sys/class/backlight/’ should look something like ‘acpi_video0’, but this is dependent on the kernel driver for your hardware. Beneath this directory, you’ll find a special type of file called ‘brightness’. If you probe the value of this file by typing cat acpi_video0/brightness, for instance, you’ll see the current brightness setting for your screen. This is usually within the range of 0 to 100, and may jump up in steps that are defined by your hardware’s capabilities. The converse of this probe operation is to pass a value to this special file, hopefully changing your screen brightness in the process. Typing echo 100 > acpi_video0/brightness, for example, will configure maximum brightness, while a value in the region of 15 should be close to your screen’s minimum.

CPU optimisation

We’re going to stick within the /sys subsystem to make a few changes to how the CPU is handled. This can be a rather experimental area to play around with, which may explain why many distributions choose not to enable some of the more optimal modes, but it can be worth the trial and error. It’s also dependent on the features embedded within your CPU. Recent models built around Intel’s newer Atom processors shouldn’t have any problems, but older models may not be so flexible. You should also make sure you’ve got a backup of any critical data on your netbook’s drive before trying things out.

The most important parameter can be discovered by typing cat /proc/sys/vm/laptop_mode. If your machine returns a value of 0, then Laptop mode is currently disabled. You can enable it by typing echo 1 > /proc/sys/vm/laptop_mode. When Laptop mode is enabled, the kernel takes special care only to shuttle data to your storage device when it needs to, saving your battery in the process. You can disable this by swapping the 1 for a 0 in the previous command.

You can get even deeper into how the processor handles tasks by changing how the scheduler works. This is only going to be beneficial if you’ve got a multicore machine, and it changes the way processes are loaded onto each core. Check the contents of the ‘/sys/devices/system/cpu/sched_mc_power_savings’ location. If this is set to 0, your netbook is configured for optimal CPU performance – which is useful for mathematically intensive apps, but not so great if you’re only planning to read a couple of emails. Changing this value to 1 will ask the scheduler to use the threads and processes more efficiently before more are created, effectively saving your other CPU cores from being used and saving energy in the process.

Process pruning

The best thing about a netbook distro is that it is already pruned down to the bare minimum of applications and running processes. There should be very little you can do to improve things here, but there’s never any harm in taking a look. The quickest and easiest way of checking what processes are running is to run the ‘top’ command from the command line. It may look a little perfunctory, but it tells you everything you need to know. It’s called top because it shows you a list of the processes sorted by CPU time, with the highest at the top. This list changes dynamically, and the processes at the top usually include top itself, the Xorg X-Server (which is rendering the graphics on the screen) and maybe the gnome terminal (if this is how you’re running top). You can also remove processes and change their priority, but you need to be careful about this as you could seriously affect the performance of your netbook (and even lose some of your data). The safest option is to look for tasks that are running under your user account: you should be able to see your name in the second column for any tasks falling into that category.

On Moblin 2.0, for instance, we’ve noticed that the Nautilus file manager is used to manage external storage such as USB sticks. Occasionally, especially when you remove a USB stick without first unmounting it, Nautilus is left running, taking up precious CPU cycles. You’ll even be able to see that it’s the process connected to the USB device because this path follows the name of the process. You can remove tasks by pressing [K] to enter Kill mode and then entering the process number. This is listed in the top output below the top line. If you’re running a standard Linux installation, then there are a great number of processes you might want to consider removing. These could include indexing routines, compositing managers, background servers and log file generation. Further information can be found by looking at how the ‘initd’ process works and working out how to disable these services at bootup.

Monitor process power consumption

One of the best tools for monitoring and tweaking your system’s power efficiency is called PowerTop. It’s the electrical power consumption equivalent to the ‘top’ command we used to measure CPU usage, and it should be available through your distribution’s package manager. Moblin users can find it by searching for ‘Power consumption monitor’ in the Add/Remove Software panel. It needs to be run from the command line with system administrator privileges, which means typing sudo powertop for Ubuntu users or su followed by powertop for Moblin.

PowerTop can give you a very accurate indication of how long your netbook will last with its current power usage.

It will take five seconds for the tool to initially monitor your current system, after which it will list the various offending tasks running on your system sorted according to the amount of power they consume. The top section of the tool displays the percentage of time your CPU spends running at a specific speed. More CPU-intensive tasks will switch to a faster power state, which will in turn take more electricity. Ideally, you should expect to spend most of your time in the C4 state (the slowest), with occasional bursts of activity in the fastest state, C1.

PowerTop was originally designed to show which tasks were preventing laptops from entering a sleep state, and it’s still useful for this kind of bug fixing (though hopefully your distro builder has already solved the most serious offenders). This is why you still see the processes listed as ‘Top causes for wakeup’, as these are the events that are interrupting the system.

Unlike nearly every other tool we can think of, PowerTop also displays some useful information that can help you stretch out your netbook’s battery life. If it detects anything that it knows will help, a suggestion will pop up at the bottom of the window. Your adjustment will last for the duration of the current session only, but the tips that PowerTop displays often include instructions on how to make each change more permanent.

Proper sleep function

Suspending your machine by closing the lid and then opening it again seldom has the desired effect with Linux. It’s often easier to just turn the machine off and on again. Things are a lot better than they were, but hibernation is one area of the kernel that remains problematic. The difficulty is that each piece of hardware within your system needs to respond predictably to the sleep call, and this requires well-behaved drivers that have a good understanding of their hardware capabilities.

Unfortunately, this can’t be said for many Linux device drivers – in particular those for graphics cards. The only exception is hardware developed by Intel. Intel has made a big investment in Linux, and it continues to make massive improvements to the drivers for its own hardware. The Moblin distribution is the pinnacle of this work, and you should find that sleep works well with most Atom-based machines, as well as those that use other kinds of Intel processors. If you need to cater for hardware from other manufacturers, the best piece of advice we can give you is to make sure that your kernel is as up to date as possible. Things are changing all the time in the Linux world, and you may find that any problems have already been fixed with a kernel update.

Nov 30

Finland is pretty cool. There, I’ve said it. I’ve never been there, of course. Goodness, no. I’ve always been put off by the biting perma-winter which apparently shrouds our Scandinavian cousin, and having spoken to a tiny portion of its apparently miserable population I think I’d struggle to keep my over-stimulated mind entertained. But at least Finland has the internet – by law, no less. A recent ruling has made it a legal requirement for citizens to have access to the internet. Finland, for all its frigid horror, has seen what I see: the internet is a necessary service, like water, electricity or the phone. I certainly use the internet far more than I use the telephone. Heck, I use it more than I use water. If I could occasionally wash myself with the internet, Wessex Water would see its revenue drop to the tune of one household.

I have had an all-but-permanent connection to the internet since I ran up my first £250 monthly bill – communicating with depressed Finnish girls in chatrooms, no less – nearly 15 years ago. Instant connection to information isn’t just something I hold dear, it is something I have come to rely upon as an extension of myself. My brain has long since given up actually remembering facts on its own. It has forgotten how. That’s what Google is for, after all.

My inability to think for myself  (and the spiffing job I’ve done of covering it up for the past six years) means I’m rather scared about my impending honeymoon, in which myself and my new wife will whisk ourselves away to Florida for a fortnight. Off the grid for two long weeks? It doesn’t bear thinking about. If I don’t have the internet I shall be exposed as a fact-free dullard rather than a man who can divine Jon Bon Jovi’s age (he’s a spritely 47) within seconds, or unearth obscure facts about honey bees (there are 44 varieties, you know) on demand.

I can only presume that the state fondly referred to as ‘America’s Wang’ – which as far as I can see is nothing more than an alligator-infested marsh turned commercial cartoon playground – is in fact an internet wasteland. I have had no confirmation that our accommodation will be internet-enabled, for instance. And I have never once, at least as far as I can recall, communicated with a Floridian in a chatroom. I have seen no evidence that Mickey Mouse has an Ethernet port installed in his backside so that I may download podcasts and check the weather while the other half gives him a nice hug. Captain Jack Sparrow has no doubt amassed a stash of purloined iPhones, but I doubt he’d let me use them. You get the idea.

Besides, do retirees and theme park visitors really need to go online? Surely they’re all in a state of humid brainwashing, shuffling like zombies and purchasing nick-nacks supplied by the Disney Corporation? This hopeless feeling is a new one for me. On every international excursion I have made on behalf of PC Plus I have had a paid-for internet connection in my hotel room, ostensibly for work but realistically for the good of my mental health. I have managed to find some sort of connection on every UK holiday I’ve made; even clunky WAP surfing on my ancient mobile phone did the trick. When I’m dropped off in the land of the free, I expect no such luxury. Perhaps I will find the occasional stream of bits when suckling at Ronald McDonald’s meaty bosom, or visiting with Lord Starbucks. But that’s a vague hope at best. The internet ought to be universal by now, but I really don’t think it will be. Wish me luck, reader, for I am about to be exposed like never before.

Jan 28

Writen by Steve Valentino

The electricity that flows in two ways, AC or alternating current and DC or direct current, is actually a movement of electrons along the conductor. The difference of the two lies in the direction, wherein the former keeps the moving electrons in a switching manner, while the latter is in a steady single track. The AC system of the power supply is utilized for transmitting long distance power to various power companies. Therefore, high voltages are needed to fill the transformers of those companies. DC power supplies, on the other hand, provide current on a small-scale basis.

The direct way of supplying a current is typically found in the form of a battery or batteries, in which positive and negative terminals are moving in a single direction. DC power supplies are used in various mechanisms such as car audio equipment, DC-powered radios, mobile phones and a whole lot more. In the competitive market, there are all different kinds of DC power supplies in different wattages and voltages. The specifications of each DC power supply that you will find will vary depending on what the battery is used for.

DC power supply is already an indispensable and ubiquitous component in our everyday life. It provides power to almost all of the portable electronic gadgets that we use such as our laptops, cellular phones, handheld computers and MP3 players. Make sure that the DC power supply that you purchase meets the specification of the equipment you need it for. If you use the wrong power supply, you just may damage your equipment.

Power Supplies provides detailed information on Power Supplies, What Power Supply Do I Need?, Uninterruptible Power Supplies, DC Power Supplies and more. Power Supplies is affiliated with Welding Inverters.