jeudi 4 décembre 2008


Months go by, and it's once again time to start thinking about the upcoming FOSDEM. It will take place on the 7th and 8th February week-end in Brussels.

This year, we'll have a devroom, we'll be on our own on Saturday, but on Sunday we'll share it once again with KDE and, this is new this year, with XFCE for talks of crossdesktop interest. I just got the confirmation about the room, so organization on our side is just starting, but if you already know you are going to FOSDEM and want to give a talk, please contact me and tell me about it :)

Another good news is that we'll also have a booth (like last year). The not-so-good news is that there is noone dedicated to the organization of said booth yet, so we'd need a volunteer to coordinate everything as soon as possible :) Contact me!!! It's not complicated, you just need to ask for the GNOME Event Box, think about what can be shown on the stand, find a few volunteers to be present on the stand during the FOSDEM, ... All that is needed is a bit of time, there are lots of helpful people who can give really good advice about the organization :)

mardi 25 novembre 2008

Autumn update


In the last weeks, I finally landed a few patches for Rhythmbox iPod plugins that had been waiting for too long.

The first one adds a dialog to setup new (empty) ipods, courtesy of gtkpod. This was bug #358029 and the initial patch was made by James Doc Livingston.

The second patch was written by Ed Catmur and Paul Drain. Its purpose is to avoid copying duplicate tracks to the ipod. It's currently a bit simplistic, 2 songs are considered duplicates if they have the same title/album/artist. And the code doing that is factored in a generic function in the RBRemovableMediaSource class so other DAP sources can easily get the same behaviour. The fact that the duplicate check is made in a single function also means that we can easily replace this check with a more elaborated one (using audio fingerprints for example) in the future.

The 3rd (and last) patch has been made by John Daiker and adds a property dialog to the iPod source to see how much space is available on the ipod, to see the ipod serial number, device name, ... This code is specific to the iPod source for now, but seeing bug #561955 which asks for the same feature for MTP devices, there is probably some factoring to be done...

And, more or less related to this last bug, in the last days I worked on porting the Banshee SegmentedBar widget to C to be able to reuse it in Rhythmbox. After writing the GObject boilerplate for a new GtkWidget, the porting was pretty straightforward since Cairo/Pango mono bindings are really close to their C counterparts. The end result can be seen on this screenshot :

The code can be found in bug #561955 as a patch to Rhythmbox source. However, the widget code doesn't depend on any Rhythmbox code which means it should be easy to reuse in any GTK+/C project if you need such a widget. If you do so, please let me know about any bug or API issues you encounter since the code is really young and hasn't been tested much :)


On the libgpod front, not too many news. svn trunk is in a satisfying state and is probably releasable as is. The lastest ipod nanos and ipod classic are supported (with artwork and photos). As always, any testing with the latest ipods is welcome. We are also missing a few serial numbers for the new 16GB nanos, so if you own one, it would be great if you could send us the last 3 digits of its serial number (printed on the back) as well as its color.

The iphone 3g and the ipod touch with 2.x firmwares are not supported at this time, the song database needs to be checksummed to be valid, and noone has reverse engineered the hashing scheme yet. Moreover, Apple is making things difficult through code obfuscation and legal hurdles.

UPDATE: the EFF published this really interesting analysis of the issue

On a brighter side, the iFuse guys have made great progress to make USB communication to non jail-broken devices to work. Before their work, one had to jailbreak his phone and to talk to it through wifi to do anything with it. Now that's no longer necessary thanks to those guys.

Personal life

After a few years working as a team leader on Anevia's Video-on-Demand server, it's time for me to move on and to look for new exciting job opportunities. So if you are looking for an experienced C/C++ Linux developper, you are very welcome to contact me. My resume is available here.

jeudi 25 septembre 2008

Lutèce d'or

Yesterday, I attended the Cérémonie de remise des Lutèce d'Or (Lutèce d'Or awards). This is an annual event which is organised as part of Paris Capitale du libre (yeah, arrogant name, but we are French after all ;). This is a corporate event whose goal is to gather companies using free/open source software. The ceremony was great, free food in a really nice place except that I felt a bit out of place with my jeans and tshirts while everyone was wearing a suit ;)

