Icecast and Ezstream Configuration

Plugging a 64 GB USB stick with directories full of MP3 / OGG files into an always-on Raspberry Pi running Pi-Hole, one can use Icecast to stream them for clients on the LAN, so as to avoid over-the-Intertubes streaming issues.

The only changes in the /etc/icecast2/icecast.xml file cover passwords, the number of source streams, and the hostname. It’s that simple, really.

Given a directory of files, generate a file-per-line playlist:

find /mnt/music/goodmusic/ -name \*mp3 | sort > /mnt/music/goodmusic/playlist.m3u

Then set up a corresponding Ezstream XML file, perhaps imaginatively named goodmusic.xml:

    <svrinfoname>Good Music</svrinfoname>
    <svrinfogenre>Good Music Streaming 24x7</svrinfogenre>
    <svrinfodescription>Techno Dub</svrinfodescription>

Fire off the source stream in /etc/rc.local:

ezstream -c /home/pi/Icecast/goodmusic.xml &

The ampersand tells Bash to fire-and-forget the process, so it runs all the time. One could, I suppose, put it in crontab to start after each boot or puzzle out the corresponding systemd incantation, but …

Add the station to your streaming media player:

         'KEY_KP5'   : ['Good Music',False,['mplayer','-playlist','']],

And then It Just Works™.