How to set up forked-daapd (mt-daapd replacement) on 9.10
Over the last several releases of Ubuntu, mt-daapd's transcoding has not worked for me out of the box. I had always been able to find a workaround (for example, for 9.04, see this post); however, 9.10 has me totally stumped.
In searching for a replacement, I came across forked-daapd (see also this firefly forum post). It does what mt-daapd does minus the web interface. I never used mt-daapd's web interface, so no loss for me there.
Note: The author has made AMD 64-bit packages available: forked-daapd and antlr3. If you're on i386 like me, keep reading.
Installing forked-daapd was a challenge. Thankfully, the author was kind and patient enough to help me get it up and running. Here's what it took.
Grab the forked-daapd package:
Code:
git clone git://git.debian.org/~jblache/forked-daapd.git
Read the README and INSTALL files so you know what's up. Panic when you read something about antlr3, discover that the stock Ubuntu version is too old, and discover that it has something to do with java. Now relax, I'll walk you through it.
Make sure you have the other required libraries installed (and -dev variants):
Libraries:
- glibc 2.9+ (for signalfd)
- Avahi client libraries, 0.6.24 minimum
- sqlite3
- ffmpeg
- confuse
- libevent 1.4+
- libavl
- MiniXML
- libflac (optional)
- taglibc (optional)
- libplist 0.15+ (optional - iTunes XML support)
Get antlr3 packages
I first installed the antlr3 packages from the repositories. Then I got the antlr-3.1.3.jar (http://www.antlr.org/download/antlr-3.1.3.jar). Edit /usr/bin/antlr3 and in the CLASSPATH variable replace the path to the antlr-3.1.3.jar you downloaded. Don't worry about the stringtemplate.jar.
Grab the C libraries for antlr3 at http://antlr.org/download/C (3.1.3). Build and install with the typical ./configure --prefix=/usr ; make ; sudo make install.
Configure and build forked-daapd
Assuming you got the required libraries and antlr3 packages installed, you're ready to configure and build forked-daapd. Enter its directory and run to build the configure script. I ran the configure script as recommended in the INSTALL:
Code:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-flac --enable-musepack
. Your configure options might be different depending on your needs. Run `make` and `sudo make install`.
Add user daapd
Forked-daapd will run with user daapd. I had to create the user on my system:
Code:
sudo useradd -r daapd
I also had to make sure user daapd could read my music library. I added daapd to the group music, which has read access to my library:
Code:
sudo usermod -G music daapd
groups daapd
(That last line just to verify.)
Point to your library in the conf file
The conf file is /etc/forked-daapd.conf. There's not much to configure, just point to your music library under "Directories to index."
Create directory for database
The database will live in /var/cache/forked-daapd so create that directory and make daapd the owner:
Code:
sudo mkdir /var/cache/forked-daapd
sudo chown daapd /var/cache/forked-daapd
Fire up forked-daapd with:
Code:
sudo /usr/sbin/forked-daapd
If you run into issues with your Soundbridge or other device not being able to see the server, check out this post to learn how to add the daap service to avahi. Mine was a holdover from struggling with mt-daapd.
Cheers!
Re: How to set up forked-daapd (mt-daapd replacement) on 9.10
I was wondering if you had a download link to a .deb install? Installing it through the .git with the avahi client libraries is creating conflicts
Re: How to set up forked-daapd (mt-daapd replacement) on 9.10
Thanks for the info. I just started using mt-daapd and ran across this. What are the benefits of forked-daapd? and what is the stability compared with mt-daapd?
I've really had no problems with mt-daapd so far other than a little confusion getting it set up the first time.
Thanks, Geoff
Re: How to set up forked-daapd (mt-daapd replacement) on 9.10
The main benefit to forked-daapd is that it is actively developed. If mt-daapd works great for what you need, there is no reason to switch. If you run into bugs or wish it had more capabilities, you're out of luck unless you want to get the code and fix/improve it yourself.
Forked-daapd is especially better suited to handling videos. In particular, it:
- Supports Front Row (for audio and video)
- Interprets iTunes TV metadata correctly
- Supports files > 2GB
In addition, I expect that it will be more stable and performant, because it was re-written from the ground up. However, that's only based on anecdotal information from people who run mt-daapd.
Here's my download/build/installation process for Ubuntu 9.10 Server 64-bit. This uses antlr-3.1.2, and configures it for 64-bit. I don't mess around with CLASSPATH only because this is the only java I ever use on my system. This also includes no optional features.
Code:
sudo apt-get install build-essential wget git-core git-doc autoconf automake libtool sun-java6-bin libavahi-client-dev libconfuse-dev libsqlite3-dev libavcodec-dev libavformat-dev libmxml-dev libavl-dev libevent-dev
cd /usr/share/java
sudo wget http://www.antlr.org/download/antlr-3.1.2.jar
cd ~/Source
wget http://www.antlr.org/download/C/libantlr3c-3.1.2.tar.gz -O - | tar xvz
cd libantlr3c-3.1.2
./configure --enable-64bit
make && sudo make install
sudo ldconfig
cd ~/Source
git clone git://git.debian.org/users/jblache/forked-daapd.git
cd forked-daapd
autoreconf -i
./configure --prefix=/ --exec-prefix=/usr --datarootdir=/usr/share ac_cv_prog_JAVA="java -cp /usr/share/java/antlr-3.1.2.jar"
make && sudo make install
sudo mkdir -pv /var/cache/forked-daapd
sudo chown <me> /var/cache/forked-daapd
sudo /usr/sbin/forked-daapd
That's good advice above to create user daapd, but I just configure it to run as me.
Re: How to set up forked-daapd (mt-daapd replacement) on 9.10
Re: How to set up forked-daapd (mt-daapd replacement) on 9.10
I followed the steps by Ace Jones, and when I get to the point where I make on forked-daapd, I get the following:
Code:
gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -D_REENTRANT -DDATADIR="\"/usr/share/forked-daapd\"" -DCONFDIR="\"//etc\"" -DSTATEDIR="\"//var\"" -g -O2 -Wall -D_LARGEFILE_SOURCE -MT forked_daapd-artwork.o -MD -MP -MF .deps/forked_daapd-artwork.Tpo -c -o forked_daapd-artwork.o `test -f 'artwork.c' || echo './'`artwork.c
mv -f .deps/forked_daapd-artwork.Tpo .deps/forked_daapd-artwork.Po
gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -D_REENTRANT -DDATADIR="\"/usr/share/forked-daapd\"" -DCONFDIR="\"//etc\"" -DSTATEDIR="\"//var\"" -g -O2 -Wall -D_LARGEFILE_SOURCE -MT forked_daapd-misc.o -MD -MP -MF .deps/forked_daapd-misc.Tpo -c -o forked_daapd-misc.o `test -f 'misc.c' || echo './'`misc.c
mv -f .deps/forked_daapd-misc.Tpo .deps/forked_daapd-misc.Po
java -cp /usr/share/java/antlr-3.1.2.jar org.antlr.Tool RSP.g
make[2]: Leaving directory `/home/bonnye/source/forked-daapd/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bonnye/source/forked-daapd'
make: *** [all] Error 2
Anybody know what I'm doing wrong?
Re: How to set up forked-daapd (mt-daapd replacement) on 9.10
Hmmm, somehow I got it to work. Couldn't tell you how, but I know I accidentally ran make after removing antlr, which obviously failed. I then reinstalled antlr and reran ./configure, then make without doing a make clean. Bizarre.
Re: How to set up forked-daapd (mt-daapd replacement) on 9.10
How can I crosscompile this on ubuntu on a system lacking glibc 2.9? I already found out I could use the headers instead of totally replacing and installing glibc (2.3.4).
I ask this because I'd like it to run this on my synology with ppc proc and jamvm as java surrogate (allthough it doesn't really need java to run). Other then that I'm at a loss how to go about this.
So, where my interest is focussed is on how to crosscompile this on a ubuntu box.
I already noticed how "your mileage may vary" with the provided installation guide.
EDIT: sorry not the headers but copying the include files from glibc-2.9 to /usr/include.
Re: How to set up forked-daapd (mt-daapd replacement) on 9.10
Hi,
regarding the java problems, I ran
java -cp /usr/share/java/antlr-3.2.jar org.antlr.Tool src/*.g
and then make.
After that, another problem:
gcc: @PHTREAD_LIBS@: No such file or directory
Does it sound like a variable in the Makefile that is not exported correctly ? seems also that there is a mispelling, shouldn't be PTHREAD_LIBS ?
Infact, 'make' runs the command:
libtool: link: gcc -g -O2 -Wall -D_LARGEFILE_SOURCE -o forked-daapd forked_daapd-main.o forked_daapd-db.o forked_daapd-logger.o forked_daapd-conffile.o forked_daapd-filescanner.o forked_daapd-filescanner_ffmpeg.o forked_daapd-filescanner_urlfile.o forked_daapd-filescanner_m3u.o forked_daapd-mdns_avahi.o forked_daapd-remote_pairing.o forked_daapd-http.o forked_daapd-ffmpeg_url_evbuffer.o forked_daapd-httpd.o forked_daapd-httpd_rsp.o forked_daapd-httpd_daap.o forked_daapd-httpd_dacp.o forked_daapd-dmap_helpers.o forked_daapd-transcode.o forked_daapd-artwork.o forked_daapd-misc.o forked_daapd-rsp_query.o forked_daapd-daap_query.o forked_daapd-scan-wma.o forked_daapd-scan-flac.o forked_daapd-scan-mpc.o forked_daapd-RSPLexer.o forked_daapd-RSPParser.o forked_daapd-RSP2SQL.o forked_daapd-DAAPLexer.o forked_daapd-DAAPParser.o forked_daapd-DAAP2SQL.o @PHTREAD_LIBS@ /usr/lib/libavahi-client.so -ldbus-1 -lpthread -lrt /usr/lib/libavahi-common.so -ldl -lsqlite3 -lavcodec -lavformat -lswscale -lavutil /usr/lib/libconfuse.so -lFLAC -lm -ltag_c -ltag -levent_core -lavl -lmxml -lantlr3c -lgcrypt -lgpg-error -pthread
Actually, in my config.log file I read
pkg_cv_MINIXML_LIBS='@PHTREAD_LIBS@ -lmxml '
Thanks,
Stefano
Re: How to set up forked-daapd (mt-daapd replacement) on 9.10
My linux environment is different in that everything can be found in opt/.. instead of usr/..
Furthermore java could be a problem unless I use jamvm. Some other packages have to be compiled by hand as well.
I think I need some real help here...or some patience. Info on both would be really appreciated.