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.

n800 Initial Minor Problems

My Nokia subsidized n800 arrived today, cheers guys. It appears much quicker in average use than the 770, and the software appears to have more features, be more stable and generally mature. Plus, it can read SD flash cards which means I can share cards between my camera, OLPC machine, and n800. If you've got big fingers like me, then you'll also find the “poke at it” input mode much improved. Plus the stereo sound is FANTASTIC from such a little device.

A few minor problems, that some of you may know the answer to;

  • What other radio stations can be listened to on the n800? AccuRadio is not my thing, and BBC Radio 1 feed did not work. Is there a list somewhere of known working feeds, or has anyone got any specific recommendations?
  • There's a lot more software packaged for the 770, but I guess that will improve with time.
  • In mediastreamer my album artwork never appears – does the filename have to be something special or the size adjusted perhaps?
  • The webcam image is the wrong way round (i.e. not inverted, so left is right and vice-versa) and there appears no UI option to change that.
  • I've used –set-rd-flags to set the device into R&D mode, but can't seem to get a root prompt – any ideas?

PulseAudio and GNOME

I've spent the last couple of hours playing with PulseAudio. Wow. How is this not installed instead of ESD on Fedora and GNOME? This is a sound system done the right way. It's quick, I've not found a bug yet, and it JUST WORKS. It works on Windows, Linux and BSD and works with avahi for new network and HAL for hotplug local sound devices.

In my opinion, “rm -rf esound arts alsa-dmix” – GNOME guys, why is this not an external dependency of 2.17.x?

Optimising GNOME for raw speed

A lot of very talented hackers have been working for the last couple of releases making GNOME work with smaller memory devices and using memory more efficiently.

Maybe we should focus on the other direction: SPEED. My laptop is a dual core 1.6GHz and has 1.5 gig of memory, and although that's quite a high spec now, in a few months that will be standard. Maybe we should be using more memory for on-disk caches and that sort of thing.

For instance, I startup the laptop, click Applications, click Programming and then the menu appears after about 200ms, and then the icons on the menu after another few hundred milliseconds. This isn't so great when other operating systems appear to have the menu appear instantly on start. Maybe we should cache as much as possible in memory at load?

I click the epiphany icon on the panel launcher. I wait over a second for the window to appear. Why? Internet explorer can appear in a tiny fraction of this on the same machine on Windows XP. I guess it's preloaded into memory, which isn't a problem with over 78% of my memory unused.

I click the terminal icon, the window appears quickly, and the prompt takes a few hundred ms to appear. Am I being impatient, or do we really have to wait nearly a second to launch essential applications?

Desktop Power Management

GNOME Power Manager already has quite a comprehensive DBUS API to allow it to interface with stuff like the brightness applet and gnome-logout screens.


Brightness applet working hand-in-hand with g-p-m

I think this is something that should be cross-desktop compatible, so that XFCE, KDE and GNOME applications can all play nicely. Something like a session service name of org.freedesktop.PowerManagement would be lovely. Of course, this requires standardization of a set API, which traditionally has been hard to agree on.
I've put up a list of the new DBUS API that gnome-power-manager presents, but before anyone stresses out about API compatibility the old API is present as well, except not documented there.
Please have a look through and tell me about any method or signal naming funnies, or areas that don't look right – or even descriptions that don't make sense to mere mortals. When I've got some initial feedback, I'll make the important changes to the new API, and suggest just the “required” DBUS methods to xdg-list for comments about using a org.freedesktop namespace.
p.s. Don't comment too much about the Register() and UnRegister() methods yet, they are just stub functions at the moment, and not tested by gnome-power-self-test at all.
Thanks for any help,
Richard.

Nouveau project fund

I've just pledged my $10 to the nouveau project fund to help replace the binary nvidia driver. This is unofficial i.e. the nouveau developers know about it, but the developers don't actually need that much cash for new hardware.
Initially I thought this was crazy, but after reading the blog entry by David Nielsen I think I understand.

We can say two things with this pledge:

  • People are willing to pay $10,000 of their own money to get a free driver. People don't want insecure binary crap.
  • Thank you to all the nouveau developers; I don't care if my $10 is not spent on hardware, but instead spent on alcohol and cigarettes. This is my way of saying thanks for doing this difficult and time consuming work. It's not easy coding on drm and Xorg without hardware specifications, and there's not that many people on the planet that could do this.

Building GNOME with cmake

Okay, after my last post where I discussed waf, I've been pointed to cmake. This is what KDE4 will use, and is meant to be better than automake.

I'll cut to my personal conclusions:

  • cmake would need lots of GNOME-specific extra modules written (for instance gnome-doc-utils) and POTFILES support.
  • cmake is fast to configure and build and has pretty output
  • cmake syntax is much more concise and easy to learn than m4
  • It's not obvious how you enable make dist or make check, although I'm new to all this
  • cmake has an optional gui based (easier to use in my opinion) configuration system.
  • Lots of useful modules have already been written, for example pkg_check_modules
  • Executing stuff like “libtool –mode=execute dbus-binding-tool” is quite difficult, although this should probably be wrapped up and abstracted in a module.
  • There are not that many standards in cmake, for example do you include directories before or after you've checked for dependencies? There would need to be GNOME guidelines on this sort of stuff.
  • The supplied examples are really simple, which don't help much.
  • It's a single system-wide install leaving single CMakeLists.txt in each directory. Very clean.
  • It's an established product with many people supporting it.

I have done some testing with gnome-power-manager and found it to be stable, and fast – although it does require you practically re-writing how the build is done.

So, anybody had any good or bad experiences with cmake? Thanks.