developer-guide.md 3.11 KB
Newer Older
David Trattnig's avatar
David Trattnig committed
1
# 1. Aura Engine Development Guide
David Trattnig's avatar
David Trattnig committed
2
3
4

This page gives insights on extending Aura Engine internals or through the API.

David Trattnig's avatar
David Trattnig committed
5
<!-- TOC -->
David Trattnig's avatar
David Trattnig committed
6

David Trattnig's avatar
David Trattnig committed
7
8
9
10
11
12
13
14
15
16
17
- [1. Aura Engine Development Guide](#1-aura-engine-development-guide)
    - [1.1. Architecture](#11-architecture)
    - [1.2. Required Data Sources](#12-required-data-sources)
    - [1.3. Provided API Endpoints](#13-provided-api-endpoints)
    - [1.4. Components](#14-components)
    - [1.5. Running the Engine](#15-running-the-engine)
    - [1.6. Default ports used by Engine](#16-default-ports-used-by-engine)

<!-- /TOC -->

## 1.1. Architecture
David Trattnig's avatar
David Trattnig committed
18
19
20
21
22
23

AURA Engine as part of the AURA Radio Suite uses an modulear architecture
based on a REST API. All external information is retrieved using JSON data-structures.

To get the basic architectural overview, visit the [Aura Meta](https://gitlab.servus.at/autoradio/meta) repository.

David Trattnig's avatar
David Trattnig committed
24
## 1.2. Required Data Sources
David Trattnig's avatar
David Trattnig committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

The AURA Project "**Dashboard**" provides the GUI to organize shows, schedules/timelsots
and organize uploads in form of playlists. Those playlists can be organized in timeslots
using a fancy calendar interface.

These data-sources need to be configurated in the "engine.ini" configuration file:

    # The URL to get the Calendar via PV/Steering
    calendarurl="http://localhost:8000/api/v1/playout"

    # The URL to get show details via PV/Steering
    api_show_url="http://localhost:8000/api/v1/shows/${ID}/"

The AURA Project "**Tank**" on the other hand delivers information on the tracks, playlists
to be played and its meta-data:

    # The URL to get playlist details via Tank
    importerurl="http://localhost:8040/api/v1/shows/${SLUG}/playlists"


More information you can find here: <https://gitlab.servus.at/autoradio/meta/blob/master/api-definition.md>


David Trattnig's avatar
David Trattnig committed
48
## 1.3. Provided API Endpoints
David Trattnig's avatar
David Trattnig committed
49
50
51
52
53
54
55
56
57
58
59

**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/


David Trattnig's avatar
David Trattnig committed
60
## 1.4. Components
David Trattnig's avatar
David Trattnig committed
61
62
63
64
65
66
67
68
69


**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.


David Trattnig's avatar
David Trattnig committed
70
## 1.5. Running the Engine
David Trattnig's avatar
David Trattnig committed
71
72
73
74
75
76
77
78
79
80
81
82

Aura Engine is consisting of two components: The Python Engine and Liquidsoap Core.

It's important to start both components in the correct order:

    1. Run the Python engine

    ./run.sh

    2. Run the Liquidsoap core

    ./run.sh lqs
David Trattnig's avatar
David Trattnig committed
83
84
85
86
87
88
89
90
91
92
93


## 1.6. Default ports used by Engine

Aura Engine requires a number of ports for internal and external communication.

Those are the default port numbers:

* `1234` ... Liquidsoap Telnet Server
* `3333` ... Exposes the Engine API
* `5000` ... Svelte development mode; dynamically uses some other port if occupied