README.md 5.38 KB
Newer Older
1
2
3
4
5
6
7
8
# 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
9
10
 * streams to an icecast server
 * plays to lineout
11
12
13
14
15
16
17

## Installation

### Software

#### Operating System

18
Any linux system with ALSA, pulseaudio or Jack2 support should work. It is tested and coded on a **debian stretch**
19
20
21
22
23
24

#### Packages

On a debian machine:

```bash
25
26
27
sudo apt install \
    git \
    python3 python3-pip \
28
    redis-server \
29
    liquidsoap liquidsoap-plugin-icecast \
30
31
    mariadb-server libmariadbclient-dev \
    quelcom
32
33
```

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

76

77
78
#### Python Packages

Gottfried Gaisbauer's avatar
Gottfried Gaisbauer committed
79
```bash
80
sudo pip3 install \
81
    Flask Flask-SQLAlchemy \
Christian Pointner's avatar
Christian Pointner committed
82
    mysqlclient redis \
83
    mutagen validators
84
85
```

86
#### Grab the code
87

88
```bash
89
git clone https://gitlab.servus.at/autoradio/engine
90
```
91

92
#### Set up a database
93

94
95
##### Command line way 

Gottfried Gaisbauer's avatar
Gottfried Gaisbauer committed
96
```bash
97
98
mysql -u root -p

Gottfried Gaisbauer's avatar
Gottfried Gaisbauer committed
99
100
101
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's avatar
Gottfried Gaisbauer committed
102
```
103

104
105
##### phpmyadmin / adminer way

106
Log into your phpmyadmin or adminer with correct privileges, create a database and a user for the aura engine.
107

Gottfried Gaisbauer's avatar
Gottfried Gaisbauer committed
108
#### Files and Folders
109

110
* Create the audio folder defined in your aura.ini
Gottfried Gaisbauer's avatar
Gottfried Gaisbauer committed
111
112

```bash
113
114
mkdir /var/audio
mkdir /etc/aura
115
116
cp {where you cloned the repo}/configuration/engine.ini /etc/aura/engine.ini
edit engine.ini to your needs
Gottfried Gaisbauer's avatar
Gottfried Gaisbauer committed
117
```
118

119
* Edit settings in aura.ini. Take your time for that.
120

121
122
#### aura.py

123
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.
124
125
126

#### Guru

127
The commandline tool for interacting with the server. Also provides the communication from Liquidsoap to the python (Command-)Server.
128
129
130

#### Liquidsoap

131
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.
132
133
134

#### Find Help

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
##### 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
157
158
159

### Hardware

160
#### Soundcard
Gottfried Gaisbauer's avatar
newline    
Gottfried Gaisbauer committed
161

162
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.
163

164
#### Hard/Soft
Gottfried Gaisbauer's avatar
newline    
Gottfried Gaisbauer committed
165

166
167
168
169
170
171
172
173
174
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.
175

176
#### Streams
177

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

180
### Troubleshooting
181

182
183
**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.
184

185
186
**If you experience 'hangs' or other artefacts on the output signal**
 * reduce the quality (especially, when hangs are on the stream) or
187
 * install the realtime kernel with
188
 
189
190
191
192
   ```bash
   apt install linux-image-rt-amd64
   reboot
   ```
193
   
194
195
   or
 * invest in better hardware