Tested on Barrier Breaker, LEDE 17.01, OpenWrt 18.06 and 19.07.2 (does not work on newer releases, see below)
WARNING: DO NOT upgrade from libopenssl 1,0 to 1.1 or ICES won't work anymore.
note: USB /overlay extra space is needed to locally store the ".ogg" music files or else you need to mount an external network storage for this (adapt music path in config files for this case).
- install software:
opkg update
opkg install libshout ices libtheora libspeex alsa-lib kmod-sound-core kmod-input-core icecast libxslt libcurl libvorbisidec librt
opkg install wget openssl-util
opkg install libustream-openssl ca-certificates
- disable icecast autostart at boot:
/etc/init.d/icecast disable
/etc/init.d/icecast stop
- create local user (icecast does not start as user root)
opkg install shadow-useradd
useradd pilovis
passwd pilovis
mkdir /home
mkdir /home/pilovis
chown pilovis /home/pilovis
- remove icecast default configuration file:
cp /etc/icecast.xml /etc/icecast.xml.orig
rm /etc/icecast.xml
- edit new icecast configuration file:
nano /etc/icecast.xml
<icecast>
<!-- LIMITS -->
<limits>
<clients>10</clients>
<sources>10</sources>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<burst-on-connect>1</burst-on-connect>
<burst-size>65535</burst-size>
</limits>
<!-- GENRIC -->
<authentication>
<source-password>changeme!</source-password>
<admin-user>admin</admin-user>
<admin-password>changeme!</admin-password>
</authentication>
<hostname>localhost</hostname>
<listen-socket>
<port>8000</port>
</listen-socket>
<fileserve>1</fileserve>
<!-- PATHES -->
<paths>
<!-- basedir is only used if chroot is enabled -->
<basedir>/usr/share/icecast</basedir>
<!-- Note that if <chroot> is turned on below, these paths must both
be relative to the new root, not the original root -->
<logdir>/tmp</logdir>
<webroot>/usr/share/icecast/web</webroot>
<adminroot>/usr/share/icecast/admin</adminroot>
<!-- <pidfile>/usr/share/icecast/icecast.pid</pidfile> -->
<!-- Aliases: treat requests for 'source' path as being for 'dest' path
May be made specific to a port or bound address using the "port"
and "bind-address" attributes.
-->
<!--
<alias source="/foo" destination="/bar"/>
-->
<!-- Aliases: can also be used for simple redirections as well,
this example will redirect all requests for http://server:port/ to
the status page
-->
<alias source="/" destination="/status.xsl"/>
<!-- The certificate file needs to contain both public and private part.
Both should be PEM encoded.
<ssl-certificate>/usr/share/icecast/icecast.pem</ssl-certificate>
-->
</paths>
<!-- LOG -->
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<playlistlog>playlist.log</playlistlog>
<loglevel>1</loglevel>
<logsize>10000</logsize>
<logarchive>1</logarchive>
</logging>
<!-- SECURITY -->
<security>
<chroot>0</chroot>
<changeowner>
<user>pilovis</user>
<group>nogroup</group>
</changeowner>
</security>
</icecast>
- create and edit ices configuration file:
nano /etc/ices.xml
<ices>
<!-- GENERIC -->
<background>1</background>
<pidfile>/var/run/icecast/ices1.pid</pidfile>
<!-- LOGGING -->
<logpath>/tmp</logpath>
<logfile>ices1.log</logfile>
<logsize>2048</logsize>
<loglevel>3</loglevel>
<consolelog>0</consolelog>
<!-- STREAM -->
<stream>
<metadata>
<name>Radio88</name>
<genre>Varios</genre>
<description>OpenWRT Test Radio</description>
<url>http://openwrt:8000/</url>;
</metadata>
<input>
<param name="type">basic</param>
<param name="file">/root/playlist1.txt</param>
<param name="random">1</param>
<param name="once">0</param>
<param name="restart-after-reread">1</param>
</input>
<instance>
<hostname>localhost</hostname>
<port>8000</port>
<password>changeme!</password>
<mount>/Radio88</mount>
</instance>
</stream>
</ices>
- download some free .ogg music files in /root/music directory:
https://patrickdearteaga.com/royalty-free-music/
mkdir /root/music
cd /root/music
wget https://patrickdearteaga.com/audio/Not%20Giving%20Up.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Spring%20Village.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/La%20Llamada%20de%20Ile.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Las%20Dos%20Fronteras.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Vals%20de%20su%20jard%C3%ADn%20A.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Voices%20From%20Heaven.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/No%20Place%20For%20Straw%20Cowboys.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Lyonesse.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Friends.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/I%20Miss%20You.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Kiss%20And%20Goodbye.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/2nd%20Sonata%20-%20Malign%20Chords.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Anguish.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Blues.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/El%20Postre.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/My%20Memory%20Lane.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Meitpower.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Lord%20Mavras.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/La%20Verdad.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Helplessness%20in%20Kowasni.ogg --no-check-certificate
wget https://patrickdearteaga.com/audio/Happy%20Ending.ogg --no-check-certificate
- create playlist file (you need to regenerate it every time you add or remove files in music directory):
Note: playlist ices repeat option with only one Ogg file listed won’t work
rm /root/playlist1.txt
find /root/music -name "*.ogg" > /root/playlist1.txt
- reboot the router
- start icecast and ices:
/usr/bin/icecast -b -c /etc/icecast.xml
/usr/bin/ices /etc/ices.xml
- test icecast streaming server from your PC: