User:Delimiter/Firefly

From ConShell
Jump to: navigation, search

Introduction

In late 2006 I came across a server application called mt-daapd. Despite the terrible name, the app looked promising as a way to stream music files (namely .mp3 and .ogg) from my home music library to iTunes, Amarok and so on.

Soon it was revealed that mt-daapd was reborn as Firefly Media Server and was in part supported by Roku (which makes the Soundbridge lines of wireless network audio receivers). By the time christmas rolled around I found myself the lucky possessor of the M1000 unit.

Update (2007-Nov-27): I am now the proud maintainer of the mt-daapd (Firefly) port on FreeBSD. Update (2009-Mar-21): Use the newer audio/firefly port on FreeBSD instead of audio-mt-daapd which is now deprecated.

Configuration

The main configuration file is /etc/mt-daapd.conf

I make the following changes from defaults:

mp3_dir = /share2/music
extensions = .mp3,.m4a,.m4p,.ogg,.url
scan_type = 1
rescan_interval = 1800 <-- agressive, so be it
debuglevel = 5  <-- for some wordy logs
process_m3u = 1 <-- this ensures the Soundbridge get's playlists, might handy

Web Access

To access the firefly server using a browser, hit http://turing:3689/ (my server is running on the host named turing).

The password is set in /etc/mt-daapd.conf (mt-daapd by default). No username is req'd. To ensure configuration can be updated using the browser, make sure the perms on /etc/mt-daapd.conf are setup correctly, e.g. writable by the nobody user

Transcoding

I made the decision a long time ago to use Ogg Vorbis format for ripping my music because of the better compression vs. mp3 and also variable bitrate encoding (VBR). Support for .ogg format is hit-n-miss but luckily firefly offers the ability to to transcoding to mp3 format from ogg, flac. This is wonderful as it allows my other family members who use iTunes to enjoy the music stored in .ogg format without having direct support. To properly support ogg -> wav transcoding, ensure the following:

  • extensions in the configuration must contain .ogg
  • mt-daapd must have been built (compiled) with --enable-oggvorbis flag
  • ssc_codectypes in configuration must list ogg
  • ssc_prog in configuration must point to valid script to perform the transcoding (e.g. /usr/bin/mt-daapd-ssc.sh)

Note that I also had to adjust some paths in mt-daapd-ssc.sh (it needs WAVSTREAMER, OGGDEC at a minimum)

WAVSTREAMER=/usr/bin/wavstreamer
OGGDEC=/usr/bin/oggdec
FLAC=/usr/bin/flac

So you can see it also supports FLAC format.

Streaming playlist (Internet Radio)

My next endeavour was to be able to play Internet radio stations. The M1000 supports a handful of preselected stations out of the box, but we get crappy reception for some local stations where I live, including KEXP, KPLU and so forth. This procedure is documented somewhat in the Firefly wiki and forum, but I'll recount the steps here for future use.

1. Turn on m3u processing. This is the flag shown above. 1a. Add .url to the filetypes above. 2. Create a file /share2/music/iradio/kexp.m3u

#EXTM3U
#EXTINF:0,KEXP
/share2/music/iradio/kexp-128.url

3. Create the /share2/music/iradio/kexp-128.url file

128,KEXP Radio,http://kexp-mp3-128k.cac.washington.edu:8000/

Note, the URL in the file above gleaned from the http://www.kexp.org/ website.

4. Restart mt-daapd and use the 'Browse Playlists' function from the M1000 to see the kexp listing, followed with KEXP Radio

Related


FreeBSD specifics


added requirement os /usr/local/include/vorbis/codec.h: to BUILD_DEPENDS

firefly_enable="YES"
/etc/rc.conf: 108 lines, 3650 characters.
root@franco:/usr/ports/audio/firefly>/usr/local/etc/rc.d/mt-daapd start
Starting firefly.
plugins/plugin_dir not specified
Aborting

See some hints about building for FBSD 7

Basically the fix is to link librsp.so.0.0 to librsp.so

mdf@franco:/usr/local/lib/mt-daapd/plugins>ln -s librsp.so.0.0 librsp.so

(added some time later)... while your at it, create similar links for the other two libraries. Here is what my plugins folder looks like.

root@franco:/usr/local/lib/mt-daapd/plugins>ls -al *\.so
lrwxrwxr-x  1 root  wheel  18 Sep 23 21:48 libout-daap.so -> libout-daap.so.0.0
lrwxr-xr-x  1 root  wheel  13 Sep 21 14:07 librsp.so -> librsp.so.0.0
lrwxrwxr-x  1 root  wheel  20 Sep 23 21:50 libssc-script.so -> libssc-script.so.0.0


Now I get a new error...

008-09-21 14:07:54 (08101100): Opening database
2008-09-21 14:07:54 (08101100): Error opening db: No backend database support fo
r type: sqlite

root@franco:/usr/local/lib/mt-daapd/plugins>ldd /usr/local/sbin/mt-daapd
/usr/local/sbin/mt-daapd:
	libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x280dc000)
	libthr.so.3 => /lib/libthr.so.3 (0x281d1000)
	libid3tag.so.0 => /usr/local/lib/libid3tag.so.0 (0x281e4000)
	libz.so.4 => /lib/libz.so.4 (0x281f7000)
	libsqlite3.so.8 => /usr/local/lib/libsqlite3.so.8 (0x28209000)
	libvorbisfile.so.5 => /usr/local/lib/libvorbisfile.so.5 (0x2826d000)
	libvorbis.so.4 => /usr/local/lib/libvorbis.so.4 (0x28275000)
	libFLAC.so.10 => /usr/local/lib/libFLAC.so.10 (0x2829d000)
	libm.so.5 => /lib/libm.so.5 (0x282d6000)
	libogg.so.5 => /usr/local/lib/libogg.so.5 (0x282eb000)
	libc.so.7 => /lib/libc.so.7 (0x282f0000)

Solution: use --enable-sqlite and make sure libsqlite2 is installed. This is taken care of by the firefly port.