But the most important (and most interesting) thing is that we (the GNOME project) won an award for the "Meilleure action communautaire menée" (best action led by the community) for the GNOME Outreach Program: Accessibility.

Getting this prize is really good since it give more exposure to our a11y efforts, even though now I really hate vuntz since he tricked me into going to this event instead of him and to go on stage to get the prize and say a few words with my tshirt (my best one!) in front of the suited audience. So no ice-cream for you Vincent!

mardi 29 juillet 2008

libgpod callout improvements

The other day, I mentioned that libgpod hal callout was setting volume.label to the iPod name to get a nicer name displayed for iPods in Nautilus (among other apps). What I didn't say is that I wasn't really sure that overriding that property with something that has nothing to do with the actual filesystem label was such a good idea.

And it wasn't. After asking David Zeuthen about that on IRC, he kindly told me about which was added explicitly for that purpose. And I also learnt about info.desktop.icon which is to be preferred to info.icon_name. So I made these 2 changes and pushed them to the podsleuth branch of my git repository.

While I was at it, I worked on the few things that are still in the way to a libgpod 0.7 release, ie I cleaned up the exported symbols to make sure what we export make sense from an API point of view, and I added some missing API doc and made a few fixes in the existing one (some functions were renamed and the API doc wasn't properly updated).

On an unrelated note, I'm glad to see that some people find this blog worth some comments, thanks ;)

lundi 28 juillet 2008

And my other project is...

After describing my latest work on Rhythmbox yesterday, here's what I did on libgpod in the last month. libgpod is a cross-platform library used by many different projects (amarok, gtkpod, rhythmbox, songbird to name a few) to access and modify your ipod content.

Extensive SysInfoExtended parsing

As has been known for a while now, the iPod can be queried about its capabilities using SCSI commands and returns XML data describing the iPod (serial number, firmware version, ...) and what it can do can do (podcast support, video formats supported, image formats that it knows how to display, ...). When we released libgpod 0.6, we introduced a hal callout to send the appropriate SCSI query to the iPod and to dump the returned XML data to a file that we named SysInfoExtended. Normal users aren't guaranteed to be able to send raw SCSI commands to a device, hence the use of a hal callout and the dumping of the information to a regular file. However, in libgpod 0.6, we only had a very basic parser for that file which only knew how to read the only SysInfoExtended field we needed. Most of the information about the iPod capabilities was hard-coded into per-ipod model tables, and libgpod had to be told the iPod model before being able to (for example) being able to write artwork to an iPod.

For the next release of libgpod, I decided that we had to be able to use the information from SysInfoExtended to its fullest. I started by writing a generic plist (which is the XML subset SysInfoExtended is in) to GValue parser using libxml instead of GMarkup. Then, I extracted the data I was interested in from the GValue collection the parser gave me to a nice C struct. To make the addition of new fields easy, most of the work is driven from a table indicating the field name in the plist file, the type we want to assign that field data and the offset we want to put that data in the resulting struct. Modifying that table and the struct definition are the only things that need to be done if we want to read additionnal fields from SysInfoExtended.

With that being done , I had everything I needed to have libgpod use the information provided by the device to write artwork to the iPod instead of relying on hard-coded tables. Some refactoring was needed to make it possible to use the artwork data from the iPod (there were some assumptions here and there that the formats supported by the iPod were known at compile time) but now that it's done, the code feels much more natural and maintainable than before.

Getting the iPod model from SysInfoExtended

With the aforementioned work, writing artwork to the iPod has been made much more flexible, but libgpod was still unable to automatically guess the iPod model/color/... from the device without asking the user. This is due to the fact that to do that, libgpod relied on the iPod "ModelNum" which used to be present in a file on the iPod filesystem but for quite some time now, the only way to get that model number is to read it on the iPod box, which is not really easy to do from software :)

But for all recent iPod models, there's another way to guess the iPod model, this is by parsing the iPod serial number. And this serial number is precisely one of the things that we can read from SysInfoExtended! So all we had to do to be able to automatically detect the model/color/.. of a plugged iPod was to properly parse the iPod serial number and to infer the iPod physical features from that serial number, just as what podsleuth does with that table.


