Prerequisites
By running an Icecast2 server, audio output can be streamed in mp3 or ogg vorbis format and may be accessed by local network devices (e.g. other computers or an internet radio receiver) or by connections via the internet, depending on settings we made in the Icecast configuration file. It is possible to stream either a playlist or the live output from your soundcard.
One of the following packages is needed in addition to Icecast2:
- Ices for streaming playlists in .m3u (mp3) format
- Ices2 for live or playlist streaming in OGG fomat
- Darkice for live streams in mp3 format
Those packages may additionally have to be set up before they can be accessed by stream2ip. Streaming to a local network should mostly run fine with the default settings included.
Default configuration files for these packages will be created and used on first run in ~/.config/stream2ip/ to ease editing. If you had changed the client password for Icecast you will have to also edit these files.
See also this quick guide to set-up Icecast for stream2ip
Icecast runs system-wide (default)
For a system-wide setup the last line in /etc/default/icecast2 must be changed to
ENABLE=true
Icecast in user-space
If stream2ip does not recognize a running Icecast server it will start it in user space.
In this case the following configuration file will be created in our HOME directory. Edit this file to meet our needs:
~/.config/stream2ip/icecast.xml
For in-depth details on how to install and setup icecast2 see the Icecast project.
Play live sound in mp3
Install Darkice for streaming local sound from your soundcard in mp3 format.
In the settings window either type “local”, “live” or give a path to a custom Darkice-configuration file with extension .cfg (in ‘live’ mode ~/.config/stream2ip/darkice-s2ip.cfg will be used by default). Tune the receiver to <localhost>:8000/stream2ip.m3u or to any other mount point as it will be displayed).
In case we do not want to use pulseaudio as a source we may give in another sound-device in ~/.config/stream2ip/darkice-s2ip.cfg (best try with device = default).
Some versions of Darkice do not run when there is a comment (#) after the password in its .cfg file. The comment in the password line shipped with older versions of Darkice (or Stream2ip) should be removed.
Only after a supported media player was selected in Preferences, metatag information (artist, title) will also be sent to the Icecast server to be displayed on the receiver.
Playlist in mp3 format
Install Ices for streaming a playlist in mp3 format. In the settings window type the full path to the playlist (textfile with path to sound files) using .m3u extension (e.g.: /home/<user>/music/playlist.m3u). You may load a playlist file using the fileselector box.
The configuration file for Ices ices-s2ip.conf must reside in ~/.config/stream2ip/.
Tune the receiver to <localhost>:8000/stream2ip.m3u.
Playlist in mixed format
When the playlist contains mixed audio files other than mp3 Ices needs to resample these file using Lame. This can be achieved by editing the following line in ~/.config/stream2ip/s2ip-ices.conf to:
<Reencode>1</Reencode>
This may however reduce playback quality. Metatags will only be processed from mp3 files (filename is used for non-mp3 files). Mutagen for parsing ID3 tags is at present unavailable.
Play live sound in Ogg Vorbis
Install ices2 for streaming in .ogg format. In the settings window type the path to the Ices2-configuration file with .xml extension (e.g.: ~/.config/stream2ip/ices-s2ip.xml).
Tune the receiver to <localhost>:8000/stream2ip.ogg.
Playlist in Ogg Vorbis
Install ices2 for streaming in .ogg format without reencoding. Copy the sample configuration /usr/share/doc/ices2/examples/ices-playlist.xml to your /home and edit it to give the
- password for the Icecast server
- path to your playlist.
In the stream2ip settings line type the path to this Ices2-configuration file with .xml extension (e.g.: ~/…/ices-playlist.xml). Tune the receiver to localhost>:8000/stream2ip.ogg
In case audio source is not pulseaudio give in your sound-device in ~/.config/stream2ip/ices-s2ip.xml (try with <module>default</module>).
Example settings lines:
live
myplaylist.m3u
/home/takkat/media1 /home/takkat/media2
/home/takkat/.config/stream2ip/
<path>/ices-s2ip.conf
/home/takkat/ices-playlist.xml