Monthly Archive for January, 2010

forked-daapd: FreeBSD & kFreeBSD port completed

Mostly an update to my previous post on the subject, I’ve just completed the FreeBSD port. It also builds and runs on GNU/kFreeBSD, by the way.

The filescanner for forked-daapd on FreeBSD is now up to par with its Linux counterpart, as much as possible. Contrary to the latter, it will lose some metadata (play count, for instance) when files get moved around, because it’s not possible to track moves and renames accurately. It also performs more rescans than the Linux/inotify implementation. Still, it works just as good.

On a related note, the machine I tried to install FreeBSD 8.0 on and finally ended up installing GNU/kFreeBSD on just seemingly committed suicide. I’m not sure what message it’s trying to send me. It’s previously been my main workstation for the best part of 10 years, so this is a bit sad.

At least I found some bugs in the process and fixed some too:

  • 2 bugs in forked-daapd, one of them a crasher,
  • a bug in Avahi on kFreeBSD,
  • a bug in GRUB2 as used on the kFreeBSD daily d-i images.

Not bad, is it?

forked-daapd: porting to FreeBSD

Since I released forked-daapd, I’ve got a couple of emails about porting it to FreeBSD. Apart from isolating and reimplementing the parts of the code using signalfd and inotify, there isn’t much work to do beside taking care of the usual libc/platform issues. However, when you don’t know the codebase and don’t know the APIs you’re replacing, it makes it a bigger job.

So, I’ve just spent a day going through FreeBSD documentation, installing FreeBSD 8.0 in qemu (because it wouldn’t install on my spare machine due to a bootloader issue that’s at least 5 years old…), and started porting the codebase.

A dozen or so commits later, forked-daapd builds and runs on FreeBSD.

With one caveat: the filescanner doesn’t update the database on the fly when the library directory is modified. While I’ve put in support for kqueue/kevent to replace inotify, it’s only a stub for now. Someone will have to write the code to actually act on the events and trigger the rescans/database updates.

kqueue/kevent delivers a lot less information compared to inotify, which means there’s a lot of work needed to track renames and moves. And I didn’t feel like doing it.

So, FreeBSD users: send patches! :)