Given that libgpod had already installed a hal callout, and after all the work done to parse the SysInfoExtended data, I realized that libgpod had gathered all the pieces to build a podsleuth clone, so I decided to try to write one just for fun and to test the new API added to libgpod in real-world situations. This led to the work which can be found in the podsleuth branch of my libgpod git repository.

Even though I haven't tested it against banshee, I compared the properties exported by podsleuth and by this experimental stuff, so this code can probably be used as a drop-in replacement to podsleuth. Writing it also made me realize that podsleuth doesn't export enough information about artwork formats compared to what libgpod needs. I'm also not a big fan of how podsleuth exposes the artwork formats: it parses the XML to get the artwork data to immediatly serialize it again to a string. It's then up to the app using podsleuth to parse that string (again) to get the artwork formats supported by the ipod.

Anyway, since I now have hacked this nice tool, it's now up to me to experiment a bit with all of that and to make suggestions as to how things could be improved :) By the way, I already used that code to see how iPod integration with the desktop could be improved: it sets the volume.label HAL property to the name of the iPod as extracted from the iPod database which results in a nicer name for the iPod on your Nautilus desktop.

dimanche 27 juillet 2008

blogo ergo sum

After being kicked again and again (which hurts, the guy is a black belt in karate) by Dodji who wanted me to blog, here is a first post.

Album Artist support

These last days, I've been trying to get back to Rhythmbox development to scratch a few itches of my own.
First, I've looked at how Rhythmbox could handle compilations, ie albums containing tracks by different artists. Currently, if the album has 12 different artists, these 12 artists will appear separately in the artist list which can quickly create a big mess. I wrote a basic patch to make it possible to set an "album artist" for such albums and to use that instead of the multiple different artists in the artist list. I had to experiment a bit with various approaches, but in the end, the patch is surprisingly small.

Song UIDs

Then, I wanted Rhythmbox to be able to provide UIDs for the songs in its database. What I call an UID is some kind of identifier that is unique to a song and that can be generated by only looking at the song data. This can be useful for various things : iPod (or whatever your portable media player of choice is) synchronization, associating user data (rating, play count, ...) to a song which persists even if the user does a mv of the song from the shell, ... I learnt after doing that work that Charlotte had been looking for such a feature in Rhythmbox for her nice Rhythmbox SOC which was good news :)

To generate that UID, I chose to hash the song title, artist, album (read from the tags of the song) with the first 8kB of data of the file (actually, this hashing scheme was heavily inspired by what Amarok does). I'm not sure yet if this is the best way to uniquely identify a song, but we'll only know after people try to use it. Before you ask, I thought about using musicbrainz/musicDNS acoustic fingerprints but as far as I know, none of those fingerprints can be generated using free software end to end, there's always some closed source webservice that must be queried to get a fingerprint from a few parameters that were generated by analyzing the song audio data.

Once again, this feature was straightforward to implement.

The main issue I had was to debug the UID generation. Indeed, metadata reading (where I chose to add the UID generation) is done by a separate process which communicates with Rhythmbox through dbus. Reading metadata is basically equivalent to feeding random data to the tag reading library, so it's really hard to guarantee the library won't crash or hang in some corner cases. Using that external process allows Rhythmbox not to crash or hang if such an event should occur during metadata reading.

But this external process also makes debugging harder: it's short lived, spawned on-demand and run in the background (ie it's not possible to print stuff to stderr or stdout). So moch's help was really welcome since he explained me how to be able to run that metadata helper process by hand and to tell rhythmbox to use it. It's really simple, all you have to do is to (optionally) increase ATTENTION_SPAN in metadata/rb-metadata-dbus-service.c so that the helper stays alive longer (by default, it dies after 30 seconds of inactivity).
Then, you can run rhythmbox-metadata in nemiver (or in your favourite debugger), this will output a line like :


If you now set the RB_DBUS_METADATA_ADDRESS environment variable to that value before running Rhythmbox, then Rhythmbox will use the metadata helper you just launched in your debugger. Now all that is left to do is debugging!

The result of this work can be found in the uid branch of my Rhythmbox git tree. It still needs some polishing, but the basics should already be working (including automatically updating your database to add UIDs when you first run it).