Libnotifytastic

Every now and then, somebody chastises me for abusing libnotify to display something to to user. I guess it’s easier to just spam a fire-and-forget notification that thinking about how to present the data properly to the user.

A classic example is the messages the PackageKit daemon passes to the client program. These messages are packets of data containing the message type and any specific details. An example of this might be a message telling you that a config file has been automatically merged, or that a non-critical error has been worked around. These also tell you when things like prelink fail, which is a pain when you’re running something like rawhide. These messages arrive as the transaction is running, and are designed to be shown to the user at the end of the transaction and not get in the way.

Now, due to some “just get it working as quickly as possible” design standards, I used libnotify to display these to the user. Bad me. My excuse is that I’ve been very busy with other stuff, and life seemed to get in the way over Christmas.

Now I guess the right way to show the user this sort of data is for an icon to appear, something like this:

When the icon is clicked, something like this would appear:


So comments and feedback appreciated. No code in git yet, until it looks nicer. Thanks.

Microcode pushes and pulls

Every time I start my laptop, I get a firmware request from the kernel for /lib/firmware/intel-ucode/06-0f-0b for a microcode update. This fails, and no package provides it, but I would like to know why the kernel is requesting this. As far as I knew, all microcode is located in microcode.dat, and pushed from userspace to kernel using microcode_ctl, rather than the kernel requesting it itself. If I can’t find any explanation, I’ll just block all microcode requests in the client to avoid PackageKit users having searches automatically done for files that aren’t going to exist.

Help appreciated. Thanks.

Working at Red Hat

About two years ago, I was at a conference with a load of GNOME people. I mentioned over drinks to two friendly Red Hat hackers, that I had an idea about a packaging framework. It was just an idea, as I was working for a large defence company, and had precious little time to maintain gnome-power-manager, let alone start anything new.

Nearly a year ago, I was hired by Red Hat to work on power management stuff. Now, my boss is one of those cool bosses that gives you quite a bit of ‘space’ and with his blessing I started to hack on PackageKit. 18 months later PackageKit is feature-complete, and the defacto standard across a dozen or so distributions.

Every week or so, I put up a new screenshot on this blog of cool stuff I’m working on. Every week people critique my ideas, and I go away to fix them up so the next version is that little bit better. Every week a few people say thanks, and tell me I’m doing some cool stuff, which is nice.

I don’t want people to think that PK or DK-p are Red Hat projects, but the simple economics is that they pay me to hack on cool projects. Whilst working at Red Hat I’m working alongside the very best people in the industry, in an environment that rewards innovation and thinking a little bit different.

What I’m trying to say is, most things you see on this blog are possible because of Red Hat. Sometimes I feel Red Hat doesn’t get the credit it deserves. Red Hat Rocks.

[CVE-2008-4311] DBus 1.2.6

Please don’t yet update DBus for CVE-2008-4311. It’s known to break PackageKit, cups, ConsoleKit, DeviceKit, DeviceKit-power, gdm, and system-config-services. There’s a partial bugfix that has been pushed so PackageKit tools still run (without the GetTid or SetLocale errors), but as introspection is still broken they’ll be odd little warnings and errors for other stuff.

I do understand how important this update is, but given this wasn’t a root login vulnerability, or anything crazy like that, I’m surprised it didn’t sit in updates-testing for a few days to fix up all the other system daemons. The worst bit is that it’s broken automatic updates for thousands of people.

I’m planning to spend this morning closing duplicate bugzillas. Fun.

Command not found

I’ve been quietly admiring the Debian BASH command not found functionality for a while. For those unfamiliar with the functionality, it suggests installing packages if you typed a command that is not installed. It also seemed to be pretty helpful suggesting replacements for typos.

When Rahul opened a bug to include this in Fedora, I figured this is just the sort of thing a framework like PackageKit needs to hook into. Roman Rakus put a simple patch in Fedora for bash, and now we’ll try to get it upstream. Then it will work on all distros that support PackageKit.

I spent this afternoon hacking a simple implementation. It’s up to the distro whether it should be installed by default on a base install. It’s also pretty configurable, so if you just want it to launch lshal everytime you type lshla, you can have that. If you want it to ask you before it installs shed to provide /usr/bin/shed, then that’s possible too. The simple configuration file is available here for review.

There’s also a screencast available if you want to see all the hotness.

PackageKit and Pango are now friends

PackageKit in git master has a new trick up its sleeve. Thanks to Behdad, It now optionally installs a gtk-module that integrates with Pango to detect when a document needs a new font installed to render correctly. No code changes are needed to any application using Pango, as all the magic is done in the gtk-module. When used with a session interface like KPackageKit or gnome-packagekit, the following UI is shown:

Font installer
Font installer

I really want a way of being able to say “don’t ask about this language again” if not found so to not piss off the user. I also know my grammar is pretty shitty. All comments and recommendations gratefully received. Thanks.

GStreamer vs. Windows Media Player

I’ve always been quietly impressed with GStreamer — in a world of multimedia where everything is so complicated, applications using GStreamer pretty much “just work” without any problems.

This was until today. I subscribe to a Polish TV archive, that has archived versions of soaps my girlfriend enjoys (M jak miłość). Windows Media Player 11 plays the mms stream perfectly, with no visual artifects or sound skipping, but in totem the video is unwatchable. As a further point, mplayer seems to play this mms stream with no video glitches, and only an occasional audio blip.

On gstreamer-0.10.21-2.fc10.i386, using playbin and debug level 2, I get:

0:00:11.977812682 15562  0x8ab4e50 WARN              asfdemux asfpacket.c:104:asf_payload_find_previous_fragment: Previous fragment does not match continued fragment
...
0:00:19.046052292 15562  0x8ab4e50 WARN              asfdemux asfpacket.c:336:gst_asf_demux_parse_payload:<asfdemux0> Offset doesn't match previous data?!
0:00:19.046086304 15562  0x8ab4e50 WARN              asfdemux asfpacket.c:104:asf_payload_find_previous_fragment: Previous fragment does not match continued fragment


Which I guess means the payload timestamps are wrong, then then I get about a bazillion of:

0:00:31.263371321 15562  0x8e0b408 WARN              GST_PADS gstpad.c:2992:gst_pad_iterate_internal_links_default:<selector_video_src1:src> Making unsafe iterator
...

and then when it skips:

0:00:36.949382321 15644  0x9d0c538 WARN         baseaudiosink gstbaseaudiosink.c:1395:gst_base_audio_sink_render:<audiosink-actual-sink-pulse> warning: Compensating for audio synchronisation problems
0:00:36.949410537 15644  0x9d0c538 WARN         baseaudiosink gstbaseaudiosink.c:1395:gst_base_audio_sink_render:<audiosink-actual-sink-pulse> warning: Unexpected discontinuity in audio timestamps of more than half a second (0:00:00.649705215), resyncing
WARNING: from element /GstPlayBin:playbin0/GstBin:abin/GstAutoAudioSink:audiosink/GstPulseSink:audiosink-actual-sink-pulse: Compensating for audio synchronisation problems
Additional debug info:
gstbaseaudiosink.c(1395): gst_base_audio_sink_render (): /GstPlayBin:playbin0/GstBin:abin/GstAutoAudioSink:audiosink/GstPulseSink:audiosink-actual-sink-pulse:
Unexpected discontinuity in audio timestamps of more than half a second (0:00:00.649705215), resyncing
...

This makes the video unwatchable. I’m guessing the server is somehow broken, but it works in Windows Media Player perfectly and 99% okay on mplayer.
Any help on how to debug this or report a proper bug gratefully received. Thanks.