Archive for the 'forked-daapd' Category

Page 2 of 2

forked-daapd: v0.12, release tarballs

Hey, look, a release! I’ve decided to start making tarball releases that make it easier to build forked-daapd, especially on embedded platforms.

The tarballs come with the build system already generated (as should any real release) and they also contain pre-generated source files for the ANTLR3-based parsers used in forked-daapd. The pre-generated files will be used if antlr3 is not available for the build.

I expect that pretty much everybody will end up using the generated files, given the feedback I’ve had about ANTLR3. I hope this will also clear the misconception that forked-daapd depends on Java.

I have expanded the installation instructions, making the distinction between building from the git tree and building from the tarballs.

A few more fixes made it to this version since my last post, and Kai also put the final piece to the sort headers by adding sort headers to the song listings.

Tarballs are available at http://alioth.debian.org/~jblache/forked-daapd/. Tarball integrity can be verified with GPG using the matching GPG signature file and my F5D65169 GPG key from the Debian keyring.

forked-daapd: new features, Squeeze

A number of things have happened in and around forked-daapd in the last month or so, so let’s review the new features and the plan for Squeeze.

On the features front, Kai Elwert has done a lot of work since July to implement missing features at the DAAP and DACP level to get better support for Remote:

  • playlists can now be played from Remote;
  • listings are sorted in a way that’s closer to what you get from iTunes;
  • sort headers are now generated when requested so Remote can display the A-Z quick access list.

Also, forked-daapd can now remember which speakers were selected before shutdown and attempts to automatically reselect these speakers the next time around. Speakers that were selected will be reselected if they appear at most 5 minutes after startup and the player isn’t running at that time.

On the Squeeze front, a viable snapshot of forked-daapd will release with Squeeze. This snapshot doesn’t have all the Remote improvements listed above, although it’s got the playlist support, can remember the speaker selection and includes bug fixes.

My plan is to provide backports through backports.org once Squeeze is released and for as long as possible after that.

There’s always more in the works, so stay tuned =)

forked-daapd: available in experimental

Following the update of antlr3 in unstable, I have now uploaded forked-daapd to Debian. For now, and until the new version of antlr3 is ready to migrate to testing, forked-daapd will only be available in experimental.

I have also uploaded the ANTLR v3 C runtime (aka libantlr3c) to unstable. It’s currently blocked from migrating to testing, until antlr3 is ready to migrate.

Hopefully, the issues affecting antlr3 3.2 in unstable will be resolved soonish and all of this will migrate to testing and be part of Squeeze.

forked-daapd: now with AirTunes v2 streaming

I’ve been working on this for a few months now; it’s taken quite some time because I wanted to do it right and deliver something better than what already existed in the OpenSource world as far as that particular technology was (not) concerned. So here it is:

AirTunes v2 UDP streaming

forked-daapd can now do streaming to multiple AirTunes devices (as well as the local soundcard) and can be controlled from Remote (and, ideally, from anything that speaks DACP).

I’m releasing this early while the paint is still wet and not everything works on the DACP-side of things. Case in point, while playing a song or an album is supported, playing a playlist isn’t. There’s some work needed on this particular feature, and it’ll get there eventually.

There have been a couple of other changes in the codebase in recent weeks too; details after the jump.

Implementing AirTunes v2 has been quite fun and, in addition to releasing the forked-daapd code today, I’ve also taken the time to write down my findings about the protocol so others can experiment with it. This documentation is by no means exhaustive nor complete as far as the protocol goes; if you find out anything I haven’t, let me know so I can update this document.

Continue reading ‘forked-daapd: now with AirTunes v2 streaming’

forked-daapd: Remote support, more to come

A few weeks ago, I’ve added support for Remote, Apple’s iPhone application for controlling iTunes remotely. Here, “support” means Remote can be paired with forked-daapd and can be used to browse the library. And that’s it, for now.

At this point, there won’t be much visible activity on forked-daapd for some time. I’m working on a couple of things, but they take time and they require a lot of new code.

So, for a couple weeks now, I’ve been working on that. I have some code outside forked-daapd that is starting to work well, but it’s not there yet, far from it. Then it’ll have to be integrated into forked-daapd, which means a lot of new code there too.

Bug fixes will still happen in the meantime, and some smaller new features may also appear before the Big Thing™. So if you find or encounter bugs, feel free to report them still. If you have patches or ideas you want to discuss, feel free too.

As I wrote to a couple people by mail already, good things come to those who wait or contribute.

