Comparing Kernel Dmesgs: Remove Timing Info and Diff Side by Side

I often wanted to compare what new messages appear or disappear in a new kernel so check out what might have changed, esp. when debugging. The problem is that diff is confused by the timing information that is by default prepended to dmesg information in Ubuntu kernels.

Here's how to remove the timing information to have a clean, diff-compatible dmesg log:
sed 's/^...............//'
The command basically removes the first (number of dots ".") characters of every line.

Then you can use diff to compare the dmesg files side by side:
diff -y -w -B --suppress-common-lines dmesg-A dmesg-B
Of course this is still not magic, but at least now diff can filter out a lot of similarities for you.

Standby-Strom des Edision Avantage DVB-T Receiver - Energiespar-Tipps

Ich habe gerade mal ein bisschen rumprobiert, um zu sehen wieviel das Teil an Standby-Strom verbraucht. Normal, ohne USB oder SD-Karte, verbraucht es recht gute 1,5 Watt (Conrad Voltkraft 3000 Energy Meter, ist recht exakt, Herstellerangabe < 2 Watt). Mit USB-Festplatte, die offenbar nicht ausgeht: 3,5 Watt.

Normal:    1,5 Watt
Stick:        1,5 Watt
USB-HD:  3,5 Watt
SDHC:      4,4 Watt

Es empfiehlt sich also aus Stromkostengründen einen USB-Stick dafür zu kaufen und keine Festplatte, auch wenn letztere weniger Kostet pro MB. Sonst zahlt man das Geld über die Stromkosten wieder zurück (1 Watt sind bei 22 cent pro kWh ca 2 € im Jahr). Auf jeden Fall sollte man auf eine SDHC verzichten, die jährlich ca. 6 € an Strom zusätzlich kosten würde. Wenn man ihn vom Strom trennt, spart man ca. 3 € pro Jahr, muss dann aber natürlich auf zeitgesteuerte Videoaufnahmen verzichten.

Insgesamt bin ich mit dem Gerät sehr zufrieden, vor allem für den günstigen Preis. Es lohnt aber, noch in einen möglichst kleinen/kurzen USB-Stick (da nur vorderseitiger USB-Anschluss) und ein besseres SCART-Kabel zu investieren (das mitgelieferte macht ein sehr schlechtes Bild!).

Die Videorekorderfunktion mit Timer muss ich noch testen. Sofortaufnahme und "Pause", also "Time Shifting", haben bereits gut funktioniert.

Fast, Cheap, Reliable VPN for Linux

I did some research into VPN services because even if I'm not in the US or UK for a while I don't want to be prevented from accessing certain websites there and signing up for services there.

You can sign up to the PureVPN shared IP services here. I have good experience (hulu with maximum quality streaming, iplayer work fine) with the cheapest version.

I recommend chosing the Monthly or Quarterly plan for tests ($14), but there is a three day test account ($3) available as well. It seems there is a bandwith limit now, and without you pay more.

Payment processing can take a few hours so be aware you can't start you fun and tests directly. Settings for network manager (gnome) can be found here. It works fine for me after installing network-manager-pptp-kde. Let me know in the comments if you need help. The most important part is to deselect everything in that one list except CHAP in the advanced settings and dselect MPPE. You can also try the nm-applet from Gnome, which you can of course also use in KDE. In my experience it often works better than the KDE version anyway unfortunately.

You may run into problems if your router doesn't support pptp forwarding. Then you either get a better router, or - in the long term probably the cheaper and better option for your speed - get a better router.

By signing up via a link from this blog you support the author.

The Story of the VP8 Encoder and Decoder

An x264 developer blogs about the work on writing a decoder for ffmpeg and how the code is not really perfect and the spec not really existing:

For example, Google’s decoder will, if told to “swap the ALT and GOLDEN reference frames”, overwrite both with GOLDEN, because it first sets GOLDEN = ALT, and then sets ALT = GOLDEN. Is this a bug? Or is this how it’s supposed to work? It’s hard to tell — there isn’t a spec to say so.
-- x264dev

Interesting to see the story of the great new universally accepted web video codec from his view. I bet developers at Firefox, Opera, and last but not least Google think similarly...

Check the Strength of your Passwords

There's a great new website which tells you roughly how long it would take
to brute force crack your passwords, giving you a good indication of how
good your passwords are. Of course you should not input any of your real
passwords for security reasons, but you can just replace any small
character with any other and any special character with any other to get a
good idea of how long it would take. It's just a rough calculation.

http://www.hammerofgod.com/passwordcheck.aspx

Increase Speed and Save Traffic with Opera Turbo

If you have a traffic limitation I have some great advice: Install Opera.
Starting with Opera 10, there is the integrated "Opera Turbo". With the
help of that proxy you not only speed up the loading of websites by 4x and
more, but you also decrease the amount of data transfered, which makes
your volume last much longer.

After a whole day of 3G web surfing, Opera Turbo had saved me 2 GB of
traffic! (Only about 100 MB were left, that 20x less!) So the first thing
after setting up 3G should be setting up Opera with Opera Turbo!

Oh and you'll probably also want to put this list into your Opera urlfilter.ini. This stops Opera from loading ads, saving you even more traffic. But you can't use save as, you must use copy & paste to get rid of the html elements in the file.

Mobile Internet with the Skypephone S2 in Ubuntu

It does not (yet) work out of the box. There is a little trick you need. You need to manually load the usbserial module supplying the vendor and product ID. You can find those IDs via the lsusb command. Just add an 0x at the beginning and then load the module:

sudo modprobe usbserial vendor=0x1614 product=0x0407

The support should be automatic in one the next upcoming Linux kernels, though. You can of course automate the module load with an entry in /etc/modules:
usbserial vendor=0x1614 product=0x0407

Then the module is always loaded in the right way at boot time and you just need to plug in the mobile phone for it to pop up in Network Manager (with the help of Mobile Manager). Once that's the case in Gnome with nm-util you can use an easy wizard that should already include your settings. In Kubuntu 9.10 the KDE support for connecting was broken, though. But it's fixed now in Kubuntu 10.04. Too sad many of these changes are never backported...

