Icecast and Musicpd
Introduction
As my laptop's music collection was getting larger and I was wanting more elbow room, I decided it was finally time to offload most of it to a remote machine and figure out some way to access it easily via the internet.
Setting up Icecast2
The first step was to install Icecast2. I did this from audio/icecast2 in ports, but it can probably be done via pkg_add instead. Once installed, it should be configured. It seems that /usr/local/share/icecast/doc/ has some config examples. In the configuration file, the <source-password>, <admin-password>, and <bind-address> are the main fields that I changed. As I want to be the only one listening to this (which is to say didn't want the stream shared via the internet), I set <bind-address> to 127.0.0.1 . I also changed <user> and <group> to be nobody as I had been starting the server as root.
Setting up MusicPD
The second thing I did was set up musicpd. As the version in ports doesn't yet support streaming to the icecast server, I had to grab the version from their svn (this requires having subversion installed). Go to a directory of you choosing and try this:
svn co https://svn.musicpd.org/mpd/trunk musicpd cd mpd ./autogen.sh
Now, as autogen.sh (probably a way to make it do the right thing) didn't actually do everything quite right for me I had to export LD_FLAGS=-lc_r and then the following:
./configure --with-libFLAC=/usr/local/ --with-ogg=/usr/local/ \ --with-vorbis=/usr/local/ --disable-tremor --enable-shout \ --enable-ogg --disable-ipv6
Each of these arguments is for a reason. FLAC, ogg, and vorbis install in /usr/local/wherever on freebsd and I guess that the script assumes them to be elsewhere. --disable-tremor is required because tremor and shout are mutually exclusive for mpd. --enable-shout enables shout protocol streaming (which icecast2 uses) and --disable-ipv6 was necessary to overcome a bug with musicpd on freebsd. After that:
gmake