13.06.2011

Update to cpufreq

Today I've released an update to cpufreq which should fix the issue that the upstart script didn't set the governor on system boot. In previous versions, the script looked up the power supply status in some obscure path on the /sys filesystem, including hardware addresses. With the release of 11.04, this path didn't exist on my system anymore. Instead, a much simpler path appeared: /sys/class/power_supply/AC/online, which seems to be independent of the hardware. The new script now checks this location and sets the governor accordingly.

Unfortunately, I seem to have overestimated the time I can spend on my projects here. I haven't forgotten any of Your comments and I will try to answer them as soon as possible, but this might take more time that I previously thought. Sorry for that.

10.05.2011

Signs of life

I finally found some time to work on my Linux again!
I upgraded to the new Ubuntu 11.04 (Natty) and was reminded once more to never change a running system...
If You consider upgrading, let me tell You: My ClickPad (the touchpad) works better now (multitouch support), but that's about it.
The new Unity desktop is... well let's just say I hate it. It may be useful for the netbook users, it may be nice for people who have never seen anything else, but for me it takes away any efficiency a desktop environment ever provided me with.
So I stuck with Gnome 2 for a few days before reading that it was possible to install Gnome 3 from a PPA. My second mistake. The new Gnome is not half as finished as it may seem. As for now, it slows me down approximately by the same amount that Unity did. Window switching using the mouse takes about twice the time it did before, as does opening Pidgin from the tray. Favorite applications (the ones I put directly into the panel in Gnome 2) also take about twice the time to click. When I open the "Applications" tab in the main menu, I'm being hit in the face by a page with around 90 icons on it (totally useless if You want to find an application), until I select a category. Hotkey support is kinda broken, I cannot make my screen rotate when turning the display and key combos including the "Windows"-key don't seem to work at all.
And last but not least, gnubiff doesn't work as a panel app since there's no support for panel apps anymore. After an hour of testing, compiling and searching the internet I finally found a version of mail-notification which had SSL support.

If You own an HP TouchSmart tm2-1090eg (You will probably have the same problem on similar laptops), there's another great feature of Ubuntu 11.04: Almost guaranteed Kernel Oops during boot! The radeon module tries to dereference a NULL pointer in 3 out of 4 boot cycles, which often leads to a complete system hang. At least it's possible to get the system to boot eventually if You just keep rebooting until it works.

But enough ranting about the new Ubuntu. Here's some good news:
I ported my packages (namely cpufreq, tablet-mode and video-switcher to Natty and fixed a bug in tablet-mode on the fly! It (once more) didn't read the display identifier (e.g. LVDS1) from the config file but instead always fell back to the default (LVDS1). If You upgrade to Natty, You will

I'm not sure wether I will have time to look into the suspend/resume problem Nicolò mentioned in his comment about my last post, but I think I will manage to look into video-switcher in general. I think about including an upstart script which can cycle through the video cards once on each boot (I had the problem that both video cards were turned off sometimes, but I'm not sure if this persists in 11.04) and I started working on a GUI for the program.

I look forward to post some (hopefully good) news again soon!

11.03.2011

Trouble with chromium and an easy-to-install PDF reader plugin (ambiguity inteded)

I recently switched from Firefox to Chromium due to it's speed. I was really happy with my choice until today, when Chromium stopped working out of the blue.
I installed some updates in the background, was working on a project where I had a website opened and when I closed and reopened Chromium... nothing!
Chromium couldn't load any web site. My first thought was of course "there must be something wrong with the network connection or settings". There wasn't. The really nasty thing was that Chromium did not only stop loading web pages - it couldn't even display its own preferences, downloads and the bookmark manager!
My second thought - Google's Your friend! There were a lot of people complaining about issues just similar to the one I saw. The problem was, they all used windows. Their best solution ("run an anti-virus-scan") was kind of the wrong approach for me and the debug log neither told me anything useful. All seemed lost and I had already accepted my fate of having to use Firefox until a new update for Chromium came out, when suddenly a miracle happened.
I could have sworn this would never happen, yet it did. A crash saved the day! Now here's something off topic: Ever since I started using Ubuntu's home directory encryption feature, it broke from time to time. Nothing big, though. While using the system just normally, the encrypted file system would somehow be unmounted, leaving me with an empty home directory. My desktop background disappeared, my shells started taking me to the root directory and I had to log out and back in. This time, I wanted to know what went wrong, so I called dmesg with a surprising result...
Code:
chromium-browse[<PID>]: segfault at 4 ip 00000004 sp bfa74c2c error 14 in libpdf.so[b1e85000+118a000]
Turns out, my PDF reader plugin was incompatible with my new chromium version. Deleting the libpdf.so from /usr/lib/chromium-browser/ solved the problem.

