Sunday, October 29, 2006

KPowersave status

Today a short update about the current status of the KPowersave development for the next stable version running with HAL instead of the powersave daemon:

We have a new deadline for the first running base version on KPowersave. It's openSUSE 10.2 Beta2, which means I need to checkin the new package at least Monday the 06.11.2006 to get a running version into the release. In Beta1 KPowersave is not in the default selection because of problems with the connection to D-Bus. I had no time to take a look at this issue, so thanks to Timo Hoenig for the patch to fix the problem in the old and new upcomming versions.

Unfortunately I could not commit the fix (and work on KPowersave) because of problems with the SVN server of Novell Forge. The server is down since Friday (27.10.) without any previous announcement from the admins. This is very annoying for the users and really unprofessional from the admins of Novell Forge, also because the service is down the complete weekend. Very good for the deadline for Beta2 if you host a project there.

Nevertheless we finished the most of the work on the hardware information and abstraction part of KPowersave. Now we can start with integrate the new base classes into the applet/GUI.

Thursday, October 26, 2006

HAL patch collection

There a currently some patches I send to the HAL mailing list which aren't included in the git repository so far. They should be included in the new HAL package for openSUSE 10.2 Beta2. Here a list of these patches (feel free to use them on your own distribution):
  • fix build (hald-addon-macbookpro-backlight) against newer versions of libpci: here
  • add support for Standby (S1) to HAL: here
  • remove backend postfix from script filenames (need maybe rename files by hand, for more see this mail thread): here
  • A performance fix for search in pci.ids for vendor and product information of PCI devices. This patch is a reworked version of a inital patch from Ihno Krumreich. I extended the patch to fix bug in the search algorithm and to stop search if found everything we looking for. This patch speed up the search in the list by factor ~8-15 if HAL starts up: here
  • A new version of my patch to detect Tablet PCs (as e.g. with Wacom tablet devices and some Fujitsu Siemens machines) and to set the needed serial ports on boot: here
These patches are against current HAL git. You can find all my current HAL patches here.
Tags:

Tuesday, October 17, 2006

KPowersave development for next stable (0.8.x)

Today a (short) brief/information about the current planed and already started development for the new KPowersave development tree (0.7.x) and the next stable version (0.8.x):

Preamble

Since Powersave starts to die and the powermanagement tasks going into HAL we need to change KPowersave to use HAL instead of Powersave.

Only for the log: I don't like this step and for me is the concept to put _all_ (hardware information, powermanagement, mounting, partition, format ...) stuff into one daemon, (into this crappy HAL and only because some desktop developer are not able to write a UNIX like daemon for special tasks) a really stupid idea.

I liked the old powersave. This was a great piece of code which contains several man-years of knowledge about ACPI/APM and powermanagement and did a great job over the years. I'm not happy about losing it.

This changes mean at least also more trouble in KPowersave.

Table of contents:
  1. HAL/Powersave basics
  2. Replace Powersave
  3. GUI
  4. Testing
  5. Documentation/Translation
  6. Timeframe

(1) HAL/Powersave basics

Currently KPowersave use Powersave and libpower from powersave to get hardware information, to switch schemes, to set CPU Freq and to trigger suspend2*/standby.

In general we need to connect now directly to HAL to get a signal if something on hardware changed, if we want to avoid permanent polling e.g. for battery information via libpower. There are two possible ways: listen to HAL for changes and call libpower to fresh up device information or listen to HAL and collect all device information directly in KPowersave.

I would go the second way. This should reduce the overhead of the library (libpower currently (old version KPowersave currently depends on) provide several info we never need and miss some other info we need now). If we implement this directly in KPowersave we can cache the information and need only to update the changed values (e.g. we need only call hal for current battery percentage and only for this key and only for this special battery) which should reduce the overhead on DBUS and allow KPowersave a finer grained signal and information pool.

Needed work:

implement a new class to:
  • hold connection to the HAL interface via DBUS (done)
  • to provide a layer to libhal to get device info (done)
  • add methods to find devices by capability and property (done)
  • to provide a layer to call DBUS methodes on HAL/DBUS interface (done)
implement a class to collect and abstract:
  • battery, ac, lid information (75% done, need to think about the battery stuff)
  • info about suspend, brightness, CPU Freq (done, TODO: add support for PolicyKit information)
  • add function to update the related info if something changed. (in progress, Danny/Frank)

