Ga naar de inhoud
Home » Ices2

Ices2

De ices2 instanties moet je met systemd opstarten, voor elke source (elke ices2) maak je een service file, hier een voorbeeld:

#
# Copyright (c) 2013 Pascal Bleser <pascal.bleser@opensuse.org>
# Authors:
# * Pascal Bleser
# * http://pyn00b.blogspot.be/2012/11/life-with-systemd-part-2.html
# * Werner Fink for the postfix.service file
# * Arjan ten Hoopen for modifications for ices
#
# Description:
#
# Start the Ices source betonuur for IceCast.
#
[Unit]
Description=Ices source for Playsist TestStreamOGG
Requires=icecast2.service
After=icecast2.service
[Service]
ExecStart=/usr/bin/ices2 /etc/ices2/TestStreamOGG.xml
Type=forking
User=icecast2
[Install]
WantedBy=multi-user.target

Sla deze file op als /usr/lib/systemd/system/ices2-betonuur.service

Opstarten via

sudo systemctl start ices2-betonuur
sudo systemctl enable ices2-betonuur

Voorbeeld configuratie voor een ices2.xml config file:

<?xml version="1.0"?>
<ices>
<!-- run in background -->
<background>1</background>
<!-- where logs, etc go. -->
<logpath>/var/log/ices</logpath>
<logfile>ices-TestStreamOGG.log</logfile>
<!-- 1=error,2=warn,3=info,4=debug -->
<loglevel>4</loglevel>
<!-- set this to 1 to log to the console instead of to the file above -->
<consolelog>0</consolelog>

<!-- optional filename to write process id to -->
<!-- <pidfile>/home/ices/ices.pid</pidfile> -->

<stream>
<!-- metadata used for stream listing (not currently used) -->
<metadata>
<name>Test Stream ogg in .m3u</name>
<genre>Diversen</genre>
<description>Testsream met van alles wat</description>
</metadata>

<!-- input module

The module used here is the playlist module - it has 
'submodules' for different types of playlist. There are
two currently implemented, 'basic', which is a simple
file-based playlist, and 'script' which invokes a command
to returns a filename to start playing. -->

<input>
<module>playlist</module>
<param name="type">basic</param>
<param name="file">/Media/audio/Playlists/arjan/TestStreamOGG.m3u</param>
<!-- random play -->
<param name="random">0</param>
<!-- if the playlist get updated that start at the beginning -->
<param name="restart-after-reread">0</param>
<!-- if set to 1 , plays once through, then exits. -->
<param name="once">0</param>
</input>

<!-- Stream instance
You may have one or more instances here. This allows you to 
send the same input data to one or more servers (or to different
mountpoints on the same server). Each of them can have different
parameters. This is primarily useful for a) relaying to multiple
independent servers, and b) encoding/reencoding to multiple
bitrates.
If one instance fails (for example, the associated server goes
down, etc), the others will continue to function correctly.
This example defines two instances as two mountpoints on the
same server. -->

<instance>
<!-- Server details:
You define hostname and port for the server here, along with
the source password and mountpoint. -->
<hostname>localhost</hostname>
<port>8000</port>
<password>hackme</password>
<mount>/TestStreamOGG</mount>
<yp>0</yp> <!-- allow stream to be advertised on YP, default 0 -->
<type>basic</type>

<!-- Reconnect parameters:
When something goes wrong (e.g. the server crashes, or the
network drops) and ices disconnects from the server, these
control how often it tries to reconnect, and how many times
it tries to reconnect. Delay is in seconds.
If you set reconnectattempts to -1, it will continue 
indefinately. Suggest setting reconnectdelay to a large value
if you do this.
-->
<reconnectdelay>2</reconnectdelay>
<reconnectattempts>5</reconnectattempts>

<!-- maxqueuelength:
This describes how long the internal data queues may be. This
basically lets you control how much data gets buffered before
ices decides it can't send to the server fast enough, and 
either shuts down or flushes the queue (dropping the data)
and continues. 
For advanced users only.
-->
<maxqueuelength>80</maxqueuelength>

<!-- Live encoding/reencoding:
Currrently, the parameters given here for encoding MUST
match the input data for channels and sample rate. That 
restriction will be relaxed in the future.
Remove this section if you don't want your files getting reencoded.
-->

</instance>

</stream>
</ices>