GNOME Color Manager Progress

GNOME Color Manager now has a website. The mailing list will be set up soon, which means we can start building a community.

I’ve also recently completed the calibration integration, using the great ArgyllCMS to do the heavy lifting. This means it’s literally two clicks (with no options!) to generate an accurate screen profile with hardware that costs less than $50. And it only takes about 15 minutes. Anyone that takes photos or cares about colour accuracy should really invest in one of these things.

Calibration stage 4 of 5
Calibration stage 4 of 5

Also, a few people have been telling me to just write a GNOME front end for Oyranos and scrap what’s already been done. While I think Oyranos is a great project, I needed something that “just worked” and did the bare minimum integration without a hundred configuration options or integration points. I’ve also been told that some parts of colour management are heavily patented, and so I’m going to keep things as simple as possible for now so gnome-color-manager can be used in as many places as possible. If the Oyranos guys want to hook into gnome-color-manager then that would be great, but I think for now, GNOME Color Manager should aim to do much less than what the Oyranos guys have been trying to achieve.

GNOME Color Manager

Well, you could say I’ve been busy. I’ve had a couple of days off this week, and instead of relaxing like normal people, I wanted to fix ICC profiles on GNOME.

First the hard bit. You have to go to your screen vendors website, and download the “drivers” for your monitor. They’ll likely come in a zip file with other junk like .inf, .cat and other windows driver stuff. Somewhere in there should be a .icm or .icc file which contains the data you need specific for your monitor.

Double click on a ICM or ICC file.
Double click on a ICM or ICC file.

Then go to System->Prefrerences->Color Profiles and select the correct file for your monitor. There are also some other test files you can play with.

The default display
The default display

Then you can set any gamma or contrast or brightness settings if you wish. The gamma defaults to 2.2 just like newer Apple systems and Windows XP, but if you don’t like this you can set it back to 1.0.

The advanced display
The advanced display

You’ll need shared-mime-info from git master (for the double click to work) and gnome-color-manager from gnome git.

There’s still lots of work to do, such as:

  • New project icon
  • Help and man documentation
  • A website of some description
  • A mailing list
  • The calibration button to be wired up with hardware devices

I’ve ordered myself a Pantone Huey hardware calibration device, and soon hope to have this wired up to gnome-color-manager to make accuratly calibrating a device as easy as a single click.

Now, I’m all out of time for this little bit of fun, as I have to return back to fixing PackageKit and DeviceKit-power for the impending F12 release, but if anyone wants to help me with this I would be very grateful.

ICC Profiles and GNOME

I’ve got a multi-monitor setup here, with my T61 being my primary display, and a 28″ LG flatpanel as my secondary display.

I also take a lot of photos, and do editing in GIMP and Rawstudio and have noticed the colours on the LG are very different to the colours on the T61 screen. And when I print them, they bear little resemblance to what I just saw on screen. I’m almost thinking of buying a macbook and OSX just so I can actually see the colours I’m about to print. Heck, even Windows XP does things better than Linux does now.

I’ve done quite a bit of research, and found the general state of colour profiling to be, well, pretty hardcore, and in GNOME practically unusable. I can set my xgamma table using xcalib or dispwin, but this isn’t aware of xrandr setups and only applies the profile to a single screen. It’s certainly not a persistent setting or easy to figure out as it’s not installed by default.

In an ideal world I would visit System->Preferences->Color calibration (which is installed by default) and then either import the .icm file I’ve downloaded from the manufacturers website, or click a button and calibrate my display using an external calibration device. Certainly no commands on the root prompt, or typing in a bunch of hex.

So what am I thinking:

  • A gnome-settings-daemon plugin that applies ICC profile when a monitor is attached (or just integrate with existing xrandr plugin)
  • A gnome-color-calibration configuration UI that lists the attached output devices and allows you to associate profiles with them
  • Available colour profiles installed system-wide and also in the users home directory
  • One click calibration using supported devices (for instance ColorVision Spyder2)

Now, this colour problem is very complicated. There’s lots of work in applications to support other colourspaces and profiles and lots of very clever colour libraries (e.g. ArgyllCMS or lcms) but not a lot of work is being done to actually make this usable on the desktop.

Now, I’m very short on time these days, but would be very willing to co-maintain a project (or join an existing one) if other people are interested in this. I’ve got more than enough work to do with PackageKit, DeviceKit-power, and gnome-power-manager but I can spare a few hours a week to this as I think it’s a very important problem to solve. If it’s annoying me with my photography hobby, then it’s got to be a really big deal for professionals trying to use Linux. So, anyone interested?

