The ices 2 configuration file is in XML format, which is described in detail below. There are a few sample XML files provided which show the main ways ices is used.
A live audio feed often comes from a soundcard but may come via a server such as JACK
Other possibilities usually involve a playlist, but you may want to invoke a separate program which can produce PCM via a pipe into ices.
The ices-switch.xml is an example of how you can define a series of inputs. You could use this to switch between a live session and a pre-recorded playlist if it require. All available inputs can be used with this mechanism, but only 1 can be used at any one time. A switch between inputs can occur if an input stops or manual intervention occurs with a USR2 signal.
An unusual one is the ices-fixit.xml, which is basically a playlist but just outputs to files and the timer is disabled so that it runs very quickly. This can be used to split files or maybe even repair some Ogg Vorbis files.
<?xml version="1.0"?>
<ices>
general settings
stream section
</ices>
These apply to IceS as a whole. The example below gives a useful example to work to
<background>0</background>
<logpath>/var/log/ices</logpath>
<logfile>ices.log</logfile>
<logsize>2048</logsize>
<loglevel>3</loglevel>
<consolelog>0</consolelog>
<pidfile>/var/log/ices/ices.pid</pidfile>
This describes how the input and outgoing streams are configured.
<stream>
Global metadata
Inputs
Runners
</stream>
<name>My Stream</name>
<genre>Rock</genre>
<description>A short description of your stream</description>
<url>http://mysite.org</url>
This section deals with getting the audio data into IceS. There are a few ways that can happen. Typically it's either from a playlist or via a soundcard.
The layout is consistent between the different input modules. Within the input section a module tag is needed to identify the module in question. The rest are made up of param tags specific to the module. There can be several param tags supplied to a module. Details of the module parameters are shown later.
A runner is a thread. You need at least 1, but each runner can process several encodings. As encoding is a CPU intensive task, grouping these into the same runner can help the load on the machine, especially if your machine does other work. Often only 1 runner is needed but you could say that the general rule of thumb is 1 runner per CPU.
While a runner may indicate the CPU usage, the actual encoding of the stream is placed within an <instance>. More than 1 instance can be defined within each runner.
<runner>
<instance>
...
</instance>
<instance>
...
</instance>
</runner>
Each instance defines 1 encoded stream. This means that for multiple bitrate/quality streams, a separate <instance> is needed for each bitrate. Each instance defines a particular set actions that occur on the passed in audio. Any modifications to the input data are isolated to the instance.
<instance>
name
description
genre
url
resample
downmix
encode
savefile
shout
</instance>
<resample>
<out-rate>22050</out-rate>
</resample>
The most common values used are 48000, 44100, 22050 and 11025, and is really only used to resample to a lower samplerate, going to a higher rate serves no purpose within IceS.
<downmix>1</downmix>
<encode>
<quality>0</quality>
<nominal-bitrate>65536</nominal-bitrate>
<maximum-bitrate>131072</maximum-bitrate>
<minimum-bitrate>-1</minimum-bitrate>
<managed>0</managed>
<passthru>0</passthru>
</encode>
quality
nominal-bitrate
managed
maximum-bitrate
minimum-bitrate
passthru
<savefile>
<filename>/archive/ices/%F/stream.ogg</filename>
<duration>86400</duration>
<fmask>0644<fmask>
<dmask>0755<dmask>
<on-metadata>1</on-metadata>
</savefile>
Sometimes the stream transmitted wants to be saved to disk. This can be useful
for live recordings.
filename
duration
on-metadata
fmask
dmask
This is used to define a connection to an icecast server. Several <shout> definitions can be used if you want to state different servers for the same encoded stream. Each shout connection acts independantly from each other but they send the same encoded stream
<shout>
<hostname>streamingserver.org</hostname>
<port>8000<port>
<password>hackme<password>
<mount>/stream.ogg<mount>
<yp>1<yp>
<flush-samples>20000<flush-samples>
<reconnectdelay>60<reconnectdelay>
</shout>
hostname
port