And this is part 2 of the article.
One of Chromium's disadvantages with Google Chrome is the lack of a PDF plugin. Luckily, both programs are easily available for linux. And more luckily, it's pretty easy to steal Chrome's PDF plugin and install it for Chromium. Here's how You do it (make sure to update the plugin every time You update Chromium to avoid the mess I wrote about above!):
  1. Get the latest version of Chrome for Your architecture as a Debian package from http://www.google.com/chrome (make sure to open the site with Linux!).
  2. Open the package with the archive program (example for i386):
    Code:
    $ file-roller google-chrome-stable_current_i386.deb
  3. Extract the file opt/google/chrome/libpdf.so to some location
  4. Put the file into the chromium directory
    Code:
    $ sudo mv libpdf.so /usr/lib/chromium-browser/
    $ sudo chown root:root /usr/lib/chromium-browser/libpdf.so
That's it! You're done!

19.02.2011

Release Party!

I proudly present: video-swicher, a tool to switch betweeen the integrated and the dedicated video card on laptops that have switchable graphics cards. As far as I know, this the the first and (up to now) only tool for this job!
The package is easy to use. It comes with an upstart job that can disable the unused video card on system boot (configurable via a configuration file in /etc/default) and a binary to change the active card. It can only be run by root (or via sudo) since it needs to write into a file on /sys which is owned by root and it needs to shutdown any running display manager.
Up to now there's only one available package, video-switcher which provides the upstart job and the binary. A second package providing a GUI will follow within the next days.
Grab the package by the usual means (available in my PPA) and tell me what You think!
  1. Install
    Code:
    $ sudo apt-get install video-switcher
  2. Use
    Code:
    $ sudo video-switcher [int|ded]
That's it! You're done!

P.S.: You might ask Yourself: How come there's version 1.0.3 available if this is the release announcement? Well, I uploaded the package, found some bugs, deleted it and fixed them. When I tried to upload the fixed version as 1.0.0 again, the system rejected the code claiming that there was already a version 1.0.0 that differed. So I had to make it version 1.0.3.

17.02.2011

The end is near!

I'm about to finish work on latest package called video-switcher! I managed to write a command-line application that is able to change the video card. It has to restart the X server (closing Your session), but as far as I know, there's no getting around that.
There's only one problem left to fix. When switching back to the on-board Intel video card on my tm2-1090eg, the display often gets into a weird state where it's either showing just garbage or nothing at all. I was able to circumvent this by turning the screen off and on again. However, vbetool, the program I use for doing so, sometimes hangs up using 100% of the processor. At that point, my program hangs, too, and never gets to restart the X server. Apparently this is a known bug which hasn't been fixed yet. I'm still working on this and I hope to have a fix ready in the next few days. If You have any idea that might help, I'd be glad to hear about it!
I'll keep You posted!

P.S.: After fixing the problem it might still take some time to write a graphical user interface for the command line application. This shouldn't take more than a day, though.

14.02.2011

Yet another bugfix release (for tablet-mode)

I'm sorry! I broke it again! Shame on me!
As You might have noticed, upon upgrading from an older version of tablet-mode the upstart job disappears magically and the automatic screen rotation stops working. I failed to notice the postrm script during the last bugfix. This nasty little thing (which I wrote myself, shame even more!) deletes the upstart job when the package is removed. This is neither necessary nor useful, as it is also called when the package is upgraded, effectively breaking the automatic screen rotation.
You problably won't be surprised when I tell You what You need to do. Remove and reinstall. Just as in the last article. Make sure to grab the newest version (1.5.3), upgrading from there should finally work as expected.
I'm really sorry.

08.02.2011

Bugfix for tablet-mode

