Problem: Automatic Reboot after Shutdown (Ubuntu 11.10)

On my Thinkpad x220  when I am running on battery under Ubuntu 11.10 and I do a normal shutdown, the system shuts down correctly, but it reboots after 1 sec. This only happens when i am on battery.

I found that it is related to the module e1000e, for example when i do

sudo rmmod e1000e

before the shutdown no automatic reboot is done.

Battery Life on Thinkpad x220 (i7) running Ubuntu 11.10

To get the same battery life running Linux and Windows is still a challenge. Especially for ThinkPads, as Lenovo Engineers seems to magically tweak the drivers to use less power in Windows and get a fantastic battery life(Windows only). For Linux users, power usage has never been excellent out of the box and extra tuning is necessary to double the out-of-the-box battery life. I get more than 12 hours for Ubuntu 11.10 with the 9-cell battery, the power usage in Idle State is around 7.5W.

Installation of Ubuntu on my new Thinkpad x220 i7 was a no brainer, as we know it from Ubuntu and it seems that installing an OS has never been so easy and fast. Every thing seems to be working out of the box, but looking closer there are some things that needs to be tweaked. As notes to myself, I am writing about how I fixed these problems in a series of posts.

The first thing that needs to be tuned is battery life. Under Windows7 I get with pre-installed settings about 10-11 hours of runtime. The conditions were brightness set to 20% with ethernet in use. Under Ubuntu 11.10 out of the box I got around 4-5 hours, and that is quite a difference with some room to optimization.

To get started I installed powertop, a command line tool to show which part drains the battery. To install just call in command line:

user@computer:$ sudo apt-get install powertop

and then run it from command line with

user@computer:$ sudo powertop

You have 5 tabs (change with direction keys).

powertop tunables

On the overview tab you see how many Watts are being used now. My goal here is to go below 9W for light work and 7.5W for idling. Change to the tab Tunables, where you see everything that powertop thinks can be tuned (tagged with BAD). Use the direction keys to select those and with Enter-key toggle them, so they say GOOD. For me powertop was not able to scroll so you should make your terminal size to full-screen to see all available options.

On the overview tab of powertop you can observe which hard- or software parts are draining your energy. As usual the rule is turn off everything that you don’t need.

Then there has been a problem with recent Linux kernels with modern processors. For my Thinkpad x220 I added the following boot parameters to grub

pcie_aspm=force i915.i915_enable_rc6=1 i915.lvds_downclock=1 i915.i915_enable_fbc=1

Test them first by adding them on a normal boot process in grub (press e to edit boot parameters, see here). If this works for you then add them permanently to grub, by editing /etc/default/grub. (after editing you have to call update-grub once).

Finally I get idling around 7W usage and working on ethernet (wireless should be about the same) 9-10W. This gives me a battery life time of 10

Apple vs AppleADay

There is a small restaurant in Luxembourg City called appleaday. I would say there are about 20 chairs in this restaurant. Find more Images here. Started by three young motivated people the restaurant has recently been “attacked” by Apple Inc. Why?, Because of the name “appleaday” vs. “apple” and in a second place beacause of the Logo.(see here) They also use an apple as logo (but from the abstract image it could also be an orange, or peach,….)

Apple Inc do you really think that people are that stupid that they cannot differantiate between Apple (computers, Phones, Software,…) and a small Restaurant having nothing in common except 5 letters in the name? Because of this lawsuite the restaurant is risking to go bankrupt.

Go support either of those parties…buy a new iPhone, or, go and have lunch at appleaday.

UPDATE: The law suite lasts for over 9 months already, and it got feature in local news on 2011/11/03. (in french) here, older

Grails using Tag in Controller or Service (remoteLink,…)

The GRAILS tags like remoteLink can easily be used inside a view (GSP) by using

<g:remoteLink controller="book" action="show" id="1" update="content">MyBook</g:remoteLink>

However, if you need to use any tag like remoteLink outside of a view, for example in a controller or service make sure to inject grailsApplication first

def grailsApplication

and then you can use the following call to get the link (in this case) as String

g.remoteLink(action:'show', controller:'book', id: '1', update:'content' ){MyBook}

Youtube 2.1.6 on Android 2.2.1

After upgrade to Android version 2.2.1 on my Samsung Galaxy S, the YouTube application started to behave in a strange way. When I want to play a video I get the message “There was a problem while playing. Touch to retry”. Of course I touched multiple times to retry, but no success. I tried re-installing the application, and still no success. I googled the problem but found no solution.

Then the simple solution to the problem is to reboot your phone. For me at least it works. When the bug occurs, I reboot and the YouTube apps plays videos. At the same time I noticed that when the bug occurs, several music files (mp3?) don’t play. So if you encounter such a problem: “Try turning it on and off again!”

Browser Memory Usage

In a previous post I compared the latest browsers for Ubuntu and I used htop to find out the memory usage of the browsers.  Today I find that there is a nice build-in function in Chromium that shows you the memory usage for all running browsers.(Chromium, Firefox and Opera)

Just type about:memory into the address bar in Chromium and you will see on top of the page the memory usage for the open browsers. Find out on more about pages here.

About Memory - Chromium

Chromium About: pages

Chromium has some nice integrated About: pages. There are some apges for plugins, memory usage, network, cache,….

about:memory Gives the Memory usage of Chromium and other browsers
about:cache Shows all elements in Browser cache
about:dns Shows all stored DNS entries/data
about:net-internals Shows network usage and network events, DNS, Sockets, Proxy configurations
about:credits Shows credits
about:histograms Shows overview of performance
about:plugins Shows overview of Plugins like Flash, Quicktime, VLC