Internet Radio - Concepts and Self-Hosting

D

DevynCJohnson

Guest
Thanks to the Internet, the concept of "Internet Radio" is feasible. Many people use the Internet radio and it is available to all systems. The Internet radio is a network-based media streaming service. Many Internet radio stations are free and some lack commercials. However, some stations do require a paid membership. It is easy to listen to these stations. Also, it is easy for an individual to setup their own Internet radio station free of charge. There is a lot to learn about Internet radio stations. However, this is easy to learn and can give people more ways to enjoy the Internet and open-source software.

NOTE: The Internet radio is also called the web radio, webcasting, e-radio, online radio, and many other names.

Concept
The Internet radio works mostly the same way as websites. The Internet radio station is hosted by a server that is streaming the music (or sound) across TCP or UDP. Many media streaming servers also use HTTP to broadcast the music. Typically, the music uses a lossy audio codec (such as MP3 and Ogg Vorbis).

Since the Internet is accessible to nearly everyone, the Internet radio station can be heard across the world. This provides radio owners a larger audience than AM/FM radio stations.

The Internet radio is different from podcasting. With podcasting, the file is downloaded. However, the Internet radio cannot be paused, and it plays a constant stream of audio. However, audio playing on the Internet radio can be downloaded using "webcasting rippers" (such as "Icecream" - http://icecream.sourceforge.net/ ). Some media players that support the Internet radio have a plugin or feature that supports stream ripping.

Some audio streaming can be done on the local network alone. For instance, a server program called Tangerine is an open-source music server that can share music on the local network. Tangerine works on Linux, FreeBSD, Windows, and OSX. Many media players can act as clients. Unlike the Internet radio servers, Tangerine uses Digital Audio Access Protocol (DAAP) which is a proprietary protocol made by Apple. DAAP is a special form of HTTP that uses TCP. Other DAAP servers exist, but Tangerine is the most popular.

Simple Access
Most (or all) Internet radio stations can be accessed easily via a web-browser. Many are listed below.

Alternately, many apps are available for mobile devices. Many mobile device users may find it more convenient to use an app rather than the web-browser. Plus, apps can offer special features that make the experience better. Many free apps are available on Google Play when searching for "internet radio" ( https://play.google.com/store/search?q=internet radio&c=apps&hl=en ).

Media Player Access
Many media players and music library managers support Internet radio stations. For instance, Clementine, Rhythmbox, Banshee, Amarok, and others support Internet radio stations. Clementine alone supports many Internet radio stations as seen on its website or on Clementine itself.
Listen to internet radio from Spotify, Grooveshark, SomaFM, Magnatune, Jamendo, SKY.fm, Digitally Imported, JAZZRADIO.com, Soundcloud, Icecast and Subsonic servers.

Clementine-radio.png


Media players need to have the "liblastfm1" and "libshout3" libraries installed to full support all Internet radio stations. Also, the media player may need "liquidsoap" and Gstreamer. The "liblastfm-fingerprint1" library is recommended for some media players since users can get metadata for the current music stream. In addition, various Liquidsoap plugins can provide more features and make the radio experience better.

Quickly Setting Up a Radio Server
There is a variety of Internet radio server software that can be used. There are also open-source software packages. Icecast ( http://icecast.org/ ) is the name of a popular open-source Internet radio server that anyone can download and use. Icecast supports Opus, MP3, Ogg (Vorbis and Theora), and WebM. Icecast is usually in the default Linux repositories.

NOTE: Icecast is commonly called "Icecast2" since its code was completely re-written in 2001-2004 (released).

When installing Icecast, the user may be asked to configure the hostname and some passwords. If not, then edit /etc/icecast2/icecast.xml (with Root privileges). Use "localhost" as the hostname if the stream is intended to stay on the local network. The icecast.xml file is easy to understand and has many comments and explanations inside. A sample file is included at the end of this article.

debconf-icecast.png


debconf-icecast-hostname2.png


NOTE: This is a brief and general tutorial to setup Icecast. There are many special features that can be applied. These are the general and basic instructions to get started.

Next, edit /etc/default/icecast2 (with Root privileges) and change "ENABLE=false" to "ENABLE=true".

The server can be started and stopped using the commands (with Root privileges) "/etc/init.d/icecast2 start" and "/etc/init.d/icecast2 stop", respectively. These two commands may vary on some systems.

The admin can use the admin interface by using a web-browser and going to something like "http://localhost:8000/admin/". If the user is not on the server, then replace “localhost” with the IP address of the server.

icecast-interface.png


However, Icecast will not stream audio, yet. Icecast streams audio that is played by another process. It is usually best to use Music Player Daemon (MPD) - http://www.musicpd.org/ . Install and configure MPD. Be sure to give MPD the same passwords that were used with Icecast. If the password in one changes, then the admin must make changes to the other software.

The configuration file used by MPD is /etc/mpd.conf . The music directory can be set with the "music_directory" parameter. Make sure that the settings used in Icecast and MPD do not conflict. Afterwards, the user may need to run "cd $HOME; mkdir -p music/playlists; mkdir .mpd" to create the directories needed by MPD.

If the created Internet radio station is public, then people can access it by opening a web-browser and going to "
Code:
IP_ADDRESS:PORT
" (replace "IP_ADDRESS" and "PORT" with the values used by the server). Then, click the "M3U" link.

Further Reading

Code:
<icecast>
  <!-- location and admin are two arbitrary strings that are e.g. visible
  on the server info page of the icecast web interface
  (server_version.xsl). -->
  <location>Earth</location>
  <admin>icemaster@localhost</admin>

  <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>
  <!-- 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. -->
  <burst-on-connect>1</burst-on-connect>
  <!-- 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  -->
  <burst-size>65535</burst-size>
  </limits>

  <authentication>
  <!-- Sources log in with username 'source' -->
  <source-password>password</source-password>
  <!-- Relays log in username 'relay' -->
  <relay-password>password</relay-password>

  <!-- Admin logs in with the username given below -->
  <admin-user>admin</admin-user>
  <admin-password>password</admin-password>
  </authentication>

  <!-- 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>
  -->

  <!-- Uncomment this if you want directory listings -->
  <!--
  <directory>
  <yp-url-timeout>15</yp-url-timeout>
  <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
  </directory>
  -->

  <!-- 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. -->
  <hostname>localhost</hostname>

  <!-- You may have multiple <listener> elements -->
  <listen-socket>
  <port>8000</port>
  <!-- <bind-address>127.0.0.1</bind-address> -->
  <!-- <shoutcast-mount>/stream</shoutcast-mount> -->
  </listen-socket>
  <!--
  <listen-socket>
  <port>8001</port>
  </listen-socket>
  -->

  <!--<master-server>127.0.0.1</master-server>-->
  <!--<master-server-port>8001</master-server-port>-->
  <!--<master-update-interval>120</master-update-interval>-->
  <!--<master-password>hackme</master-password>-->

  <!-- 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 -->
  <!--<relays-on-demand>1</relays-on-demand>-->

  <!--
  <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>
  -->

  <!-- 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"/>
  <option name="headers"  value="x-pragma,x-token"/>
  <option name="header_prefix"  value="ClientHeader."/>
  </authentication>
  </mount>

  -->

  <fileserve>1</fileserve>

  <paths>
     <!-- basedir is only used if chroot is enabled -->
  <basedir>/usr/share/icecast2</basedir>

  <!-- Note that if <chroot> is turned on below, these paths must both
  be relative to the new root, not the original root -->
  <logdir>/var/log/icecast2</logdir>
  <webroot>/usr/share/icecast2/web</webroot>
  <adminroot>/usr/share/icecast2/admin</adminroot>
  <!-- <pidfile>/usr/share/icecast2/icecast.pid</pidfile> -->

  <!-- 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.
  -->
  <!--
  <alias source="/foo" destination="/bar"/>
  -->
  <!-- Aliases: can also be used for simple redirections as well,
  this example will redirect all requests for http://server:port/ to
  the status page
  -->
  <alias source="/" destination="/status.xsl"/>
  </paths>

  <logging>
  <accesslog>access.log</accesslog>
  <errorlog>error.log</errorlog>
  <!-- <playlistlog>playlist.log</playlistlog> -->
     <loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
     <logsize>10000</logsize> <!-- Max size of a logfile -->
  <!-- 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)
  -->
  <!-- <logarchive>1</logarchive> -->
  </logging>

  <security>
  <chroot>0</chroot>
  <!--
  <changeowner>
  <user>nobody</user>
  <group>nogroup</group>
  </changeowner>
  -->
  </security>
</icecast>
 

Attachments

  • slide.jpg
    slide.jpg
    28.9 KB · Views: 42,446


Very interesting info you share here buddy, thanks you!!! I like very much these item , and if it´s not a thing to mention or yes maybe, I´ve tried once to put a radiostation in internet but failed, and now reading your post it makes me feel encouraged to try again, so I will be doing that soon... thanks.
 

Staff online


Top