FOSDEM: Open Hardware Manager

Tomorrow I'm off to FOSDEM. I'm introducing a BOF on Open Hardware Manager in the embedded room on Sunday. OHM is a small open source system daemon which uses HAL and abstracts out common hardware management tasks such controlling heat dissipation and power consumption on embedded devices.

If any embedded people want to find out what all this stuff is about, then please either come to the BOF or buy me a beer in the evening.

Rhodri 4GB Saga 3

Spent some more time hanging out with Rhodri, and answering some of the Ubuntu questions he had.

First, his FAT32 fixed disk was not showing up in the menus, and for quickness I just added an entry in fstab, but wondered why it was not showing up in the menus. In FC6 I know you can just edit the HAL FDI file to enable this, but this didn't work on Edgy.

He had created several 7Gb iso images and put them on his ext3 home. He then tried to copy them to the new FAT32 partition on another disk, but every time Nautilus would crash halfway through.

Of course, FAT32 only supports up to a file size of 4Gb, but we were not told this either by nautilus or by the command line using mv.

This has been reported before, bug #365885 but has had no love yet. What about a new dialog like “You are trying to copy a large file to a partition type that cannot support this. [skip] [skip all] [cancel]” Better wording appreciated.

Bugs like this rarely affect die hard linux fans with all ext3/xfs partitions but probably is hit frequently with people new to Linux and dual booting. Anybody already have a patch for this or do I have to do it?

WPA-PSK, it can't be that hard, right?

So, I spend another few hours with Rhodri today, helping to set up networking with Ubuntu Edgy and a new zd1211 based USB2 networking device. This all should “just work” with the new zd1211rw driver in the kernel. I spent about an hour using my laptop as a wireless->wired bridge which was no mean feat, as NetworkManager didn't do this for me, and the redhat network scripts don't do WPA. After applying the updates everything worked a little better. After about 2 hours of debugging, I came to the conclusion that either the edgy updated kernel does not have the latest zd1211rw code required for WPA, or that the Ubuntu wpa_supplicant was in some way broken. I admitted defeat, and changed the access point to be WEP with MAC filtering and promised I would find the proper solution. So lazyweb, how do you get zd1211rw to work with WPA-PSK? Thanks.

About Rhythmbox

Rhythmbox is a very cool bit of software. I stumbled on the “About” entry for Rhythmbox and got this:

The corresponding gnome-power-manager about window looks like this:

Now, I'm jealous of the Rhythmbox 420×110 logo background. Any artists want to contribute some ideas and designs for something similar for gnome-power-manager? It is a very easy way for people new to GNOME to get your name in the Artwork credits! Email me (richard_at_hughsie_dot_com) if you have some ideas or mockups. Thanks!

Time remaining for funky batteries

Peter Jones, you are a legend:

…use a matrix of previous discharge rate intervals indexed by the charge at the time and the actual average discharge rate during that interval….

I've prototyped this, and wow, it's accurate. I've used floating point least squares regression to find the rate of discharge. This trivially takes into account battery cell configuration and battery chemistry data, and continually 'tweaks' itself with the new data, i.e. getting more accurate in shape as you discharge and charge each time.


Sub-screenshot of my test program

I've still got to work on interpolation of data where the percentage wasn't hit (the start and end for me, but might happen anywhere), but this is not a big problem.

I'm now optimising my code for speed, making a suitable gobjects for the data structures and testing like mad. I hope to have some other battery discharge and charge curves from stuff like OLPC and my nearly completely broken battery iBook.

Before people ask, the graph widget is the one used in gnome-power-statistics, and that screenshot was taken of a custom hacky application that has far too many graphs to fit on one screen.

Calculating how much time we have left… the sequal

So I posted a blog about a software patent. I now know this was a bad thing to do for an open source developer, but naively I thought I should research the problem domain. I now know that open source developers should not look at patents, and pretend they do not exist. A few people have said I should just use the patented 'invention', and let the US users patch it out. I'm not going to do this, as I think it's not the best solution for everyone. The patent itself is only similar to the work I have done, and only touches on some of the ideas I was using. It's not a big loss if I do things another way, the code I had written was only proof-of-concept and had quite a few different ways of calculating the same data. I'm now thinking of using V=IR and P=IV for the basis of my calculations, but I'm not going to do any research just in case somebody has used these formulas before. Don't you just love software patents.

