Radio control via browser

Airtime LogoIn the process of creating your own radio station, the flow of ideas reached the broadcasts through the web interface. At first I tried to find ready-made solutions, but I almost did not find anything in RuNet. I began to think over the implementation method and miraculously stumbled upon an article in the English Wikipedia version about Airtime (until January 18, 2011 - Campcaster) from Sourcefabric.

Airtime Features:
  • Creating a live grid and playlists via the web interface;
  • Download music via browser (drag and drop support);
  • Registration of hosts who have access to the admin panel and can manage the ethers;
  • Creating widgets with a schedule of broadcasts and tracks for third-party sites;
  • The ability to record broadcasts for re-broadcast;
  • Several options for broadcasting an audio stream.
The minimum system requirements described in the official instructions: 1Ghz processor and 512Mb of RAM.

Select server options


First test server:
  • OS: Ubuntu-10.10-x86_64;
  • CPU: 500Mhz;
  • Memory: 256Mb;
  • Disk space: 5000Mb.

The load at idle without listeners reached 90%. In normal mode, the server could not support comfortable listening to the radio. And all program modules occupy almost 1GB, which is 20% of the total disk space.

Second server:
  • OS: Ubuntu-10.10-x86_64;
  • CPU: 750Mhz;
  • Memory: 512Mb;
  • Disk space: 20Gb.

This server performed better. At idle, the processor load is on average 25%; it can be used as a server for a small number of listeners.

Server Tuning


Airtime with all the necessary packages can be installed either manually or automatically. In any case, you need to prepare, namely, add Surcefabric to the list of repositories, because they have all the necessary packages.
$ nano /etc/apt/sources.list

For Ubuntu, add the line: For Debian: Update the list of repositories: Set the signature key: Airtime uses the PostgreSQL database to store playlists, track and user information. Therefore, we install it: In order for users to hear the broadcast, you need to install a streaming server. I use Icecast2 for these purposes, as it is very convenient to configure and uses few system resources.
deb apt.sourcefabric.org lucid main
#или
deb apt.sourcefabric.org maverick main



deb apt.sourcefabric.org squeeze main


$ apt-get update


$ apt-get install sourcefabric-keyring


$ apt-get install postgresql


$ apt-get install icecast2

If the broadcast is planned for the audio output of the sound card, then you need to remove the PulseAudio audio server, and instead put the ALSA mixer.
$ apt-get purge pulseaudio

For graphical interface:
$ apt-get install gnome-alsamixer

For console:
$ apt-get install alsa-utils

Manual Airtime Installation

Installing all the necessary packages: Next, install the necessary Python modules for Airtima to work: Install phing: Download, unpack and install Airtime: Work with Apache. We configure the necessary modules and create the virtual host configuration: In the open file, we write:
$ apt-get install apache2 curl daemontools daemontools-run ecasound \
gzip libao-ocaml libapache2-mod-php5 libcamomile-ocaml-dev libesd0 \
libmad-ocaml libmp3lame0 libmp3lame-dev libportaudio2 libsamplerate0 \
libsoundtouch-ocaml libtaglib-ocaml libvorbis-ocaml-dev mpg123 multitail \
odbc-postgresql oggvideotools openssl php-pear php5-curl php5-gd \
php5-pgsql poc-streamer pwgen python python-configobj python-mutagen \
python-pip python-setuptools rabbitmq-server tar unzip



$ pip install kombu
$ pip install poster



$ mkdir -p /tmp/pear/cache
$ pear channel-discover pear.phing.info
$ pear install phing/phing-2.4.2



$ wget downloads.sourceforge.net/project/Airtime/1.8.1/Airtime-1.8.1.tar.gz
$ tar -xvzf Airtime-1.8.1.tar.gz -C /var/lib/
$ chown -R root.root /var/lib/Airtime/
$ cd /var/lib/Airtime/install/
$ php Airtime-install.php



$ a2enmod php5 rewrite
$ nano /etc/apache2/sites-available/Airtime




ServerName example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/Airtime/public
SetEnv APPLICATION_ENV "development"

DirectoryIndex index.php
AllowOverride all
Order allow,deny
Allow from all

We save and restart Apache. We
$ /etc/init.d/apache2 reload

configure PHP for Airtime, for this, in the /etc/php5/apache2/php.ini file, you need to find and change the following parameters:
memory_limit = 256M
magic_quotes_gpc = Off
file_uploads = On
upload_tmp_dir = /tmp
phar.readonly = Off

Further we need to configure Icecast2, for this we’ll go to edit the configuration file /etc/icecast2/icecast.xml . It is most important to register a password for broadcasting from third-party applications, it will need to be registered in other configuration files. We set passwords between tags, and
somepasswordsomepasswordadminadminpassword

After that, we need to allow icecast2 to start:
$ nano /etc/default/icecast2

Replace the ENABLE = false line with ENABLE = true , save and restart IceCast2:
$ service icecast2 start

Next, we need to configure liquidsoap, which will direct the flow from Airtime to IceCast2:
$ nano /etc/Airtime/liquidsoap.cfg

In the “stream settings” section, specify the access parameters for icecast2.
# Необходимо прописать тот же пароль, что и в icecast.xml
Icecast_pass = “somepassword”
# Какой поток, будем отправлять. Можно со звуковой карты или отправлять в формате
# Ogg Vorbis и MP3. Для свого сервера я формировал поток в MP3, без использования
# звуковой карты.
output_sound_device = false
output_icecast_vorbis = false
output_icecast_mp3 = true

We restart the server and we can start broadcasting.

Silent installation

$ mkdir -p /tmp/pear/cache
$ apt-get install Airtime


During installation, you will be asked questions about the configuration of Apache2 and RabbitMQ.
After installation, you need to configure PHP, IceCast2, Liquidsoap and Airtime. We restart the server and we can start broadcasting.

Setting the air via the web panel


We go to the virtual host, which is registered in / etc / apache2 / sites-available / Airtime (in our case, example.com ), we are welcomed by the authorization form. From the very beginning, the username and password are “admin”. After logging in, select “CONFIGURE -> Manage Users” in the menu and change the administrator password, you can immediately create new users with different types of access. In the “ADD MEDIA” tab, we have the opportunity to download the music that we plan to use on the radio. Multiboot and drag and drop are supported. The PLAYLIST BUILDER tab allows you to create new playlists. This is done by dragging and dropping tracks from the list loaded into the playlist. In the “CALENDAR” tab, we create and edit the ether grid.














As soon as we set up the ethers, add music and playlists, the necessary music will play clearly on schedule.
We go to example.com:8000 and can listen to our radio.

Conclusion


Advantages of Airtime:
  • Easy installation
  • Intuitive graphical interface;
  • Flexibility of customization;
  • The ability to broadcast live on a sound card.

Disadvantages:
  • Heavily loads the system;
  • Poor Cyrillic support.

If you plan to broadcast your radio station to a large number of listeners, then it is better to use several servers:
  1. Medium power server for installing Airtime and all related utilities on it;
  2. A powerful server for installing Icescast2 on it, which will relay the stream from the first server.


More information about Airtime and its configuration can be found on the developer's website: www.sourcefabric.org/en/products/Airtime_overview

Also popular now: