FireFly is a nice DAAP based media server that allows you to listen to your music collection anywhere using any DAAP based client like iTunes, with other players (like Winamp, Rhythmbox, VLC, etc) using plugins, or it even has its own dedicated php/flash/java based clients that can be fired up on any platform any computer giving you instant nirvana.

Many people, like me, use it on their Routers or NAS boxes to access their music anywhere without having to keep their home PC running or lugging around external drives. However, development on this gem stopped some time ago. The last stable build released (2.4.2) was good but it doesn’t have a lot of features provided by the nightly builds in svn (subversion). And the last nightly build released (svn-1696) had a lot of broken things. It was rebuilding the database everytime, crashed around quite a bit, had a lot of security holes. So, I decided to get the latest version (trunk) of the FireFly code, as it had a lot of fixes for above issues, put in whatever was missing, and try to build it for my use.

After a day’s worth of efforts, here it is. This latest build is the most rich in features as compared to the stable one, and is just as stable as the 2.4.2 release if not better, and also fixes all the issues shown by the svn-1696 build. The downloadable source and complete install package are attached with this post. But I’m also listing down the steps that I took to achieve this so that if anyone wants to recompile it with their own options (e.g. I haven’t included ogg/flac support in my build), they are able to do so. You can find the steps below. Please let me know if you have any queries. Also, if you want to submit any patches, I’ll be happy to incorporate them and recompile. I’m also trying to get this source and package into the unslung/optware repositories for wider distribution.

Note: Although I’ve compiled this for Asus WL-500W, it should work for most devices with a mipsel architecture (which includes all the Asus routers in this family). Also, the compilation process should work for most other architectures barring one or two steps. I’d be happy to help if you want to do so and face any issues.

touch config.rpath (somehow this file is not provided with gettext for us)

change configure.in line 95, remove the ; at the end

remove -g flag and add -O2 in configure.in for optimization purpose

run “automake –add-missing”

run “autoconf” – to generate configure

ipkg install grep (for egrep)

change /bin/sh to /opt/bin/bash in configure and install-sh

run “./configure –enable-sqlite3 –prefix=/opt CPFLAGS=”-D_LIBC” ” (You can also use –enable-oggvorbis and/or –enableflac)

After this step, I had to make numerous changes to the source code to put in the missing functionality for database handling, removing some compilation errors, etc. You can diff the svn 1715 code with mine to see the changes.

run “make”

run “make install”

And you are done. The modified source and compiled bianries can be downloaded from below.

18 Responses

Hello Shantanu
Thanks for sharing your work, I’ve been looking for updates from 1695. FireFly is a great mediaserver, but there still are some issues …

I encounter some problems following your instructions , maybe you can give me a hint. I’m a linux noob and compiling has been a daunting task, but your list helped a lot. I’m compiling for the NSLU2 arm platform (synology 207+) and have been able to complete the steps until the make command
There I encounter an error compiling
–db.c:122: error: syntax error before “db_rwlock”–
some warnings follow about — implicit declaration of function `pthread_rwlock_rdlock’–
All are related to pthread.h
It is the only file that won’t compile. My impression is that the pthread_rwlock_t struct is not “known” at compile time, though the header file seems to be included.
maybe you have a suggestion?

Hello Shantanu,
I have done some reading through the headerfiles and saw #ifdef __USE_UNIX98 around the decaration of the pthread_rwlock_t struct. I removed that and was able to compile the db.c file.
That gets me one step further, still going! I’ll let you know if I get there in the end
Thimp

I did use the configure command as you described. I still had to uncomment the __Use_UNIX98 directive. After that it compiled OK, and I got firefly working (YAY!).

Nearly at the end: it crashes often (using the html management tool), and the bonjour service seems to be stopped, though ITunes finds the server. I’ll be looking into that. There might be some conflicts with old installations.
If I got it working smoothlessly, I’ll let it know.
Thanks again, Thimp

@Cary Adding to the DB without scanning would be awsome, please keep us posted!
My firefly servers is up and running for a long time now, only the smartplaylist interface brings it to his knees. But I’ve not been able to digg further into that.
Regards Thimp

@Cary: There seems to be a bug in processing m3u files. I don’t use this option but when I tried yesterday it crashed on me too when scanning on startup. For now, you can probably disable this and try using through web interface..

Firstly, thanks for sharing. I’ve tried several times to compile on OS X (Leopard and Snow Leopard) each time without success.

After running make a get error msgs such as these:

make[4]: Nothing to be done for `all’.
make[4]: Nothing to be done for `all-am’.
make[3]: Nothing to be done for `all-am’.
Making all in contrib
make all-recursive
Making all in init.d
make all-am
make[5]: Nothing to be done for `all-am’.
make[4]: Nothing to be done for `all-am’.

I did use the configure command as you described. I still had to uncomment the __Use_UNIX98 directive. After that it compiled OK, and I got firefly working (YAY!).

Nearly at the end: it crashes often (using the html management tool), and the bonjour service seems to be stopped, though ITunes finds the server. I’ll be looking into that. There might be some conflicts with old installations.
If I got it working smoothlessly, I’ll let it know.
Thanks again, Thimp

Prashant, I haven’t used DD WRT much (especially for development) so can’t tell you much but maybe the issue is because of some uclibc/glibc issues Can you try to compile it from sources for your system?

[…] router with custom firmware. For more info about how to set it up, you can check these posts: Latest Firefly server for your router and firefly sqlite error solution. For android side things, install the “DAAP Client” […]

[…] up but somehow didn’t preserve the firefly server. I rebuilt the server from source using my own guide (Thank God I did it. I wouldn’t have been able to preserve my sanity finding all that out the […]

I am glad I found your blog post. After changing my hardware from NSLU to a router with ar71xx based OpenWRT I look for a version of mt-daapd with working RSP. Does your code or at least the plugins work on my ar71xx based OpenWRT? Can you compile and share an package for me?