Monthly Archives: May 2010

MP3 streaming with MPD in Ubuntu 10.04

Nov 13, 2010 update: 0.16 alpha3 build
mpd_0.16~alpha3+git20101108.46ab8d1-0ubuntu1~ripps1~lucid_i386.deb

I have not tested this build! My mpd box is now on 10.10 and I haven’t rebuilt mpd for it yet.

Sept 11, 2010 update: 0.16 alpha2 build
mpd_0.16~alpha2+git20100803.68c02fc-0ubuntu1~ripps1~lucid_i386.deb

June 13, 2010 update: an updated build mpd_0.15.10+git20100608.53f08a9-0ubuntu1~ripps1~lucid_i386.deb

As of mpd 0.15, there is built in support for http streaming as an output.   Rather than using Icecast, mpd does the streaming itself.    By default 10.04 uses mpd 0.15.4, however I had problems getting the built in http streaming to work.   Also, the build included in the repository does not have lame support so it could not stream mp3, only ogg vorbis or possibly flac which many players don’t support. For example, I’m using a Roku Soundbridge with does not decode ogg.

I figured a recompile was in order. The first thing I did was add the mpd trunk PPA to /etc/apt/sources.list

deb http://ppa.launchpad.net/gmpc-trunk/mpd-trunk/ubuntu lucid main
deb-src http://ppa.launchpad.net/gmpc-trunk/mpd-trunk/ubuntu lucid main

After that, I downloaded the source deb and modified debian/rules and changed DEB_CONFIGURE_USER_FLAGS to include –enable-lame-encoder.

DEB_CONFIGURE_USER_FLAGS += $(WITH_TREMOR) --enable-sqlite --enable-un   
--enable-ao --enable-openal --enable-wildmidi --enable-sndfile --enable-pipe-output --enable-lame-encoder

A rebuild required about 800MB of dependencies. The result is the latest version of mpd with built in support for mp3 streaming.

You can grab my .deb here: mpd_0.15.9+git20100520.8945736-0ubuntu1~ripps1~lucid_i386.deb

My mpd.conf has an output section that looks like this:

audio_output {
        type                    "httpd"
        name                  "mpd stream"
        port                    "8080"
        bitrate                 "192"
        format                 "44100:16:1"
        encoder               "lame"
}

To get your device or player to stream properly, you may have to give it a playlist file. This can be hosted on any web server or can even be a local file.

mpd.pls:


NumberOfEntries=1
File1=http://myhost:8080/