PackageKit and debconf (progress)

There’s been a lot of noise about PackageKit and debconf in the past, but not an awful lot of coding… Until now.

Daniel Nicoletti is the maintainer of KPackageKit, and a log time contributor to PackageKit. He’s also the guy behind all the recent SimulateX() methods that required quite a bit of clever coding to work properly on all backends. The simulate methods alone make PackageKit much more useful with apt (where updating a package can remove another) and now he’s dealing with the debconf problem.

I’ll not repeat what he’s planning to do as all the details are available on his blog, but it basically involves adding a DBus frontend on debconf and telling packagekitd a private connection of a helper program running in the session. This means debconf can work in the standard PackageKit “no blocking” modes when required (e.g. for an unattended update) but also ask required questions when setting things up like MySql when running interactively.

I’ve still not changed my stance on asking questions and blocking during a package install, but with this new helper program and secondary session interface, a lot of the debconf headaches can go away. I’m sure all the changes might take a few weeks to even be prototyped, but it’s nice things are going in the right direction.

gnome-shell a week later…

A few people commented on my blog after my last post, and asked me if I actually liked GNOME Shell. My last post wasn’t meant to be stinging criticism, more pointing out things that need to be addressed before we can call this the shell of GNOME 3.0. I’ve filed lots of bugzillas (some already fixed!) and I’m pleased to say that most of the issues I’ve brought up the developers seem keen on addressing. Owen has been working hard on the theming code, so hopefully I can get a less white-on-black theme for my little old eyes. Dan has been working on multi-monitor support, and it’s much better already. I do heartily recommend installing mutter and gnome-shell from gnome git, rather than using the distro built packages, as it’s all being implemented / fixed so quickly.

I do think I’ll be sticking with GNOME Shell, as it really is some cool stuff.

GNOME Shell Preview

I’ve been unwell the last couple of days, and with a muzzy head programming isn’t that easy. So I decided to try out gnome-shell and document some of my initial findings. The following finds are purely subjective and my own opinions only. Comments are welcome telling me I’m being a moron, or that an issue is fixed in a newer release. I’m currently using the newest packages in Fedora rawhide.

  • In general, everything seems slower. The animations are a nice touch initially, but I find they actually slow down my workflow. I’m not the sort of person that likes compiz for this reason either.
  • I’ve not got a window list anywhere, so I find I’ve got about 40 nautilus “Home” windows open at any one time.
  • I use a dual screen, and quite a lot of the UI appears centered in the virtual screen, which is not that nice when one panel is slightly different size to the other, with about 2 inches between them. For instance forĀ  the time, one panel has “Wed 10” in the top right, and the other panel has “22 AM” in the top left. Also, totem when watching a movie seems to be put halfway between each workspace in the preview screen, but appears on neither side of the workspace if you click on it. There are 4 or 5 different UI bugs that I need to research and file.
  • I really don’t see the point in having a giant top bar with only the current running application on it, and the time. Seems a giant waste of space. I also don’t think it needs to be on across all screens on a multi-monitor display.
  • I often use the dual screen to display two documents at once, if I’m comparing photographs or looking at code and a debugger. Every time I go back to the preview menu screen I’m forced to choose a single window, and other windows get arranged and stacked seemingly randomly.
  • I can’t seem to click on the status area icons when in the sidebar mode. This seems an artificial limitation.
  • There isn’t a way to clear the recent documents list, so if I’m working on a confidential document with a sensitive filename, I can’t show anyone my menu or take a screenshot (which I wanted to do for this blog entry…)
  • I can’t find any way of getting access to the preferences menu items (e.g. to change my mouse acceleration), other than typing in “mouse” into the search bar, which didn’t exactly seem intuitive.
  • Black menus and notifications are not really my colour, and I couldn’t find a way to chose anything else.
  • There appears to be no configuration at all. I know tweaking things is the devils work, but no configuration allowed at all?

So, it’s certainly very different to what we’ve had before, but you can clearly see it’s a preview, not a final release. It’s certainly not useful to me as a production desktop just yet.

A new glib library for PackageKit

For the last couple of weeks I’ve been re-writing the existing PackageKit-glib bindings. The old library was beginning to limit what we could do with client applications. The biggest problems were:

  • A lot of the dbus calls are sync, which slowed down application startup and user input “snappyness”
  • A lot of the methods were not cancellable
  • It’s very hard to add details and update details about a set of packages, without caching all the data in the client
  • Having to “reset” a single heavyweight client instance before doing each operation (mitigated in some respects with PkClientPool)

