I had been getting bug reports that Banshee was not properly querying CDDB for track information on some discs. After some investigation, these discs turn out to be multi-session discs containing audio and data. It turns out that GStreamer (gstreamer-cdparanoia) does not generate a proper CDDB Disc ID, and even gives a warning about multi-session discs. That’s no good. Last night I set off to write a more direct approach to reading a CD’s Table of Contents.
I now have a mostly managed solution, using the Linux CD-ROM userspace kernel ioctls. However, the cdrom_tocentry struct for the CDROMREADTOCENTRY ioctl was a pain to marshal, so I added some C glue that will go in libbanshee. Ideally I’d like to marshal it and get rid of the glue. Obviously this will only work under Linux at the moment, but there should be no problem porting it to BSD et al. when necessary.
The important part is that the code generates proper TOC offsets for tracks, can calculate a proper CDDB Disc ID for plain audio and multi-session discs, and flags tracks as either audio or data, so the Banshee UI can hide the data tracks altogether.
For those interested, a standalone TOC reader is available. I’ll have this code merged in Banshee for the 0.9.8 release towards the end of the week.