Newer
Older
# 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:
```bash
sudo apt install \
git \
python3 python3-pip \

Gottfried Gaisbauer
committed
redis-server \

Gottfried Gaisbauer
committed
liquidsoap liquidsoap-plugin-icecast \

Gottfried Gaisbauer
committed
mariadb-server libmariadbclient-dev \
quelcom

Gottfried Gaisbauer
committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
##### Liquidsoap Plugins
###### Soundcard
How liquidsoap is using your soundcard is depending on what you are going to use:
with ALSA:
```bash
sudo apt install \
liquidsoap-plugin-alsa liquidsoap-plugin-pulseaudio
```
With pulseaudio:
```bash
sudo apt install \
liquidsoap-plugin-pulseaudio
```
with jack:
```bash
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:
```bash
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
```bash
sudo apt install \
liquidsoap-plugin-all
```
#### Python Packages

Gottfried Gaisbauer
committed
Flask Flask-SQLAlchemy \

Gottfried Gaisbauer
committed
mutagen validators

Gottfried Gaisbauer
committed
#### Grab the code
git clone https://gitlab.servus.at/autoradio/engine

Gottfried Gaisbauer
committed
#### Set up a database
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';

Gottfried Gaisbauer
committed
Log into your phpmyadmin or adminer with correct privileges, create a database and a user for the aura engine.
* Create the audio folder defined in your aura.ini
mkdir /var/audio
mkdir /etc/aura

Gottfried Gaisbauer
committed
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

Gottfried Gaisbauer
committed
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.

Gottfried Gaisbauer
committed
##### 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

Gottfried Gaisbauer
committed
#### Soundcard

Gottfried Gaisbauer
committed
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.

Gottfried Gaisbauer
committed
#### Hard/Soft

Gottfried Gaisbauer
committed
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.

Gottfried Gaisbauer
committed

Gottfried Gaisbauer
committed
#### Streams

Gottfried Gaisbauer
committed

Gottfried Gaisbauer
committed
You can configure up to **five** streams. You find the settings in the engine.ini. You can choose between different streaming formats.

Gottfried Gaisbauer
committed

Gottfried Gaisbauer
committed
### Troubleshooting

Gottfried Gaisbauer
committed

Gottfried Gaisbauer
committed
**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.

Gottfried Gaisbauer
committed

Gottfried Gaisbauer
committed
**If you experience 'hangs' or other artefacts on the output signal**
* reduce the quality (especially, when hangs are on the stream) or

Gottfried Gaisbauer
committed
```bash
apt install linux-image-rt-amd64
reboot
```