AURA Engine
This piece of Software is part of 'AURA - AUtomated RAdio'.
AURA Engine does:
- requesting the programme from an external Source
- switches the soundserver at the correct time to a given source for a specific show
- records what is broadcasted
- streams to an icecast server
- plays to lineout
Installation
Software
Operating System
Any linux system with ALSA, pulseaudio or Jack2 support should work. It is tested and coded on a debian stretch
Packages
On a debian machine:
sudo apt install \
git \
python3 python3-pip \
redis-server \
liquidsoap liquidsoap-plugin-icecast \
mariadb-server libmariadbclient-dev \
quelcom
Liquidsoap Plugins
Soundcard
How liquidsoap is using your soundcard is depending on what you are going to use:
with ALSA:
sudo apt install \
liquidsoap-plugin-alsa liquidsoap-plugin-pulseaudio
With pulseaudio:
sudo apt install \
liquidsoap-plugin-pulseaudio
with jack:
sudo apt install \
liquidsoap-plugin-jack
File Formats
Depending on what stream you are going to send, and what recordings you are going to use:
sudo apt install \
liquidsoap-plugin-aac # for aac support
liquidsoap-plugin-flac # for flac support
liquidsoap-plugin-lame liquidsoap-plugin-mad # for mp3 support
liquidsoap-plugin-opus # for opus support
liquidsoap-plugin-vorbis # for ogg support
Simple
sudo apt install \
liquidsoap-plugin-all
Python Packages
sudo pip3 install \
Flask Flask-SQLAlchemy \
mysqlclient redis json \
mutagen validators
Grab the code
git clone https://gitlab.servus.at/autoradio/engine
Set up a database
Command line way
mysql -u root -p
CREATE DATABASE aura_engine CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'aura'@'localhost' IDENTIFIED BY 'secure-password';
GRANT ALL PRIVILEGES ON aura_engine.* TO 'aura'@'localhost';
phpmyadmin / adminer way
Log into your phpmyadmin or adminer with correct privileges, create a database and a user for the aura engine.
Files and Folders
- Create the audio folder defined in your aura.ini
mkdir /var/audio
mkdir /etc/aura
cp {where you cloned the repo}/configuration/engine.ini /etc/aura/engine.ini
edit engine.ini to your needs
- Edit settings in aura.ini. Take your time for that.
aura.py
It is the server which is connected to the external programme source (e.g. aura steering and tank), to liquidsoap and is listening for redis pubsub messages. This precious little server is telling liquidsoap what to play and when.
Guru
The commandline tool for interacting with the server. Also provides the communication from Liquidsoap to the python (Command-)Server.
Liquidsoap
The heart of AURA Engine. It uses the built in mixer, to switch between different sources. It records everything and streams everything depending on your settings in aura.ini.
Find Help
Liquidsoap
Reference:
http://savonet.sourceforge.net/doc-svn/reference.html
Python
Reference:
https://docs.python.org/3.5/
Interfaces
From Aura Engine
Soundserverstate
Returns true and false values of the internal In- and Outputs
/api/v1/soundserver_state
Trackservice
/api/v1/trackservice/<selected_date>
/api/v1/trackservice/
To Aura Engine
Interfaces are needed from pv/steering to engine and from tank to engine. More informations you can find here: https://gitlab.servus.at/autoradio/meta/blob/master/api-definition.md
Hardware
Soundcard
AURA Engine is tested with a ASUS Xonar DGX, a Roland Duo-Capture Ex and also on an Onboard Soundcard (HDA Intel ALC262). Both work well with jack and pulseaudio. For a good experience with ALSA, you may need better hardware.
Hard/Soft
When you use ALSA, you will have to play around with ALSA settings. In the folder ./modules/liquidsoap is a scipt called alsa_settings_tester.liq. You can start it with 'liquidsoap -v --debug alsa_settings_tester.liq'. Changing and playing with settings may help you to find correct ALSA settings.
Line In
You can configure up to five line ins. Your hardware should support that. When you use JACK, you will see the additional elements popping up when viewing your connections (with e.g. Patchage).
Recordings
You can configure up to five recorders. You find the settings in the main config file engine.ini. You can choose between different output formats.
Streams
You can configure up to five streams. You find the settings in the engine.ini. You can choose between different streaming formats.
Troubleshooting
If you cannot find correct ALSA settings
Well, this is - at least for me - a hard one. I could not manage to find correct ALSA settings for the above mentioned soundcards. The best experience i had with the ASUS Xonar DGX, but still very problematic (especially the first couple of minutes after starting liquidsoap). Since i enabled JACK support i only use that. It is also a bit of trial and error, but works pretty much out of the box.
If you experience 'hangs' or other artefacts on the output signal
-
reduce the quality (especially, when hangs are on the stream) or
-
install the realtime kernel with
apt install linux-image-rt-amd64 reboot
or
-
invest in better hardware