Calculating how much time we have left…

GNOME Power Manager sometimes really gets the time remaining wrong. It doesn't help that the ACPI BIOS sometimes misrepresents the data values, the units, or just gives bogus readings, but we should at least try to be accurate.

So I've been playing with a historical correction-matrix approach, at the moment targeted to the li-ion discharge curve. Initial results are very encouraging, and appear to be much more accurate than relying on the embedded controller data for my dual core laptop and my old iBook. Factoring in battery temperature would likely give an even more accurate answer.

And then I stumbled on this patent.

It appears to patent a method of reading the battery total energy and dividing it by the discharge rate, and then correcting it with a chemistry profile and specific historical correction matrix. Ahh…

This seems fairly obvious calculation to me, and I would hardly call it an invention (it's a formula with method), but I do not want to put a feature into g-p-m that is clearly patented. The patent would also likely explain the lack of documentation available online, and why all of the battery discharge chips are very closed source.

So, where do I go from here? I've not released any code, but I would appreciate your advice about what to do.

Rhodri and Ubuntu

My friend Rhodri called me up the other day mentioning he was having a few problems “with that Linux thing…” and that he knew I might be able to help. He's not a geek in any sense of the word and I thought he was quite happy with Windows XP. I knew he was serious when he showed me the Ubuntu Edgy CD he'd downloaded and said that he'd joined the Ubuntu forums. First problem. His wireless card didn't work. I explained the firmware thing, and I think he understood. We installed the PC with one of my Linux friendly dongles and I let him play. We got the wireless firmware installed but could not connect to his network as there was no NetworkManager. So I used my n800 to download all the NetworkManager and libnl type debs to the internal memory and then installed them with dpkg. After about 15 minutes of me swearing at NetworkManager he also mentioned the access point was MAC filtered. Ahh. One problem down, we entered the new dongle MAC into the web interface and we tried again. It might have been nice for NetworkManager to tell me about the connection problem. Next problem. The network was also set to WPA-PSK, as comes default with SKY broadband (and they don't let you change it). NetworkManager didn't say “WPA-PSK not supported yet” but kept asking him for the WEP password and then silently failing the authentication. So we hit Google on my n800 (which did connect) and were prompted with a tutorial for Edgy which involved wpa_supplicant and lots of command line action. About 5 pages of the stuff. Most of the stuff he didn't even start to understand. I had to leave him to it as it was getting late, but I just thought how embarrassing it was for desktop Linux to be so close and yet so far.

Inhibit and ForceInhibit

I've been looking at the gnome-power-manager Inhibit API. So far we basically have this:

Inhibit – to get a cookie to prevent suspending
UnInhibit – clear the cookie and allow suspending

Having an active cookie stops the auto-suspend feature when you are copying files over a slow network link, and also stops you from pressing the off button on your computer half the way through burning a DVD.

The distinction between the two need to be clearer, and I think I need new method names to solve things like bug 402863.

The new method names needs to differentiate between “I'm in the middle of an RPM transaction don't suspend even if the user pressed the suspend button” and “I'm playing music, don't auto-suspend if all the sessions go idle”.

So ideas welcome. I'm erring so far to Inhibit() for inactive sleep and ForceInhibit() for the RPM transaction case, but I'm not sure that's particularly intuitive. Ideas welcome. Thanks.

Lenovo 63af03us

So, today I got told that Lenovo had released a new BIOS, which (I am rather sad) got me quite excited…. Maybe they've fixed ACPI brightness control, or allow me to resume from suspend, or just added the battery current voltage patch I sent to them a few months ago.

No, Version 3.0 (third major release) just bumped the OEM revision header (in the AML header) from 51 to 52. No other changes.

Wow, thanks Lenovo. Just remember kids, Lenovo doesn't support Linux.