|
|
| mn :: comp :: hardware | |
Why? Because streaming Internet radio consumes a lot of bandwidth, which I'd like to use for other things. While Internet radio is great for picking up radio from around the world (thanks to AlienBBC!), it's kind of silly to stream the same content over the Internet that I could pick up from the air (KALX). Besides, many of the stations we want to listen to don't have Internet streamers anyway (or, like KFOG, they're not setup to stream through Slimserver well).
How? There are three steps:
<?xml version="1.0"?>
<ices>
<background>1</background>
<logpath>/var/log/ices</logpath>
<logfile>ices.log</logfile>
<loglevel>4</loglevel>
<consolelog>0</consolelog>
<stream>
<metadata>
<name>Radio Waves</name>
<genre>Any</genre>
<description>The real radio</description>
<url>http://www.monkeynoodle.org</url>
</metadata>
<input>
<module>alsa</module>
<param name="rate">44100</param>
<param name="channels">2</param>
<param name="device">hw:0,0</param>
<param name="buffer-time">500</param>
<param name="metadata">0</param>
</input>
<instance>
<hostname>localhost</hostname>
<port>8000</port>
<password>hackme</password>
<mount>/stream.ogg</mount>
<encode>
<quality>3</quality>
<channels>2</channels>
<nominal-bitrate>65536</nominal-bitrate>
<maximum-bitrate>131072</maximum-bitrate>
<minimum-bitrate>-1</minimum-bitrate>
<managed>0</managed>
<samplerate>44100</samplerate>
</encode>
</instance>
</stream>
</ices>
<icecast>
<limits>
<clients>100</clients>
<sources>5</sources>
<threadpool>5</threadpool>
<queue-size>102400</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
</limits>
<authentication>
<source-password>hackme</source-password>
<relay-password>hackme</relay-password>
<admin-user>admin</admin-user>
<admin-password>hackme</admin-password>
</authentication>
<hostname>localhost</hostname>
<listen-socket>
<port>8000</port>
</listen-socket>
<fileserve>1</fileserve>
<paths>
<logdir>/var/log/icecast</logdir>
<webroot>/usr/share/icecast/web</webroot>
<adminroot>/usr/share/icecast/admin</adminroot>
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<loglevel>4</loglevel>
</logging>
<security>
<changeowner>
<user>icecast</user>
<group>icecast</group>
</changeowner>
</security>
</icecast>
/usr/local/slimserver/playlists/localhost.m3u #EXTM3U #EXTINF:-1,stream.ogg http://localhost:8000/stream.oggUPDATE: Got my D-Link USB Radio from Craigslist for $10 and plugged it in. The log showed that it had been auto-detected properly, so I chown'ed & chmod'ed the /dev/v4l/radio0 entry and downloaded fmtools. A few minutes later, I had radio... it works beautifully. Another fine script for timeshifting is fmcapture.
[root@felix root]# grep -v \# /usr/local/icecast/etc/liveice.cfg | grep -v ^$ SERVER localhost PORT 8000 PASSWORD hackme USE_LAME3 /usr/bin/lame ENCODER_ARGS -h SOUND_DEVICE /dev/dsp HALF_DUPLEX SAMPLE_RATE 44100 BITRATE 128000 STEREO ENCODING_QUALITY 100 HTTP_LOGIN MOUNTPOINT stream NAME Radio Waves GENRE real frequency modulated electromagnetic spectrum PUBLIC 0 URL http://www.monkeynoodle.org DESCRIPTION real frequency modulated electromagnetic spectrum NO_MIXER UPDATE_DELAY 5
There's no launcher script, so I had to do this one -- also the no-interface option (-@2) causes it to crash.
#!/bin/bash
#
# liveice This shell script takes care of starting and stopping
# liveice streamer.
#
# chkconfig: 2345 55 10
# description: liveice streams audio
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x /usr/local/icecast/bin/liveice -a -f /usr/local/icecast/etc/liveice.cfg ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemon.
gprintf "Starting liveice: "
/usr/local/icecast/bin/liveice >/usr/local/icecast/log/liveice.log >&1&
echo
touch /var/lock/subsys/liveice
;;
stop)
# Stop daemons.
gprintf "Shutting down liveice: "
killproc liveice
echo
rm -f /var/lock/subsys/liveice
;;
status)
status liveice
;;
restart)
$0 stop
$0 start
;;
reload)
$0 stop
$0 start
;;
condrestart)
if [ -f /var/lock/subsys/liveice ]; then
$0 stop
$0 start
fi
;;
*)
gprintf "Usage: liveice {start|stop|restart|reload|status}\n"
exit 1
esac
exit 0
|
Last modified: Nov 25, 2005 12:48 pm.
|
||
|
|