With all that, I’ve updated the Debian packages, given that there won’t be important changes for a while; I hope they’re useful to some of you out there. Note that I’m making an amd64 binary package available alongside the source package; it’s built on a current Debian unstable system, but if that’s not suitable for you, in terms of dependencies or architecture, you can trivially build a suitable binary package from the source package. As a reminder, I have packages of the ANTLRv3 C runtime too. I’ve also added antlr-3.1.3.jar there, in case you need it and can’t find it at the upstream download site.

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! :)

forked-daapd news: FrontRow support, TV shows

Over the past weeks, a couple of contributors sent me fixes and new features for forked-daapd. Thanks to you all!

The biggest change is the addition of TV shows metadata as found, for instance, in TV shows bought on the iTunes store. Together with the added support for FrontRow and QuickTime clients, this means forked-daapd is a lot more able at streaming video files than it ever was. Kudos to Ace Jones for his work!

Note, however, that you’ll need a patched version of ffmpeg to pick up the TV shows metadata from your MP4 files. At the time of writing, the patches have not landed into ffmpeg upstream yet, and it’s a bit unclear when this will happen. Contact Ace for the patch and instructions, see the commits in the git tree for his email address.

Git tree on Alioth: http://git.debian.org/?p=users/jblache/forked-daapd.git (git URIs on the page)

Releasing a rewrite of mt-daapd/Firefly Media Server

About a year ago, I bought a SoundBridge, having grown tired of running a media player on one machine or another to listen to music. The SoundBridge really fits my needs perfectly.

The server-side counterpart, mt-daapd (Firefly Media Server), on the other hand… not so much. Feature-wise, it works and does what it’s supposed to do, so the issues aren’t there.

The first issue was with the crappy, below-average packaging of mt-daapd in Debian. I’ve fixed that since I think, at least now it’s in a state where I’m not looking away from the screen while typing apt-get install mt-daapd.

The second issue came after looking at the code, while writing patches for Debian. Eek. It’s horrible in about every aspect you can think of. No coding standard, outdated comments, cruft everywhere, either #ifdef’d out or not, useless code left lying around inside functions, obvious memory leaks, and way more levels of indirection than is actually needed, let alone sane. Also, someone is clearly in deep and urgent need of taking “Pointers in C 101″. My eyes still hurt.

Well anyway, I’ve been contemplating either fixing it or rewriting it because I can’t stand such crappy code. Also, mt-daapd has been unmaintained upstream for something like 2 years, given that the upstream developer just pretty much disappeared.

So, with way more time on my hands than I’d like these days, I’ve finally jumped in, pulled the whole SVN into a git repository and started cleaning things up then rewriting it piece by piece. Good way to keep myself busy, producing something useful while doing so and playing with a couple new things.

This rewrite is called forked-daapd, for lack of a better name at the moment, it’s GPLv2+, and the code is available in a git repository at

git://git.debian.org/~jblache/forked-daapd.git

It’s not a feature-for-feature rewrite. I’ve tossed out a few things.

It’s Linux-only for a start, and then I’ve thrown out the web interface, the XML-RPC interface that goes with it,  the iTunes XML playlist support (only useful on Mac OS X) and the smart playlists. Maybe a couple other minor things I can’t think of right now.

It’s Linux-only because it uses signalfd and inotify. It’s built on libevent and pthreads, but doesn’t abuse threads either like mt-daapd does (spawning one thread per HTTP request … seriously). Parsers for the RSP and DAAP queries are built with ANTLR v3. Media handling is mostly done by ffmpeg, though ffmpeg suckiness in parsing metadata in some formats had to be compensated by dedicated metadata parsers. It’s a shame ffmpeg can’t handle raw FLAC streams with VORBIS comments, that is, bog-standard .flac files, while it goes to great length to support proprietary formats (though I should note it fails miserably on WMA too).

So, new things I played with: signalfd, libevent, threads, ANTLR, ffmpeg. Threads aren’t really a first, but I did some new things. inotify isn’t a first either, but it’s the first time I use it to watch events other than IN_CREATE or IN_MODIFY; that leads to quite some unhappiness towards the inotify API, which has some real shortcomings. I’m still shaking my head in disbelief.

It will happily support multiple concurrent clients, even when decoding media files to WAV, without abusing the machine it’s running on. I thought of adding more threading, especially in the decoding case, but I doubt this will be needed by anyone. Unless you’re streaming to hundreds of clients at the same time, which doesn’t look like a plausible usage scenario to me.

I don’t know where I’m going with this project. Right now it works for me and covers my needs. I’ve tested both the RSP and DAAP protocols with my SoundBridge, and DAAP with iTunes. I’m not an iTunes user so I may have skipped on the complicated things with iTunes, although I looked hard.

If there’s enough interest in this project, it can become a full-blown project on Alioth (it can even have a name that doesn’t suck!).