Streaming Audio with Internet DJ Console and Icecast2

IDJC LogoThere are many different solutions regarding streaming audio content over a LAN or Internet. In the following series I will examine a few of them. In this case, I have an audio collection on my desktop, i would like to share with friends over the Internet. The result being a “live” stream, where we all hear the same thing at the same time, and real-time control over the playlist on my end. Many people first start out with a Winamp+oddcast+shoutcast setup, and I could certainly run that in a virtual box. However, this being GNU/Linux, and with my presupposed goals of using open-source software and learning new things, I am going to go in a different direction.

First. The streaming server. For this installation I will use one of the Big Daddies of the internet, Icecast2. Icecast is stable, reasonably feature rich, compatible with Shoutcast protocols, and has served me well in the past. Installing on Karmic is a simple affair.

sudo aptitude install icecast2

And then we will need to edit the configuration files.

sudo nano /etc/default/icecast2

Change ENABLE=false to true to run as a daemon.

sudo nano /etc/icecast2/icecast.xml

In this file. 1> Set your listening port under “listening socket“. Icecast was a bit picky with this for me. I kept getting a Server exiting message when starting it until I found a suitable port.
2> Change all the default passwords. Might as well even change the ones you don’t plan to need.
3> If you want more advanced controls, setup a mount in the mount section of the file with a name of something other than the default “stream”. He is an example of some additional information that can be added that way.

<mount-name>/radio</mount-name>
<stream-name>Alan Radio</stream-name>
<stream-description>A Little Music for Friends</stream-description>
<stream-url>http://musicserver.smithy.net:8000</stream-url>
<genre>Steam Punk</genre>

There are many more options you can set which are detailed in the file and quite thoroughly on the Icecast website.
You should be able to run your server using the usual /etc/init.d/icecast2 start | stop | restart commands. There is a web interface both for admins and listeners serverup at http://yourserver:yourport/ (http://192.168.10.10:8000 for example).
There is no problem with running the server on the same machine you will be using to encode the stream or a remote machine. Given that most ADSL connections have quite small upload bandwidth, you might need to stream from a VPS server, setup some relays, or get a stream host if you want to serve more than a few connections simultaneously.

And now the encoder. The software that will take my playlist, turn it into a stream, and send it to Icecast for relay to my listeners. For this exercise I will try out the Internet DJ Console.

Internet DJ console (IDJC) is a graphical client that runs under gnome and uses JACK audio connection kit. Features include two main media players with a crossfader, a jingle player, microphone signal processing (compressor and noise gate), IRC track announcements with X-Chat, an automatic stream shut-off timer, MP3 or Ogg streaming and recording at various bit rates, aux input for connecting external JACK aware applications, and audio level meters. Heck you can even route Skype voice through the stream for interviews and the like.

This can be a pain to install, but here is what worked for me. Note the preparatory dependency install list has a few extras. For example between the repository version and the version I will install here the need for libmp4v2 and eyeD3 were removed and a new Mutagen dependency added. I have included them all for “bulletproofness” in case you are installing a different version.

sudo aptitude install libc6-dev libjack-dev jackd libvorbis-dev libsamplerate0-dev libsndfile1-dev python-gtk2-dev libmad0-dev libavcodec-dev libavformat-dev libmp3lame-dev libmp4v2-dev flac vorbis-tools python-eyed3 libspeex-dev python-mutagen
#  You can substitute directory names and download link for your version.
wget http://downloads.sourceforge.net/project/idjc/idjc/0.8/idjc-0.8.1.tar.gz?use_mirror=nchc
tar xzvf idjc-0.8.1.tar.gz
# Changing to a root user if you are not will help here.  (sudo -i)
cd idjc-0.8.1
./configure CFLAGS="-O2"
make
make install

You should now find it in Applications –> Internet. Fire it up, click the server button, add add your server IP address, port, mount point, password etc. If all goes well, and it always does….. you should connect to your Icecast server and be ready to stream to the world. I also had to play with my Mic settings in the Alsamixer and sound properties as I hadn’t set this up before hand.

Leave a Response

unilinear