You are here

Go Solid Go!

I've been rather silent on the topic of progress in media devices. Part of this is that much of the work has happened behind the scenes. Just yesterday I spent hours editing device definitions in libmtp and libnjb so that they'd be able to propagate the correct vendor and product info through hal, because hal's handling of it leaves something to be desired. For instance, on my Creative Zen MicroPhoto, it correctly detected the vendor and product. Except that the part of the device detected as a portable media player was the USB interface for the device, for which the vendor was blank and the product name was "USB Interface."

Another reason for the long delay was a partially failed experiment that aimed to provide support for many different media devices via a centralized kioslave. It's not that this couldn't still happen, at some point, but it becomes extremely difficult to map protocols that have no notion of filesystems into a filesystem, and have filesystem clients behave properly. There was another foray into a different system that also ended badly -- mainly because there was no way I'd get it finished within a year, much less within a few months.

In the end it was decided that Amarok's device plugin system is really pretty decent, providing relatively bug-free and easy device management for almost every device on the market...and if it ain't broke, don't fix it. Of course, it's using tons of deprecated classes and methods, but as Trolltech says (my emphasis), "we recommend against using these classes in new code." Good point. So let's get stuff working, and then we can try to design a new, better system in parallel -- but at least something will work in the meantime.

So with that decision made, I worked on integrating with Solid. I'm happy to report that today, I plugged in my Creative Zen MicroPhoto, and it was instantly detected and the correct plugin selected. All I had to do was hit Connect. Screenshots:

The first screenshot shows what the media browser looks like with nothing plugged in. At that point, I plugged in my Creative Zen MicroPhoto, and you can see that it was detected and added to the device selector drop-down box:

After this, I hit the Connect button (it's the one on the top left) and artists were displayed. I hit the custom button just so you could see some of the details available:

So it's coming along. I expect this device detection to work on pretty much any kind of music player (except generic/vfat/UMS...more on that on a later post, when I have time to work on it), provided that:

  1. hal is installed and working.
  2. You are using a recent version of libmtp/libnjb for those devices. I've also worked with libkarma and libifp but have been unable to actually check them out to see how they're working since I don't have those devices. We're probably going to start a "send us your old media devices" thing going, so that I can work on all of them. libgpod was more hesitant about working with me, but there's a problem there anyways, as apparently you can't detect from the USB interface the iPod exposes what kind of iPod it actually is, without connecting to it. Feel free to blame Apple on this one, as it's probably on purpose in an attempt to keep you on iTunes. So there's a generic definition already in hal which should be (hopefully, pending testing, send me your old iPods) good enough to at least have it show up as an iPod. Once you click the connect button the library should be able to provide more info.
  3. Your distribution's package of the device access libraries installs the hal fdi files provided by the libraries. For some unfathomable reason many (most?) don't -- even my beloved Gentoo. So start bugging your package maintainers early, because if you don't have these installed, you're not going to get autodetecting goodness. Some of these may end up in the main HAL distribution (I have repo access so can add them in) but for many it doesn't make sense as they're constantly being updated or changed, and it would require changing in two places instead of one. (Also, some libraries generate these automatically, instead of having a fixed file).

So that's it for now. The next step is to get manual adding of devices working again. And after that, dealing with generic devices in a smart way (the way will be Banshee-compatible too...thanks to Aaron Bockover for the excellent idea!) In the meantime, watch out for the Amarok Device Donation Program. :-)

Continue reading "Go Solid Go!"