As the days have progressed, I’ve slowly add more functionality to the packagekit-glib2 library, with the aim of removing the original glib library for 0.6.x. After two weeks of hacking, I’ve deprecated the glib1 library, with everything in the PackageKit git master tree is now using glib2. Overall, working with everything asynchronous works really well. The GUI clients benefit the most, although it makes the text clients much simpler too:

[hughsie@hughsie-laptop client]$ wc -l pk-console*.c
 2580 pk-console-glib1.c
 1625 pk-console-glib2.c

One of the main benefits is that the “dance” (the multiple transactions) can be done asynchronously, and completely hidden from the client. To do this, I’ve got the following classes:

  • PkControl: For getting properties on the main interface, and doing methods such as GetTid
  • PkClient: For scheduling a single transaction
  • PkResults: For storing the completed results of the transaction (packages, update-details, all the compound objects)
  • PkProgress: For storing current progress, for passing to async clients
  • PkTask: For managing the “dance”, for instance, requeuing transaction for simulate, gpg-keys, eulas and for trusted. It superclasses PkClient.

Now, PkTask on it’s own isn’t very interesting, as it fails at every step of the dance by default. PkTask does however have klass methods that can be overridden by classes implementing PkTask. There’s an example I made for the “make check” functionality called PkTaskWrapper which basically accepts each step of the dance without asking the user. More interestingly, there’s a class called PkTaskText that implements PkTask and handles all the callbacks using console commands like fgets. That’s what text stuff like pkcon and pk-debuginfo-install are now using, and why they are a lot smaller now.

This means that pkcon can create an instance of PkTaskText, and all the interactions are done for it in the PkTaskText object. The actual interaction is hidden from pkcon, and all it gets is the progress callback as the transactions are scheduled. And because PkTaskText can be used as a PkTask, it can also be used as a PkClient, so the methods that are not wrapped can be used with a single object. It also means that other clients can just use PkTaskText and get all the complex interaction stuff handled automatically.

Of course, in gnome-packagekit, it will make things much cleaner as each PkClient can be converted to use an async GpkTask, which will handle all the interactions. So, instead of having all the scary logic about what methods to send in response to different signals and return codes in multiple places, we can just derive from PkTask and do them all in one place. Of course, moving from a 80% sync library to a 99% async library is going to be hard for projects that make heavy use of libpackagekit-glib. The most obvious example is gnome-packagekit, and so far I’m already about 80% they way through. Diffstat reports “59 files changed, 6311 insertions(+), 8684 deletions(-)” with the majority of porting work just switching code to use the async variants. When it at least compiles I’ll push it to git master, but until then it lives in the glib2 git branch.

The new code is much cleaner, more debuggable and most of all supportable, so when 0.6.x is released (a few months away) we can remove a metric ton of code (~20000 LOC) from the server. In preparation we’ve written a porting guide, although it’ll get more love when the design for packagekit-glib2 is set in stone.

PackageKit and device rebinding

A few people mentioned on my last blog post that instead of nagging the user to unplug or restart, we should just rebind the device. I didn’t do this yesterday as it was quite hard to do the layering correctly as the session is running as a normal user.

But of course, doing things correctly is often harder than doing things quickly. I’ve merged an optional helper into PackageKit that just pokes the hardware in the right place to make it rebind and re-request firmware. This is all done using the pkexec functionality in PolicyKit1, and a custom policy rule.

Device has been virtually unplugged and plugged in
Device has been virtually unplugged and plugged in

If you want this new functionality you need to build contrib/device-rebind in the PackageKit project, and also have GUdev and PolicyKit1 installed. If you don’t have these things, the session will fall back to just asking the user to reboot.

Ohh, and if the rebind fails in any way, we just fall back to asking the user to re-plug or restart like we did before. Device rebind functionality is currently Linux specific, but patches for other operating systems welcome.

PackageKit and firmware

For a few months now, PackageKit has been able to install firmware for devices. Sometime in 0.5.x series the functionality broke, so I spent the morning fixing up the module properly.

So, when you start your session (or insert the device), you get greeted by:

Firmware request
Firmware request

Notice, we now display the device model, but in this case where a device is waiting for firmware, normally the results are not complete and thus not pretty. USB WLAN is the best we can do in this case. If the user clicks install, the install continues in the background, and then the user gets a few minutes later:

Replug please!
Replug please!

but if it’s not a removable device:

Restart please!
Restart please!

Of course, you’ll need a pretty new distribution to have GUdev installed, but if you don’t it’ll fall back to being unhelpful.