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.
Changes and Build Steps:
- ipkg install optware-devel
- ipkg install buildroot
- Edit /opt/share/aclocal/audiofile.m4 and change AC_DEFUN(AM_PATH_AUDIOFILE, to AC_DEFUN([AM_PATH_AUDIOFILE],
- ipkg install gettext (for some missing m4 macros, libr_rpath etc)
- Comment out AC_USE_SYSTEM_EXTENSIONS in configure.in (using dnl)
- aclocal -I <path of mt-daapd’s local m4 dir>
- run “autoheader” to generate config.h.in
- 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.
DOWNLOAD: Updated MT-DAAPD for Asus WL-500W router
Let me know if you have any queries or face any issues.



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?
Thanx, Thimp
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
Did you use the _LIBC flag as I mentioned for the configure command? That will enable the __USE_UNIX98 macros in the build.
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
I am trying to compile this version of firefly on an dLink DNS-323 with ffp 0.5 installed.
I had to manually edit /ffp/include/features.h and comment out the #undef __USE_UNIX98 line, and then specify CPPFLAGS=”-D__USE_UNIX98″ on the configure line.
BTW the notes above say CPFLAGS, I think you meant CPPFLAGS.
Anyway, I hope to modify the source to use the file change notification subsystem to add new files into the DB without having to do a scan.
@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
I was able to build the mt-daapd, but it did not run correctly – it crashed processing the .m3u files.
@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’.
Any insight on your part?
Thanks in advance
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
Can anyone share the binary for nslu2 with me?
Unfortunately when I run your binary in DD WRT, I get:
mt-daapd: can’t resolve symbol ‘__ctype_b_loc’
Any ideas if this is fixable?
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?
Is your version suitable for FreeBSD? I have been running svn-1696 for a very long time on Gentoo Linux. My migration to FreeBSD 8-Stable gives me a headache with firefly.
Thanks
[...] 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 [...]
Simply try to add:
#define _XOPEN_SOURCE 500 /** unix98? pthread_once_t, etc */
at the beginning of file db.c as of 1696 version like this:
…
#ifdef HAVE_CONFIG_H
#include “config.h”
#endif
#define _XOPEN_SOURCE 500 /** unix98? pthread_once_t, etc */
#include
…
No need to use CPPFLAGS during configure process and working on my wl-600g customized firmware.
Hello,
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?
regards
Jürgen