Your own internet station ( Debian 10 )
Posted: Thu Feb 18, 2021 6:16 pm
Your very own Internet radio station using Icecast.
Icecast is a flexible, FOSS server that allows you to stream sound and music both to and from the server. Streaming to the server can be done via a music playlist, live broadcast, or relay from another server. For example, there is an iPhone app ( Icefall ) which simply streams your phone’s microphone input to your Icecast server.
In this scenario, we’re going to use a playlist of music as our source.
Streaming from the Icecast server is the client connection where users listen. Here we’ll use VLC on an iPhone to listen to the stream.
Setting Up the VPS
Using a brand new Debian 10 VPS which I’m calling “caster.lowend.party”. We’ll install two products:
Icecast, which is the server
Ices, which is the streaming provider that will server our playlist to the serve
Install icecast via apt:
Starting out, icecast does not need much configuration – just the server name and passwords. So when asked if you want to configure icecast, say “yes”. Use the hostname for the server name and pick good passwords.
Icecast should start automatically. It’s a normal systemd service so you can make sure it’s up with:
If you ever need to reconfigure icecast, you can use
Setting Up Your Playlist
I’m going to stream one of my favorite old time radio shows, Speed Gibson of the International Secret Police. It’s available for free (not copyrighted) on archive.org in Ogg Vorbis format. Note that ices 2.x only supports Ogg Vorbis. The older 0.x format supports mp3, but it’s legacy now so I won’t be covering it. If you want to install that, you’ll need to manually build ices from source.
There’s no need to run ices as root, so I created a user (raindog308) and then setup the playlist in my home directory. The playlist file (a text file) is just a list of tracks in the order in which to play them.
That sed fanciness puts the full path to each track into the playlist, which is necessary:
Configuring ices
Start by copying the example file:
Here are the changes I made, bolded. I removed comments to make things easier to read.
I set ices to run in the background, and I pointed the ices logfile to my home directory.
The comments in the file say the metadata section isn’t used, but you’ll see it in the web interface.
Note that “file” parameter pointing at our playlist.txt
Note the hostname, port, and password, which is what ices uses to connect. Also, the “mount” will form part of the URL and is the “name” of the stream.
Now start the stream with
As you may recall, we configured it to run in the background and we can see that it is doing so.
At this point, we’re up and streaming. Let’s go to the Icecast page on our server and see what’s going on. We surf to http://caster.lowend.party:8000 and find this page:
If you click Administration and enter ‘admin’ and the password you selected, you can see statistics and do some limited administrative tasks like listing clients, etc. but the main configuration is done in the .xml files.
Client Setup
I’m going to use VLC on my iPhone to connect and listen. It’s very easy to configure. After starting the VLC app, tap Network at the bottom. You’ll see a screen like this:
Tap Open Network Stream. You’ll be presented with a page where you can enter the URL of your stream. Note that you must include the http://, the port number (8000), and the mount.
Once you’ve entered the URL, hit Open Network Stream and you will begin streaming.
https://lowendbox.com/blog/create-your- ... h-icecast/
Icecast is a flexible, FOSS server that allows you to stream sound and music both to and from the server. Streaming to the server can be done via a music playlist, live broadcast, or relay from another server. For example, there is an iPhone app ( Icefall ) which simply streams your phone’s microphone input to your Icecast server.
In this scenario, we’re going to use a playlist of music as our source.
Streaming from the Icecast server is the client connection where users listen. Here we’ll use VLC on an iPhone to listen to the stream.
Setting Up the VPS
Using a brand new Debian 10 VPS which I’m calling “caster.lowend.party”. We’ll install two products:
Icecast, which is the server
Ices, which is the streaming provider that will server our playlist to the serve
Install icecast via apt:
Code: Select all
apt-get update
Code: Select all
apt-get -y install icecast2 ices2
Icecast should start automatically. It’s a normal systemd service so you can make sure it’s up with:
Code: Select all
systemctl start icecast
If you ever need to reconfigure icecast, you can use
Code: Select all
dpkg-reconfigure icecast
I’m going to stream one of my favorite old time radio shows, Speed Gibson of the International Secret Police. It’s available for free (not copyrighted) on archive.org in Ogg Vorbis format. Note that ices 2.x only supports Ogg Vorbis. The older 0.x format supports mp3, but it’s legacy now so I won’t be covering it. If you want to install that, you’ll need to manually build ices from source.
There’s no need to run ices as root, so I created a user (raindog308) and then setup the playlist in my home directory. The playlist file (a text file) is just a list of tracks in the order in which to play them.
Code: Select all
$ cd /home/raindog308
$ mkdir SGISP
$ cd SGISP
$ wget 'https://archive.org/compress/SGISP19391202_201708/formats=OGG%20VORBIS&file=/SGISP19391202_201708.zip'
$ unzip *.zip
$ ls *.ogg | sort -n | sed 's#^#/home/raindog308/SGISP/#' > playlist.txt
Code: Select all
raindog308@caster:~/SGISP$ head playlist.txt
/home/raindog308/SGISP/SGISP_1937-01-02.ogg
/home/raindog308/SGISP/SGISP_1937-01-09.ogg
/home/raindog308/SGISP/SGISP_1937-01-16.ogg
/home/raindog308/SGISP/SGISP_1937-01-23.ogg
<snip>
Start by copying the example file:
Code: Select all
cp /usr/share/doc/ices2/examples/ices-playlist.xml /home/raindog308
Code: Select all
<ices>
<background>1</background>
<logpath>/home/raindog308</logpath>
<logfile>ices.log</logfile>
<loglevel>4</loglevel>
<consolelog>0</consolelog>
Code: Select all
<metadata>
<name>Speed Gibson of the International Secret Police</name>
<genre>OTR</genre>
<description>Speed Gibson of the International Secret Police</description>
</metadata>
Code: Select all
<input>
<module>playlist</module>
<param name="type">basic</param>
<param name="file">/home/raindog308/SGISP/playlist.txt</param>
<param name="random">0</param>
<param name="restart-after-reread">0</param>
<param name="once">0</param>
</input>
Code: Select all
<instance>
<hostname>caster.lowend.party</hostname>
<port>8000</port>
<password>complex-password</password>
<mount>/SGISP</mount>
<reconnectdelay>2</reconnectdelay>
<reconnectattempts>5</reconnectattempts>
<maxqueuelength>80</maxqueuelength>
<encode>
<nominal-bitrate>64000</nominal-bitrate> <!-- bps. e.g. 64000 for 64 kbps -->
<samplerate>44100</samplerate>
<channels>2</channels>
</encode>
</instance>
Note the hostname, port, and password, which is what ices uses to connect. Also, the “mount” will form part of the URL and is the “name” of the stream.
Now start the stream with
Code: Select all
raindog308@caster:~$ ices /root/ices-playlist.xml
raindog308@caster:~$ ps -ef | grep ices
raindog+ 2196 1 6 18:57 ? 00:00:00 ices2 ices-playlist.xml
raindog+ 2202 1979 0 18:57 pts/1 00:00:00 grep ices
At this point, we’re up and streaming. Let’s go to the Icecast page on our server and see what’s going on. We surf to http://caster.lowend.party:8000 and find this page:
If you click Administration and enter ‘admin’ and the password you selected, you can see statistics and do some limited administrative tasks like listing clients, etc. but the main configuration is done in the .xml files.
Client Setup
I’m going to use VLC on my iPhone to connect and listen. It’s very easy to configure. After starting the VLC app, tap Network at the bottom. You’ll see a screen like this:
Tap Open Network Stream. You’ll be presented with a page where you can enter the URL of your stream. Note that you must include the http://, the port number (8000), and the mount.
Once you’ve entered the URL, hit Open Network Stream and you will begin streaming.
https://lowendbox.com/blog/create-your- ... h-icecast/