(2) replace Powersave

To replace currently by powersave provided functionality we need to change several issues in KPowersave:

suspend2*/standby:

Old Powersave provided a interface to trigger suspend2*/standby and to check if the user is allowed to call this methodes. HAL provide currently only a abstraction of the kernel interface, which mean we can only say if the machine/kernel can suspend in general, but we can't say if:
  • the user is allowed to call these methodes
  • the machine is really suspendable (or if the machine is e.g. not able to suspend2ram and is blacklisted e.g. in s2ram).
Problems:
  • I have currently no idea how we can fix this. Maybe via PolicyKit, but this is not sure because we don't know if this go really in SUSE 10.2 or if PolicyKit is mandatory for HAL upstrean in the future. This situation is really bad and the sideeffects are annoying for the user.
  • HAL only support suspend2* and not standby atm upstream (on SUSE we have a patch for this).

battery alarm states:

Powersave currently provide the battery alarm states and the config at which point which state is reached. We need to move this to KPowersave and make it configurable only in general and not per scheme. We need to configure the three states and the related actions (e.g. warn user, suspend, shutdown)

Problems:
  • Several different users can be connected to the system and every user can define different states and different actions which results in a chaos. This is at least again the same problem as with CPU freq via HAL and fighting clients. Maybe we add this to a admin mode dialog as e.g. in KControl and allow only a systemwide config, but this is only a solution for KDE. (evaluate: discussion started by Holger at: g-p-m Mailing list)
CPU Frequency Policy:

Since CPUFreq settings are moved from powersave to HAL, we need also to replace the current settings in KPowersave. There are two issues:
  • make the currently existing different CPUFreq Policies configurable
  • make them configurable per scheme
Problems:
  • Fighting Clients and other tools (see above).
Schemes:

Powersave currently provide some schemes (powersave, performance, presentation and acoustic), two of them are automatically switched if the AC plug is removed/inserted. We need to implement _real_ schemes in KPowersave. We have currently schemes in KPowersave (with brightness, screensaver, DPMS, autosuspend settings and so on), but we need to make them configurable. This mean we need this stuff:
  • create new/remove/edit for current schemes
  • make configurable default schemes for AC online/offline (and maybe other events as e.g. lidclose or if detectable adding a beamer to the machine for presentation scheme)
  • per scheme CPU Frequency settings (see above)
  • per scheme disk settings
Problems:
  • There is currently no way to set the harddisk settings, but we need this on some machines which change the settings e.g. via the BIOS on suspend or if the AC plug is removed (which maybe increase Load_Cycle_Count and reduce lifetime of the disk).
  • Fighting clients with different settings.

(3) GUI:

Based on the changes from (2) we need to update the configuration dialog to make all the settings configureable for the user. As a first step we don't need to implement this (first finish the basic stuff), we can do the config via the config file. Tasks to do:
  • create/remove schemes, as first new schemes with a default config (first steps done). Later we can maybe add a wizard for inexperienced users
  • CPU Freq stuff (per scheme, and per policy)
  • AC state and actions (global settings)
  • Battery states (global settings)

(4) Testing

Provide first working version as always on sf.net/freshmeat and kde-apps.org, send a mail to opensuse ML.

(5) Documentation/Translation

Need to extend, update and translate the documentation. We need also some new translations.

(6) Timeframe

A first stable running version - without not needed stuff from (3) - until openSUSE Beta1/2/final. With the new stable and without dependecy to powersave we can think about push KPowersave into KDE SVN as default KDE powermanagement applet.

You can find all already done changes in the KPowersave SVN at trunk.
Tags:

Sunday, September 03, 2006

Logitech DiNovo Keyboard

Since some weeks I use this really nice Logitech DiNovo Bluetooth ultra-flat keyboard. But the keyboard is unfortunately not listed in the KDE Control Center (under Regional & Accessibility --> Keyboard Layout). Hence I patched the keyboard layout into the X files.

I must say it's really a pain to do this. As first you need to run /usr/X11R6/bin/xev to get the keycodes of the extra (multimedia) keys, but unfortunately the keycodes are not the same codes as X use in /etc/X11/xkb/symbols/inet. You need to search each code in /etc/X11/xkb/keycodes/xfree86 to find the correspondent XFree86 code. Why the hell can't xev display also the matching XFree86 codes?