And now: Enjoy mobile Internet! (And don't miss my next entry on how to save traffic and speed up your new mobile internet.)

If you're in the UK, order your next Three SIM via my agent link, please.

Backlight Finally Works - Generic Poulsbo GMA 500 Fix via ACPI Video Interface

The trick is to go into drivers/acpi/video.c and remove the part that disables the acpi handling if there is an intel opregion present. The patch looks like this:
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 60ea984..ad8fc2d 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -2394,9 +2394,6 @@ static int __init acpi_video_init(void)
{
dmi_check_system(video_dmi_table);

- if (intel_opregion_present())
- return 0;
-
return acpi_video_register();
}

You can compile the module by getting the sources of your running kernel, cding into the acpi directory (drivers/acpi), applying the acpi patch and then executing
make -C /lib/modules/$(uname -r)/build M=$PWD video.ko

Then just sudo insmod ./video.ko.

Alright, here's the more elaborate version by Joey Lee hopefully entering the kernel soon:
---
drivers/acpi/video.c | 17 ++++++++++++++++-
include/linux/pci_ids.h | 1 +
2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 9865d46..25a70e0 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -88,6 +88,11 @@ static int acpi_video_bus_add(struct acpi_device *device);
static int acpi_video_bus_remove(struct acpi_device *device, int type);
static void acpi_video_bus_notify(struct acpi_device *device, u32 event);

+static const struct pci_device_id intel_drm_blacklist[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_VGA) },
+ { } /* Terminating entry */
+};
+
static const struct acpi_device_id video_device_ids[] = {
{ACPI_VIDEO_HID, 0},
{"", 0},
@@ -2531,8 +2536,11 @@ static int __init intel_opregion_present(void)
#if defined(CONFIG_DRM_I915) || defined(CONFIG_DRM_I915_MODULE)
struct pci_dev *dev = NULL;
u32 address;
+ int i;
+ bool in_blacklist;

for_each_pci_dev(dev) {
+ in_blacklist = 0;
if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
continue;
if (dev->vendor != PCI_VENDOR_ID_INTEL)
@@ -2540,7 +2548,14 @@ static int __init intel_opregion_present(void)
pci_read_config_dword(dev, 0xfc, &address);
if (!address)
continue;
- return 1;
+ for (i = 0; intel_drm_blacklist[i].device != 0; i++) {
+ if (dev->device == intel_drm_blacklist[i].device) {
+ in_blacklist = 1;
+ break;
+ }
+ }
+ if (!in_blacklist)
+ return 1;
}
#endif
return 0;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 3bedcc1..78858b1 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2669,6 +2669,7 @@
#define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0
#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2
#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601
+#define PCI_DEVICE_ID_INTEL_SCH_VGA 0x8108
#define PCI_DEVICE_ID_INTEL_SCH_LPC 0x8119
#define PCI_DEVICE_ID_INTEL_SCH_IDE 0x811a
#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4
--
1.6.0.2

Quick Fix for Your Multimedia Keys

If your multimedia keys give this warning in dmesg:
atkbd.c: Unknown key pressed (translated set 2, code 0xf7 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e077 ' to make it known.
then you need to look up the right number in include/linux/input.h e.g.here. E.g.
#define KEY_BRIGHTNESSDOWN 224
#define KEY_BRIGHTNESSUP 225
And use that number with setkeycodes, e.g. for my system:
setkeycodes e077 224 # brightness down
setkeycodes e078 225 # brightness up
setkeycodes 0xee 212 # webcam
setkeycodes 0xe4 240 # touchpad -> unknown
setkeycodes e076 238 # wifi + bluetooth
And now your system (e.g. KDE or Gnome) should immediately recognize the keys. Post the information to your distribution and it should be included in future releases. Just write the commands (without sudo) into /etc/rc.local to make them permanent for now.

If you get stuck, here's a good guide.

What Linux means for the Consumer - Drivers, Open Source and Support

When a consumer installs a Linux system, this has various consequences for him, which are sometimes hard to estimate at first. I've written a little summary touching the differences to Windows and Mac OS X in drivers, open source and support.

Drivers
Linux is not yet as far spread as Operating Systems like Windows or Mac OS X. This means that hardware corporations which have little money or skilled staff usually don't publish their own Linux driver and ship it along with the hardware when you buy it. In short: There currently is usually no driver disk for Linux.

But that's not really as a big a problem as it seems at first. One point is that - especially if the poor or skill lacking company is smart and publishes detailed product specifications - drivers are often written by the community. This has the disadvantage that it takes longer and when a device is first release, there is not usually no driver ready yet.

But it also has several advantages: Once drivers are written, they are usually open source. For the advantages, see below in my next point. And the drivers eventually are often better and more extensive than the drivers delivered by the hardware manufacturer. E.g. the bttv drivers of my TV card worked much better and longer than their Windows counterparts. And there was even an additional driver not present in Windows for a sound chip on the TV card to digitalize TV and line input sound up to a rate of 192 Khz -- for a TV card produced in 199X! My current sound card - using the snd-hda-intel driver - for some reason has a significantly better sound in Linux than in Windows, where it pretty much lacks any bass.

A huge advantage is the common API of drivers. In Windows every manufacturer writes his own drivers with their own API, and their own software to use the API. E.g. A DVB-T digital TV card has a Windows driver, and a special decoding and recording software for each and every single card. Sometimes the main chip and driver comes from the same manufacturer for several cards. But it's still often difficult if possible at all to use another software than the one supplied by the manufacturer.

In Linux, there is a common DVB interface. This means you can not only use the same software for all DVB-T receivers, you can even often use the same for DVB-T(errestrial), DVB-S(atellite), and DVB-C(abel). And it makes perfect sense that instead of tens of quickly written (and often buggy) different applications for different cards, you have a selection of a few really good programs. (E.g. Tvtime and others for analog, Kaffeine and others for digital reception -- and I mean for all supported ones).

In Windows, if there is a new group of popular hardware, like WIFI or Digital TV adapters, you need to wait for Microsoft to release a common API and hope they do. That's likely to happen only in the next Windows Version (e.g. XP, Vista). And then everything must be backwards compatible. This means that a better API might not be introduced for Windows XP ever, and advantages for new APIs are restricted by the requirement that all old APIs have to still work exactly the way they did. With open source drivers in the kernel tree, you can just modify the drivers along with the API. It's all in the same place and some changes are simply a matter of "search and replace".

Once a good open source driver exists, and especially if it gets integrated into one of the main driver projects, it usually works out of the box. This means you start Linux, even from a Live CD, and the hardware, e.g. a sound card, scanner or TV card just immediatelly works without any fuss like driver installation or configuration. It's not like installing Windows and then downloading the drivers for all your software, but if the driver is well supported, it just all works after installing the sytem. That's why Live CDs are so useful to test the Linux compatibility of a computer's hardware. And another great thing is that these integrated drivers are automatically updated for you - for Ubuntu even without the need to reboot (for other distributions you need to pay for this feature). This prevents security risks, which are much more rare in Linux, anyway.

Open Source
Open Source is a guarantee that a good product can have a long life-time. Drivers are one excellent example. If you have an open source driver, and it's of good quality and integrated into the Linux kernel or one of the main user land driver projects (SANE, CUPS, ALSA), you will have a driver for a very, very long time. This means that unlike with Microsoft and Mac OS X systems, you will not need to buy a new scanner, because you can't find a driver for Windows 7 or the "Snow Leopard", but quite the contrary the driver usually gets better and better and you often have no problems whatsoever with using a 10 years or older scanner, printer, sound card, TV card, etc with the newest Windows version.

My DVB-T adapter has lots of features it lacks in Windows, including recording up to 4 channels in one bouquet at once, 50 fps deinterlacing, hardware accelerated video decoding, automatic scheduled recording, etc. I just got a new sound card, which uses a lot less CPU and doesn't have a few of the Windows issues like skipping and beeping during playback. Even the pretty new Intel poulsbo chipset already works better for me in Linux now than in Windows (lower battery consumption, better video scaling and hardware accelerated video playback, much faster resume from suspend (feels like 1 second max, dmesg says 2.5 seconds; Windows takes a felt 4-15 seconds), ...). Thanks to Linux my Netbook is now a full featured surround sound FullHD video center and it consumes even less battery than in Windows.

But open source also means that things are customizable. This would of course also mean that if you can program yourself you can potentially modify and fix as many issues with software and drivers as your skills permit. And this is one of the main driving forces of Open Source. But it also means that if there is a problem, the fix can be applied where it makes the most sense. Let's make another example in comparison to Windows.

In Windows if there is a bug in the suspend to ram mechanism, which causes problems for a certain hardware, this is quite hard to figure out in the first place. Because you don't know how the Windows mechanism works. If it was publicly known, Linux would have a much easier way with ensuring suspend to ram compatibility for more hardware. Once you figure out where the problem is in Windows, you still have no way of fixing the problem where it occurs.

Because you can't modify any Windows components. That's completely different in Linux - here anyone can modify anything. I once wrote a small Linux kernel patch myself, and I'm really not that much of a programmer. But with the help of some kernel developers I fixed my own problem and then posted my first Linux kernel patch.

Another great example is powertop. It's a tool to check what decreases your battery time in Linux by looking into which applications wake up your CPU from power saving modes and how often. For this to work the kernel had to be modified. Once this was done you could find out which programs are the main cause. And then, because they are also usually open source, you could modify them as well so they don't wake up the processor as often. And that's how my netbook now consumes less power - in some scenarious a lot less - in Linux than in Windows. All this would not be possible in a closed source world. The same is now done for latency with latencytop btw.

Support
The disadvantage with support in Linux and Open Source is that if you don't pay for it, you won't get people who will treat you like you paid for it. This means it's very un-wise to contact driver or other software developers and say: "You've got to fix this!" Because they really, really don't have to. They are in no way obligated to you. You should always remember that. Only some people get paid for their work for open source at all. Many start a project and keep working it to scrach and itch (see here, and here). And I think it's how Linus started the Linux kernel project sometime long ago. If you want support that treats you like you've paid for it - get paid support!

But the big advantage in Linux support is that if you have a clue, you have access to incredibly smart people. You can talk directly to the developers and they usually know their stuff really, really well. Yes it can be a problem to get an answer sometimes, but if you've read the manual, you really know what you're doing, keep in mind that you didn't pay them and appropriately contact them very politely, you will be amazed how much is possible.

I still remember how helpful, friendly and patient the KDE plasma developers were when I wrote my first plasma-applet. I remember how the Linux kernel developers take every issue seriously and try to help you find the problem, especially with regressions.

And in my view it's so incredibly much better than most hardware manufacturers who you pay with buying their products to get support. You usually first get stuck with incompetent telephone support and are really lucky if you ever get to contact the driver developers or someone anywhere near them. And then those driver developers usually get their money for writing bleeding edge new drivers for new hardware, or they need to write a driver that's compatible with the newest Windows release (without really knowing how everything works on the Windows side).

They usually have little patience and understanding for a not working driver in some system and say that your supplier should fix the issues. (E.g. NVIDIA would say the graphics card manufacturer should fix the problem and Intel would say your Notebook manufacturer should deal with the problems.) But open source developers will usually understand you well, because that's often why they wrote the driver in the first place, so as many people can use it without problems as possible. Here the problem is usually not the lack of will, but of your politeness, your and their time and other resources.

Conclusion
You have to ensure that hardware is Linux compatible before you buy it. If you're lucky and you find open source driver integrated into the Linux kernel or one of the main driver projects, you are most likely to be able to really enjoy your hardware in Linux for a very, very, very long time and there will be no need miss out on the newest features and software coming for free with the newest release of your favorite distribution. If something doesn't work you're expected to do your part and google and try everything you can to fix it, including postings in a forum and on a user mailing list before contacting the developers. This way they have more time for and fun with actually fixing the problem.

But it also means that for not paying for Windows and the drivers, you can't expect the same support. If you want the same level of support, try offering money to the developers you want the support from (paypal helps) or buy a support service. I'm sure they're much more likely to help you in a way similar or better than Windows then.

I'm happy about your thoughts and comments. And remember I don't get paid for writing this either - as you can't even see ads on this page.

All trademarks belong to their respective owners, not to me.
(Windows, Windows XP and Windows Vista->Microsoft, Mac OS X -> Apple, Linux to Linus Torvalds etc.).

Backlight Control on MSI U110 Netbook

I've managed to get the backlight working roughly as well! All I needed to do was to load msi-laptop with the parameter force=1. The problem is that there is so far very little scaling, I can only set brightness to 0 (very dark) or 1-8 (all "very bright"). Check for updates to get it working well with KDE.

I've contacted the driver developers and I hope we can make some progress on the drivers soon.

Setting Up VAAPI Hardware Accelerated Video Decoding for Ubuntu 10.04 (example Intel Poulsbo GMA 500)

(For the more detailed guide for Ubuntu 9.10, which works much better for me, including suspend to ram, see here.)
This is just a really, really short basic howto for setting up the poulsbo X driver and VAAPI video acceleration on Ubuntu 10.04. I will post more details later.

1. Install the poulsbo driver:
sudo add-apt-repository ppa:gma500/ppa
sudo add-apt-repository ppa:gma500/fix
sudo apt-get update
sudo apt-get install poulsbo-driver-3d

2. Set up the Xorg.conf:
Section "DRI"
Mode 0666
EndSection

Section "Device"
Identifier "GMA500"
Option "AccelMethod" "EXA"
Option "DRI" "on"
Option "MigrationHeuristic" "greedy"
Option "IgnoreACPI" "yes"
Driver "psb"
EndSection

3. Reboot, check it's all working.

VAAPI
4. Download the right mplayer version:
wget http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/mplayer-vaapi-20100114.i686.tar.bz2
unp mplayer-vaapi*

5. Install the necessary libraries: (you can remove mplayer then, but it's the easiest method)
sudo apt-get install mplayer libgtop2-7

6. and play
mplayer -vo vaapi -va vaapi testfile.avi

If mplayer doesn't run because of missing libraries, this command will show which libraries are missing:
ldd mplayer-vaapi*/mplayer

Be quick, before the instructions change due to new repositories, libraries, etc... But don't everything to work flawlessly! My system doesn't even go into suspend, but crashes. Hence it can't come out of suspend, either. Backlight control still doesn't work for me. And I still have to do more testing on mplayer to see how smooth VAAPI actually is.

Theoretically, installing VLC 1.1.0 with VAAPI should be as easy as this:

sudo add-apt-repository ppa:c-korn/vlc && sudo apt-get update && sudo apt-get install vlc

But it didn't work out of the box for me and I didn't care about why. If you have hints, questions or - yes- comments, please post in the comments.

Ubuntu 10.04 Lucid Upgrade Went Fine

The upgrade went absolutely flawless for me. There was only one dubious moment: At the almost very end of the upgrade the system started counting upwards very slowly from 0 to 100. This did really take several minutes in my case and the counting number without any further notice was a bit confusing and tempting me to abort the upgrade. But my patience was rewarded with a system which still worked flawlessly after the upgrade.

My GMA500 (Poulsbo) netbook will still have to wait a bit, I want to be sure the graphics work fine -- including VAAPI acceleration -- before I start the upgrade. But of court LTS makes it very attractive then.

Update
It turns out though the backlight control is much prettier, it's also broken and thus much more useless...
But I really like that most customized repositories were automatically re-enabled as lucid variants after the upgrade.

Saving 33% or 3 Watts of Power with your Netbook (here a Poulsbo system)

I've tried around a lot to see how much more power I can save on my system. An easy step with lots of success was to configure the laptop tools to run automatically. Check /etc/defaults/acpi-support and looks for LAPTOP_MODE, set it to true. Then you have to go to /etc/laptop-mode/ and configure first laptop-mode.conf and then the additional settings in the conf.d subdirectory. This could already save me at least 1 watt of power with very, very little hassle.

Poulsbo
I've tried around a lot with my X system, because it can draw a lot or little power depending on its settings. E.g. if you reduce the backlight you can save at least 2 watt power. Unfortunately the backlight controls on my system don't work - I'm happy I've managed to get the driver to run at all. (Check my special article on the MSI Wind U110 for more on that.) Hence at least for now I need to set my backlight to the level I want before booting Linux.

But I did find out that disabling vsync saves quite a substantial amount of power, I think about 0.5 watt. Most of the savings come from the cpu staying in idle longer on average then (about 22 msecs instead of about 4-8 ms). The catch is that with that setting enables, xvideo and vaapi no longer work after standby. Browsing is still fine, but probably no youtube, either. The whole system hangs when an application tries to use xv. So I had to disable the setting again - which actually was the step to put my netbook in a lower power mode than the carefully customized windows installation can manage, too bad.

If I pass it or any options (except debug) to the psb module during load, or load it myself during boot, X or suspend won't work at all or properly or properly after standby.

In the xorg.conf I have the standard settings for psb:
Option "AccelMethod" "EXA"
Option "DRI" "on"
Option "MigrationHeuristic" "greedy"
Option "IgnoreACPI" "yes"

Ralink Wifi
Another big one was the wifi adapter. Disabling it saves about 1.5-2 watts power, but of course I wanted to be able to have it running and save energy as well. I installed the newest driver from ralink's homepage. The important step was to go into the os/linux/ directory and edit the config.mk file to enable HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y, otherwise NetworkManager would no longer work with it. Then I studied the documentation and found the command "iwpriv ra0 set PSMode=Fast_PSP" put my card into a low power mode which still keeps a good and rather fast connection - better than in Windows, there this powersaving mode does not exist and the MAX_PSP is unusable.

Last Hint
A last additional hint is to kill knotify4.

Conclusion
In the end my system runs with 5.7 watts in a full KDE 4.3.2 X session. With mplayer and VAAPI I can now watch movies for at least 8 hours. A great demonstration of how far Linux has already come in saving power.

The only thing missing now is a working backlight control and a working XVideo without vsync would be great. Ok, an SSD would be great, too. So let me know if you have one you no longer need! ;) Or if you know how to fix the backlight control on a poulsbo system.

Maybe I should try to compile the IEGD driver for my system.

Update
I've manged to get it all running, including no_vsync, and videoacceleration before and after suspend. The trick is to do a double console switch after resume. Then VAAPI still works even after the suspend and resume - at least with xserver-xorg-video-psb version 0.36.0-0ubuntu1ppa9.10+1.

Update2
I've managed to get the backlight working roughly as well! All I needed to do was to load msi-laptop with the parameter force=1. The problem is that there is so far very little scaling, I can only set brightness to 0 (very dark) or 1-8 (all "very bright").

Update3
Check out this article with more general advice including how ensure your battery lives long and prospers. Backlight is fixed by now, I've written a patch for the psb driver (in testing at the ppa right now). With recently kernels, the power usage dropped down to 4.8 Watts without wifi! This means it lasts much longer in Linux than in Windows now.

Power Naps for your Linux System

I've always wanted a tool that can automatically suspend my system automatically once all the jobs (mencoder scripts, updatedb, etc.) are finished. Then I could start tasks, leave my system alone and trust that it would take care of going into standby itself. Most software only checks for keyboard and X input, which exactly doesn't help for my scenario. But now there's "powernap".

It's included in normal Ubuntu repositories and in its default configuration it suspends your system if no activity is detected for 5 minutes. What's still confusing me is that it by default checks for activity of initd. This does not seem to make much sense and I think a long list of typical software would be a much better alternative. Also I wonder whether it would also detect mouse and keyboard inputs, which might be nice and useful. But it's a good start in any case and you can set it up to run for your purposes.

Fixing Mplayer's Terminal Abuse, esp. for KDE and Windows

Mplayer updates the information about the amounts of frames it displayed, the played time, the remaining time, etc. every single time it displays a *frame*. This is not only completely unnecessary, it can unnecessarily hog several percent of your CPU in many terminal implementations, especially in current KDE 4 and Windows. The higher the frame rate, the more wasted CPU power.

On my netbook, the difference is 10% CPUand more with a 25 frames per second video - that's as much and more than mplayer uses for a simple Xvid video. And it could easily make the difference between a well playing file and one that's glitchy. (The CPU time is occupied by konsole 4.3.2 though, not by mplayer itself.)

The only way out would be -quiet. But then you wouldn't know what's going on anymore at all. That's why I had written and submitted roughly the following patch to fix this behavior. Unfortunately even after I made all the requested corrections, it was never applied without any reasons provided, or were there?. So I decided to publish it here so people at least know about it. But it also means unless I can convince someone here, you will have to compile mplayer and apply the patch yourself.

There are many guides how to compile mplayer. Before you start the compilation process, just copy this following block into a file quiet.patch and then apply it inside the svn directory with "patch -p0 < quiet.patch", then compile mplayer normally. You can now use the parameter -quiet-time. A value of 1 means a status message no more often than every 100 milliseconds (0,1 seconds). I think a good value is 5. You will notice that e.g. konsole uses less CPU during playback now. Enjoy the power of open source and let me know how it works for you!

Index: DOCS/man/en/mplayer.1
===================================================================
--- DOCS/man/en/mplayer.1 (Revision 29324)
+++ DOCS/man/en/mplayer.1 (Arbeitskopie)
@@ -732,6 +732,12 @@
handle carriage return (i.e.\& \\r).
.
.TP
+.B "\-quiet-time \ "
+Reduce console output updates to n per tenth of a second.
+Values of 5 or more work around slow terminals.
+See \-quiet for more.
+.
+.TP
.B \-priority (Windows and OS/2 only)
Set process priority for MPlayer according to the predefined
priorities available under Windows and OS/2.
Index: mplayer.c
===================================================================
--- mplayer.c (Revision 29324)
+++ mplayer.c (Arbeitskopie)
@@ -81,6 +81,7 @@
int slave_mode=0;
int player_idle_mode=0;
int quiet=0;
+int quiet_time=0;
int enable_mouse_movements=0;
float start_volume = -1;

@@ -1936,6 +1937,11 @@

static void adjust_sync_and_print_status(int between_frames, float timing_error)
{
+ static unsigned last_status_update=0;
+ unsigned now=GetTimerMS();
+ if (quiet_time && now >= (last_status_update + quiet_time * 100))
+ last_status_update=now;
+
current_module="av_sync";

if(mpctx->sh_audio){
@@ -1987,6 +1993,7 @@
c_total+=x;
}
if(!quiet)
+ if (!quiet_time || (last_status_update == now))
print_status(a_pts - audio_delay, AV_delay, c_total);
}

@@ -1994,6 +2001,7 @@
// No audio:

if (!quiet)
+ if (!quiet_time || (last_status_update == now))
print_status(0, 0, 0);
}
}
Index: cfg-common-opts.h
===================================================================
--- cfg-common-opts.h (Revision 29324)
+++ cfg-common-opts.h (Arbeitskopie)
@@ -8,6 +8,7 @@
// ------------------------- common options --------------------
{"quiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"noquiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
+ {"quiet-time", &quiet_time, CONF_TYPE_INT, CONF_RANGE, 0, 65536, NULL},
{"really-quiet", &verbose, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_PRE_PARSE, 0, -10, NULL},
{"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL},
{"msglevel", msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
Index: mencoder.c
===================================================================
--- mencoder.c (Revision 29324)
+++ mencoder.c (Arbeitskopie)
@@ -131,6 +131,7 @@
//void resync_audio_stream(sh_audio_t *sh_audio){}

int quiet=0;
+int quiet_time=0;
double video_time_usage=0;
double vout_time_usage=0;
double max_video_time_usage=0;
@@ -1420,8 +1421,14 @@
(int)demuxer->filepos,
(int)demuxer->movi_end);
#else
+ static unsigned last_status_update=0;
+ unsigned now=GetTimerMS();
+ if (quiet_time && now >= (last_status_update + quiet_time * 100))
+ last_status_update=now;
+
if(!quiet) {
if( mp_msg_test(MSGT_STATUSLINE,MSGL_V) ) {
+ if (!quiet_time || (last_status_update == now))
mp_msg(MSGT_STATUSLINE,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d] A/Vms %d/%d D/B/S %d/%d/%d \r",
mux_v->timer, decoded_frameno, (int)(p*100),
(t>1) ? (int)(decoded_frameno/t+0.5) : 0,
@@ -1434,6 +1441,7 @@
duplicatedframes, badframes, skippedframes
);
} else
+ if (!quiet_time || (last_status_update == now))
mp_msg(MSGT_STATUSLINE,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %5.2ffps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d]\r",
mux_v->timer, decoded_frameno, (int)(p*100),
(t>1) ? (float)(decoded_frameno/t) : 0,

Must Read Article on the Issues of Ubuntu, Open Source and Linux

http://www.omgubuntu.co.uk/2010/06/many-hands-make-light-work-few-make-it.html

Intel Poulsbo Frustration Continues a Year Later

I'm also frustrated. I happily bought my netbook about exactly a year ago as many others in the hope that Intel would provide a well working open source driver, at least excluding 3d and VAAPI. Then I managed to get it running at all and then including 3d and vaapi (see http://linux-tipps.blogspot.com/2009/12/vaapi-accelerated-hd-video-on-msi-wind.html) and i was quite happy.

But I never managed to get several things to work:

  • reliable standby (works once or twice if I haven't used 3d or vaapi)
  • backlight regulation.

Does anyone know how to fix any of this?

Now I have the crazy situation that in Windows XP I can use standby and 3d but no HD, and in Linux I have better quality and VAAPI HD video playback and 3d, but no standby. And I'm frustrated.
It's such a nice netbook and performs so well otherwise, it's really sad and frustrating if drivers keep you from really enjoying what you bought.

I don't even know if and how long I will be update my OS. It's already unclear if I would lose VAAPI and/or 3D acceleration when I upgrade to Kubuntu 10.04 -- if X would still work at all. But I have no idea how long drivers will still be developed or at least maintained if there is no open source version.

So please Intel, if not an open source driver then at least release open source specs!!!

Update
I've actually managed to get standby working pretty reliably. The computer returns back from standby with amazing speed, too. The trick was to update the bios to the newest version. This fixes prior crashes during resume. But the crashes in Windows XP when I try to use DXVA persist.

Now the problem is that my wifi and sound drivers are still problematic after resume. My wifi driver causes kernel panics and my audio driver simply stops working...

Creative X-fi Surround USB Review and Guide for Ubuntu 9.10 or Newer

This article will review the Creative X-fi surround usb first quickly in Windows XP and then in Linux. It will give you some basic performance ideas and hints for fixing problems and having more fun with it.

After my survey of the possibilities for USB surround sound in Linux, I ended up ordering a Creative X-fi Surround USB. As you could read there, there is a helpful webpage that includes e.g. ready made .asoundrc files.

Windows XP
On my netbook, without installing any special drivers, playing a song on an otherwise unoccupied Windows XP utilizes about 20% CPU, minus the almost 5 % that somehow seem to be there almost always...

I've read reports that there are clicking sounds, which I can imagine well with a heavy system load. I've heard them at first after plugging it in, but by now they disappeared. It sounds crisp on my Sennheiser headphones and the base is noticeably better than my onboard sound, obviously, but that doesn't say much.

Now let's see how it fares in Linux...

Reboot. Plug. Play. It could hardly be easier. All I had to do was to tell mplayer which device to use (mplayer -ao alsa:device=hw=S51). Then it happily started playing over my new external sound card. The sound is as excellent as under Windows. But better than Windows: Surround sound works out of the box in my Kubuntu 9.10 system.

The combination of AC-3 surround with VAAPI accelerated 720p movie on my netbook utilizes around 10-12 % CPU. There is no stuttering in Linux, even with heavier load. Just playing music hardly seems to have any impact -- maybe around 5 % CPU. I'll have to let the Phoronix suite benchmark all this sometime. In Windows even just playing music in VLC and increasing the volume setting with the knob on the device can create stutters.

Right now for some reason the slightly dusty Chromium version on this netbook keeps bringing the system into a hard stutter making characters appear slowly on the screen up to a second after I type and the mouse does not move smoothly. But the sound plays smoothly in the background. Just plain wonderful.

Resume

I can definitely recommend the sound card for USB (surround or stereo) sound in Linux. I'm not sure if I would use it for Windows. Let's see after I installed the drivers, which will probably drive me mad.

But be aware that there are clicking sounds when the card is first intialized. If you want to use it for e.g. system sounds, you may not be very happy with that. They also seem to appear during heavy disk access (apt-get dist-upgrade), even if I'm not playing any music. That's definitely weird...

The microphone input works flawlessly. I didn't have problems with over-amplification, though I can imagine that being an issue with the lack of hardware mixing. And I definitely have a sound card for surround sound HD movie nights now. And the crazy thing is I can do it all perfectly with my little netbook. Thank you, Linux. Thanks also to you, Mandar.

Post Scriptum
Some additional information for nerds: When the card is not in use, it produces not wakes in powertop, when in use, it produces about 200-300 wakes/s (no matter if surround or stereo sound).

Update
The clicking sound seems to be related to the power supply. The problem disappears in the same work load (e.g. heavy disk updatedb) if I plug the power adapter into my netbook.

Update2
As I almost expected the device is not anywhere as good in Windows as in Linux. The crystalizer does sound nice, but there are many glitches in the Windows driver. E.g.

  • sometimes when you pause they playback, the result is a constant beep until you press play again, 
  • during forwarding in movies, there are short beeps. 
  • Once after removing the plug and putting it back inside, the entire system hung, only working again after removing it again and then showing and error message. 
  • the driver uses much more CPU than in Linux and it's a 50 MB package
  • there are no volume controls for rear, center, lfe and front channels, only 1 master control (in Linux you can fix this -- maybe MatrixMixer works for Windows?)
  • the microphone input sounds slightly noise shaped, esp. in combination with the "crystalizer"
Hence I would make my recommendation more clear: I wouldn't recommend it for surround sound in Windows I think. It might still be your best option due to the lack of alternatives, though.

Update3 (9/2011)
Unfortunately I only just tried recording in Linux for the first time. And it seems it doesn't work at all. I got only noise. I've tried Line in and Mic in. There's no real setting for the record options anyway. (Which channel, etc.) So that's definitely a downside. I had never tried that in Linux before. btw. Check here to get the remote control and volume know working. It should come out of the box with kernel 2.6.37+.

And here's my .asoundrc so far:

pcm.!default {
type plug
slave.pcm "softvol" #make use of softvol
}

# create softvol master channel
# see http://alsa.opensrc.org/index.php/How_to_use_softvol_to_control_the_master_volume
pcm.softvol {
type softvol
slave {
pcm "dmixer2" #redirect the output to dmix (instead of "hw:0,0")
}
control {
name "Master" #override the PCM slider to set the softvol volume level globally
card S51
}
}

# create stereo dmixer, because using the 6 channel one causes stutter if the channels are empty
pcm.dmixer2 {
type dmix
ipc_key 2343
slave {
pcm "hw:S51"
channels 2
}
}

pcm.dmixer6 {
type dmix
ipc_key 2342
slave {
pcm "hw:S51"
rate 48000
channels 6
period_time 0
period_size 1024
buffer_time 0
buffer_size 4096
}
}

# reroute the channels because rear and sub/lfe are exchanged
pcm.mysurround {
type route
slave.pcm "dmixer6"
slave.channels 6

ttable.0.0 1
ttable.1.1 1
ttable.2.4 1
ttable.3.5 1
ttable.4.2 1
ttable.5.3 1
}