<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta name="description" content="Internet DJ Console (IDJC) is a Shoutcast/Icecast internet radio client incorporating features for live radio show production." /> <meta name="keywords" xml:lang="en" content="idjc dj shoutcast icecast radio linux gtk live recorded voip irc" /> <link rel="shortcut icon" href="favicon.png" type="application/png" /> <link rel="stylesheet" href="style.css" type="text/css" /> <!--[if lte IE 7]><link rel="stylesheet" href="style_ie.css" type="text/css" /><![endif]--> <title>Internet DJ Console Homepage</title> <script type="text/javascript"> // Change the title text and highlight a navigation bar option. function ui(title, menu) { document.getElementById('title').innerHTML = title; s = document.getElementById(menu).style; s.color = "#F70"; s.fontWeight = "bold"; s.textDecoration = "underline"; } </script> </head> <body> <!-- Hidden h1 title for search engine seeding --> <h1 class="unshown">Internet DJ Console Homepage IDJC</h1> <table id="main-table"> <tr><td> <table> <tr id="logo-holder"> <td> <img src="site-logo.png" width="148" height="212" alt="website logo" title="Internet DJ Console homepage"/> </td> </tr> <tr> <td id="left-sidebar"> <h3>Contents</h3> <ul id="sidebar-menu"> <li><a href="index.html" id="front-page-nav">Front page</a></li> <li><a href="tour.html" id="tour-nav">Tour</a></li> <li> <ul> <li><a href="tour_main.html" id="tour-main-nav">Main window</a></li> <li><a href="tour_jingles.html" id="tour-jingles-nav">Jingles</a></li> <li><a href="tour_output.html" id="tour-output-nav">Output</a></li> <li><a href="tour_preferences.html" id="tour-preferences-nav">Preferences</a></li> </ul> </li> <li><a href="install.html" id="install-nav">Installation</a></li> <li> <ul> <li><a href="install_standard.html" id="install-standard-nav">Standard</a></li> <li><a href="install_build.html" id="install-build-nav">Building</a></li> <li><a href="install_first_run.html" id="install-first-run-nav">First run</a></li> </ul> </li> <li><a href="tutorials.html" id="tutorials-nav">Tutorials</a></li> <li> <ul> <li><a href="tutorials_icecast.html" id="tutorials-icecast-nav">Icecast</a></li> <li><a href="tutorials_shoutcast.html" id="tutorials-shoutcast-nav">Shoutcast</a></li> <li><a href="tutorials_voip.html" id="tutorials-voip-nav">VoIP</a></li> </ul> </li> <li><a href="contact.html" id="contact-nav">Contact</a></li> </ul> </td> </tr> </table> </td> <td> <table id="right-table"> <tr> <td id="top-titlebar"> <h2 id="title"></h2> </td> </tr> <tr> <td> <script type="text/javascript"> ui('Tutorials: Streaming with Icecast and IDJC', 'tutorials-icecast-nav') </script> <h4>Aims</h4> <p>In this section I'm going to walk you through the procedure of setting up an Iceccast server and then sending a live stream to it with IDJC. In addition I will demonstrate the connection of a listener to show that everything really does work.</p> <p>The advice below is for demonstration purposes only. Not covered are best practices of locking down an Icecast server for serious use. For that and other non IDJC related matters there are the <a href="http://icecast.imux.net/">Icecast forums</a> and the Icecast documentation itself.</p> <h4>Setting up Icecast</h4> <h5>Why local?</h5> <p>Everything in this tutorial will be demonstrated on the same machine and while not as impressive as sending a stream half way across your house, by making this tutorial single machine specific I can not only leave multi-machine as an exercise to the reader but also not have to worry about anyone's local network specifics or how many machines they have reasonable access to.</p> <h5>Installing Icecast</h5> <ul><li> <p>Ubuntu</p> <pre class="reduced">sudo apt-get install icecast2</pre> </li><li> <p>Debian</p> <pre class="reduced">sudo -c "apt-get install icecast2"</pre> </li></ul> <h5>The configuration file</h5> <p>Take a look in your /etc/<span style="color:red;" title="It could just be icecast. Ubuntu uses plain  icecast for storing Icecast version 1 configuration files. IDJC does not support Icecast 1.">icecast2</span>/ directory and you should find a file called icecast.xml. This file is and will be referred to as the Icecast server configuration file. In it are the settings for the various different Icecast options. Here below are the typical contents.</p> <pre class="big-code" title="icecast.xml"><icecast> <limits> <clients>100</clients> <sources>2</sources> <threadpool>5</threadpool> <queue-size>524288</queue-size> <client-timeout>30</client-timeout> <header-timeout>15</header-timeout> <source-timeout>10</source-timeout> <span style="color:gray;"><!-- If enabled, this will provide a burst of data when a client first connects, thereby significantly reducing the startup time for listeners that do substantial buffering. However, it also significantly increases latency between the source client and listening client. For low-latency setups, you might want to disable this. --></span> <burst-on-connect>1</burst-on-connect> <span style="color:gray;"><!-- same as burst-on-connect, but this allows for being more specific on how much to burst. Most people won't need to change from the default 64k. Applies to all mountpoints --></span> <burst-size>65535</burst-size> </limits> <authentication> <span style="color:gray;"><!-- Sources log in with username 'source' --></span> <source-password>hackme</source-password> <span style="color:gray;"><!-- Relays log in username 'relay' --></span> <relay-password>hackme</relay-password> <span style="color:gray;"><!-- Admin logs in with the username given below --></span> <admin-user>admin</admin-user> <admin-password>hackme</admin-password> </authentication> <span style="color:gray;"><!-- set the mountpoint for a shoutcast source to use, the default if not specified is /stream but you can change it here if an alternative is wanted or an extension is required <shoutcast-mount>/live.nsv</shoutcast-mount> --></span> <span style="color:gray;"><!-- Uncomment this if you want directory listings --></span> <span style="color:gray;"><!-- <directory> <yp-url-timeout>15</yp-url-timeout> <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url> </directory> --></span> <span style="color:gray;"><!-- This is the hostname other people will use to connect to your server. It affects mainly the urls generated by Icecast for playlists and yp listings. --></span> <hostname>localhost</hostname> <span style="color:gray;"><!-- You may have multiple <listener> elements --></span> <listen-socket> <port>8000</port> <span style="color:gray;"><!-- <bind-address>127.0.0.1</bind-address> --></span> <span style="color:gray;"><!-- <shoutcast-mount>/stream</shoutcast-mount> --></span> </listen-socket> <span style="color:gray;"><!-- <listen-socket> <port>8001</port> </listen-socket> --></span> <span style="color:gray;"><!--<master-server>127.0.0.1</master-server>--></span> <span style="color:gray;"><!--<master-server-port>8001</master-server-port>--></span> <span style="color:gray;"><!--<master-update-interval>120</master-update-interval>--></span> <span style="color:gray;"><!--<master-password>hackme</master-password>--></span> <span style="color:gray;"><!-- setting this makes all relays on-demand unless overridden, this is useful for master relays which do not have <relay> definitions here. The default is 0 --></span> <span style="color:gray;"><!--<relays-on-demand>1</relays-on-demand>--></span> <span style="color:gray;"><!-- <relay> <server>127.0.0.1</server> <port>8001</port> <mount>/example.ogg</mount> <local-mount>/different.ogg</local-mount> <on-demand>0</on-demand> <relay-shoutcast-metadata>0</relay-shoutcast-metadata> </relay> --></span> <span style="color:gray;"><!-- Only define a <mount> section if you want to use advanced options, like alternative usernames or passwords <mount> <mount-name>/example-complex.ogg</mount-name> <username>othersource</username> <password>hackmemore</password> <max-listeners>1</max-listeners> <dump-file>/tmp/dump-example1.ogg</dump-file> <burst-size>65536</burst-size> <fallback-mount>/example2.ogg</fallback-mount> <fallback-override>1</fallback-override> <fallback-when-full>1</fallback-when-full> <intro>/example_intro.ogg</intro> <hidden>1</hidden> <no-yp>1</no-yp> <authentication type="htpasswd"> <option name="filename" value="myauth"/> <option name="allow_duplicate_users" value="0"/> </authentication> <on-connect>/home/icecast/bin/stream-start</on-connect> <on-disconnect>/home/icecast/bin/stream-stop</on-disconnect> </mount> <mount> <mount-name>/auth_example.ogg</mount-name> <authentication type="url"> <option name="mount_add" value="http://myauthserver.net/notify_mount.php"/> <option name="mount_remove" value="http://myauthserver.net/notify_mount.php"/> <option name="listener_add" value="http://myauthserver.net/notify_listener.php"/> <option name="listener_remove" value="http://myauthserver.net/notify_listener.php"/> </authentication> </mount> --></span> <fileserve>1</fileserve> <paths> <span style="color:gray;"><!-- basedir is only used if chroot is enabled --></span> <basedir>/usr/share/icecast2</basedir> <span style="color:gray;"><!-- Note that if <chroot> is turned on below, these paths must both be relative to the new root, not the original root --></span> <logdir>/var/log/icecast2</logdir> <webroot>/usr/share/icecast2/web</webroot> <adminroot>/usr/share/icecast2/admin</adminroot> <span style="color:gray;"><!-- <pidfile>/usr/share/icecast2/icecast.pid</pidfile> --></span> <span style="color:gray;"><!-- Aliases: treat requests for 'source' path as being for 'dest' path May be made specific to a port or bound address using the "port" and "bind-address" attributes. --></span> <span style="color:gray;"><!-- <alias source="/foo" dest="/bar"/> --></span> <span style="color:gray;"><!-- Aliases: can also be used for simple redirections as well, this example will redirect all requests for http://server:port/ to the status page --></span> <alias source="/" dest="/status.xsl"/> </paths> <logging> <accesslog>access.log</accesslog> <errorlog>error.log</errorlog> <span style="color:gray;"><!-- <playlistlog>playlist.log</playlistlog> --></span> <loglevel>3</loglevel> <span style="color:gray;"><!-- 4 Debug, 3 Info, 2 Warn, 1 Error --></span> <logsize>10000</logsize> <span style="color:gray;"><!-- Max size of a logfile --></span> <span style="color:gray;"><!-- If logarchive is enabled (1), then when logsize is reached the logfile will be moved to [error|access|playlist].log.DATESTAMP, otherwise it will be moved to [error|access|playlist].log.old. Default is non-archive mode (i.e. overwrite) --></span> <span style="color:gray;"><!-- <logarchive>1</logarchive> --></span> </logging> <security> <chroot>0</chroot> <span style="color:gray;"><!-- <changeowner> <user>nobody</user> <group>nogroup</group> </changeowner> --></span> </security> </icecast></pre> <p>What we should do now is copy and paste this file into a text editor or start editing a copy of your original file. Hint: use your own file in preference to mine. Launch a text editor like gedit to do this.</p> <p>Next, select Save As in the text editor's menu, choose the file name icecast.xml, and save it in your home directory.</p> <h5>Attempting to run</h5> <pre>$ icecast2 -c icecast.xml FATAL: could not open error logging (/var/log/icecast2/error.log): No such file or directory FATAL: could not open access logging (/var/log/icecast2/access.log): No such file or directory FATAL: Could not start logging </pre> <p>Fix this by editing icecast.xml and change the logdir setting to /tmp which will solve the problem of inadequate write permissions and try again. Leave Icecast running for the time being.</p> <h4>Configuring IDJC</h4> <p>Start the Jack sound server as follows.</p> <pre>$ jackd -d dummy -r 44100</pre> <p>This is done so that any media player, even one that does not support Jack Audio Connection Kit can be used for playing the stream on this machine.</p> <p>Run IDJC and click the Output button in the bottom left hand corner. Click Configuration so the configuration section is visible.</p> <p>Click Connection, then New.</p> <p>For Server type you want Icecast 2 Master, for Hostname, localhost, port number should be 8000, mount point can be what you like but choose /listen, login name needs to be source and the password will be the default password, which is <span style="color:red;" title="Obviously a server exposed to the Internet should never  be configured to use its default password">hackme</span>. Click Ok to add the server to the list.</p> <p>Click Format. Select the Sample rate drop down box and choose 44100. Select MP3 and the top drop down box. Choose 128, Quality 5, and Joint Stereo. </p> <p>Click Individual Controls so the controls section is visible and click the button that says localhost:8000/listen.</p> <p>If the button stays in you have made the connection.</p> <h4>Streaming some audio</h4> <p>Click the down pointing arrow on the left media player and using the file selector add a track to the playlist. Click play. Make sure the crossfader is set all the way to the left. Make sure Stream is on and DJ is off. You should be able to see the Str Peak meter is active.</p> <p>If you can't hear anything right now it's because DJ is off and/or you are running a dummy Jack soundcard, which is what you want for the sake of this test.</p> <h4>Join the stream as a listener</h4> <pre>$ mplayer http://localhost:8000/listen</pre> <p>After a brief moment audio should start to play and within thirty seconds the listener count in the main IDJC window should have risen to 1. It's possible to add more listeners up to the maximum number currently specified in the Icecast configuration file.</p> </td> </tr> </table> </td> </tr> </table> </body> </html>