As next you need to patch 4 files to get the keyboard running. Why 4 different files? This should be also possible with only one file! If you have this keyboard you can download the diff of my changes from here (simply download the file and do this as root user in '/': "patch -p0 < /tmp/keyboard_Logitech_DiNovo.diff" ) .

Wednesday, August 30, 2006

Hacking KMailCVT

Since a long time ... Yesterday I did some maintanance work for KMailCVT . In the last months I couldn't find the time to fix some known problems in the mail import tool of KMail but now I taked a look at this issues (for the KDE 3.5 branch):
  • I could not move imported mails from mailinglist archives to a Cyrus IMAP account because of not allowed line starting with "From " (not to mistaken with "From: ") in the header. I fixed this by removing the line while import (see commit).
  • If you import mails from a mbox file the state of the emails is not set back to KMail. All mails are marked as new (see e.g. kde.org bug #114923). I added detection of the X-Status flag to set the correct state the imported mails (see commit). I tried also to add the same to the kmail-maildir import filter (which worked), but unfortunately there are some problems in KMail with set the X-Status flag correct to the mail files (bug #133210).
As next I plan to check also the other mailfilter to read and set the state of the mail. There are also some problems with the interactivty of the filters if you chancel the import process which need some work. And at least: I need to port the changes to the KDE4 tree ...

Tuesday, July 04, 2006

KPowersave update v0.6.2 released

Sunday I released the a new update for the stable tree of KPowersave with version number 0.6.2 and also a new powersave version (v0.12.20) to sf.net. This release fixes more than eight bugs. Here the most important changes:
  • KPowersave depends now on powersave >= 0.12.18
  • fixed bugs:
    • sf.net #1483392/ SUSE #177792: set changes for autosuspend state via DCOP back to the applet menu, added DCOP functions to set the current scheme, the current CPUFreq policy and to open/close the detailed dialog
    • sf.net #1483392/ SUSE #177788,180000: added workaround to fix two bugs in the DPMS- and Screensaver extension of X, related to autosuspend and detect user inactivity (DPMS timeouts are abstracted from current idle time, but shouldn't / DPMS timeouts are currently additive but shouldn't). This fix problems with autosuspend if the timeout is longer than the DPMS timeouts.
    • SUSE #168619: changed errorhandling if HAL, DBUS or the powersave daemon is not running or if the user has not the needed rights to access the powersave daemon via DBUS. Added new errormessages and translations.
    • SUSE #182515: Changed configure dialog to respect rules for DPMS timeouts
    • SUSE #176782: patch from Timo Hönig to allow (if supported and enabled in the scheme) change brighness via mousewheel over the applet icon.
    • SUSE (SLED) #183745: fixed detection of SUSE Linux/SLES/SLED and added Fixed bugzilla link for SLED/SLES configure option to force SLES/SLED as distro with --enable-suse-sles.
    • SUSE #184076: fixed wrong command to start dbus daemon in errormessage.
    • added additional check before autosuspend if this was disabled via applet
  • added new configure check to detect Ubuntu/Kubuntu
  • changed link to Ubuntu bugzilla to launchpad.net and use now the same link for applet menu entry "Report a bug ..." if compiled for Ubuntu/Kubuntu
  • updated default blacklist for autosuspend with gmplayer,kaffeine,xine,mencoder
  • updated translation: cs,de,es,fi,fr,hu,it,km,pl,pt_BR,zh_CN,zh_TW
  • updated (cs) and fixed translation of eventsrc for KNotify
  • fixed and updated code documentation
Packages are, as always, available on the sourceforge project page for SUSE Linux 10.0, FC4/5, Mandriva and Slackware and via links on kde-apps.org for other distributions (note: the new version is maybe not available for all of them at the moment) including Debian, K/Ubuntu, Arch Linx, Gentoo or ALT Linux.

Thursday, June 15, 2006

And again ... more distributions

KPowersave is now among SUSE Linux, Debian, K/Ubuntu, Mandriva, Slackware, ALT Linux, Arch Linux, Fedora Core 4/5 and Gentoo available on two additional distributions.

On FoX Desktop 1.0 Professional (a Fedora based KDE distribution) KPowersave and powersave are the default powermanagement solution (see Release Notes).

KPowersave (and also powersave) is now available in the development tree of PLD Linux. You can download the package from the 3.0 tree of the ftp server. PLD Linux is also a former RedHat based polish distribution.