As usual, there's a bugfix for tablet-mode shortly after there was a new version with a new feature. I'm sorry, but I messed up some things again. If You find Yourself with a broken package (something's not working), You might want to purge the package and re-install the latest version (this should be 1.5.1 or higher!). Unfortunately, a simple update from an earlier version might not fix everything, as the configuration files (in /etc) are not re-installed correctly. In order to purge and reinstall the package, do the following (as root).
Code:
$ apt-get purge tablet-mode
$ apt-get update
$ apt-get install tablet-mode
You should check Your /etc/tablet-mode/tablet-mode.conf to make sure that all entries are correct.

That's it! You're done!

07.02.2011

New feature for tablet-mode!

As You might have notices (or if not, I'm gonna tell You now anyway), there are 2 updates for tablet-mode. Version 1.5.1 ist out. Version 1.5.0 fixed some package-internal things (particularly with the config file and the postinst script) and introduced a new feature. Thanks to Nicolò's comment, the new tablet-mode package gives You the possibility to turn off Your laptop's touchpad (that mouse-replacement, not the touchscreen) when entering tablet mode (e.g. when putting Your screen onto Your keyboard). According to him, this should fix the crazy pointer movements some people might have experienced when not turning it off. After updating the package, You should have a look at the configuration file /etc/tablet-mode/tablet-mode.conf and check if the options are set they way You want them to be.
So that was the first update. What about the second? Turned out I messed up a script (again) so the postinst script would not insert the right values into tablet-mode.conf upon updating. I corrected that and everything should be working again.
Just update by the usual means.

That's it! You're done!

06.02.2011

Yet another cpufreq update

The title says it all. I've found another bug in my cpufreq package broke the ACPI handler. The script tried to execute /usr/local/bin/cpufreq which of course doesn't exist if You installed my packge. I've changed it to execute cpufreq which gives You the possibility to put a custom version of the cpufreq script into /usr/local/bin and which is then executed instead of the package version. If you stay with the packaged version, it will of course execute that.
I recommend You install the update as soon as it's available. As always, report any bugs You might find!

02.02.2011

cpufreq update

I've released version 1.1.0 of my cpufreq package. It fixes numerous bugs, including the one that made the upstart job not work at all. Unfortunately, version 1.0.0 is so broken that You can't just update to 1.1.0. The old version will break the update and You'll end up with essential files missing. Due to this, I've made it impossible to upgrade from 1.0.0 to any other version. In order to get the new version, You will have to remove (or purge) the old version first, e.g. with apt-get:
Code:
$ apt-get purge cpufreq

After that, You are safe to install the new version (make sure to update Your package list, first!):
Code:
$ apt-get update
$ apt-get upgrade cpufreq

I'm sorry for the troubles this may have caused You (or will cause You during the update). As far as I can judge, it will not happen again with this package. I fixed the control files to prevent deleting files that are being installed by a newer version of the same package (in fact, they don't delete anything anymore).

In addition to the bugfixes, I've included a configuration file: /etc/default/powersave. Using that file, You are able to control the behavior of the ACPI handler and the upstart job. You can specify which CPU governors to install and You can disable each of them completely. I hope this compensates You for the pain the bugs caused :)

A side note here: The package will not remove any files in /etc when being removed normally (not purged). The upstart job and the ACPI handler will stay, but they won't do anything, since the cpufreq executable is not present. If You want to delete those files, purge the package (called "Mark for Complete Removal" in Synaptic) or delete them manually.

Another side note: When future upgrades are being installed, You might be asked if You want to keep some configuration files or install the "package maintainer's" (that's me) version. If You haven't changed the file in question and are unsure, it's best to install the new version, since it may contain bugfixes or new features (although You shouldn't be asked if You didn't change the file).

Since this problem seems to be fixed (report any bugs that persist or came up, please!), I will focus on the package to switch the graphics card now. Stay tuned for more!

That's it! You're done!

24.01.2011

Power saving for the win!

Update 2: I've released a new version of the package that fixes numerous bugs and brings new features. Since updating requires some special care, it's best to check out the new article on this before trying to do anything manually.

Update: Apparently the startup script doesn't work correctly yet. Upon system boot, the governor is set to performance, probably after my script set it to ondemand or powersave. I'm currently looking into this and will release an update as soon as possible. Until then, You can either set the governor manually after logging in, You can remove my package, or You can turn the ondemand init-script back on:
Code:
update-rc.d ondemand enable
The latter method will set the governor to ondemand on system startup. This is not as good as powersave if You're running on battery, but it's still better than performance.


I'm happy to announce the second package in my PPA! cpufreq has joined the ranks of tablet-mode and is ready to be downloaded!

It's basically nothing else than a packaged version of my article on CPU governors and the power supply status. It has a few more checks (if certain nodes on the sys filesystem exist) and now also displays a list of available frequencies. If You want to increase the running time of Your laptop on battery, I recommend You get it while it's hot!

As of now, the package requires absolutely no configuration (as long as some things on Your system work the same way they do on mine) and if You should encounter any problems, just drop by, leave a comment or write me a mail. I'll try to fix it as soon as possible.

To install it, add the PPA to Your APT sources and update Your package list (as described here). After that, install it via synaptic or the console:
Code:
apt-get install cpufreq

Congratulations! You can now pull the plug and Your system automatically changes to the powersave governor! In addition, You can use cpufreq to change the governor manually on the command line (see the man page for details).

That's it! You're done!

17.01.2011

2 new packages to come!

Here's a small announcement:
I will probably create a package for automatic CPU frequency scaling based on my article here. From what I read in the forums where this blog was posted, there are many people (especially those new to Ubuntu) who have problems or difficulties setting up and installing scripts. The package will thus contain the script, the ACPI handler and the upstart job. This is nothing more and nothing less than I already posted in the article, but will of course be much easier to install and update. I hope the package will be useful for many people and I would be very happy about any feedback on this topic (there are visitor statistics available for me concerning the blog, but unfortunately there's no download counter for my PPA).
Another package I'm currently working on is based on the post about switchable graphics. It will contain a small graphical (also usable without a GUI) program which is able to switch the graphics card between the integrated (less power consuming) Intel card and the discrete (more powerful) ATI card. It will of course still restart the X server upon changing the card as there is currently no way to circumvent this. Personally I have little use for such a program (as I don't really need the graphical power of the ATI card in Linux), but I think it might be come in handy once in a while and may be even more useful for other people. As for the first announced package, I would be very happy about any feedback concerning this.