@@ -101,66 +142,52 @@ 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.
#### Alternative Sound Servers
#### Files and Folders
Beside ALSA the sound servers **Jack Audio** and **Pulse Audio** are supported.
* Create the audio folder defined in your aura.ini
**Using JACK:**
Install the JACK daemon and GUI:
```bash
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
sudo apt-get install jackd qjackctl
```
* Edit settings in aura.ini. Take your time for that.
Please ensure to enable "*realtime process priority*" when installing JACK to keep latency low.
Now, you are able to configure your hardware settings using following command:
#### 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
```bash
qjackctl
```
The commandline tool for interacting with the server. Also provides the communication from Liquidsoap to the python (Command-)Server.
Next you need to install the JACK plugin for Liquidsoap:
#### Liquidsoap
```bash
sudo apt install\
liquidsoap-plugin-jack
```
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.
This creates the folder */var/audio* and copies some default configuration
to */etc/aura/engine.ini*
_Soundserverstate_\
Returns true and false values of the internal In- and Outputs \
/api/v1/soundserver_state
After that, you have to edit the settings in */etc/aura/engine.ini*. Ensure to take your time to carefully review those settings!
_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.
...
...
@@ -177,19 +204,97 @@ You can configure up to **five** recorders. You find the settings in the main co
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**\
### Running the Engine ###
To start the AuRa Engine execute:
systemctl start aura-lqs
systemctl start aura-engine
and on system boot run following:
systemctl enable aura-lqs
systemctl enable aura-engine
The first service starts the LiquidSoap Engine, while the latter boots the actual AuRa Engine.
### Logging
You can access the service logs using:
journalctl -u aura-lqs
and
journalctl -u aura-engine
respectively.
## Development
To run the LiquidSoap code during develpment execute:
./run.sh
### Components ###
**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.
## Frequently Asked Questions ##
### ALSA Settings
#### In the Liquidsoap Logs I get 'Error when starting output output_lineout_0: Failure("Error while setting open_pcm: Device or resource busy")!'. What does it mean?
You probably have set a wrong or occupied device ID.
#### How can I find the audio device IDs, required for settings in engine.ini?
***ALSA**: You can get the device numbers or IDs by executing:
cat /proc/asound/cards
***Pulse Audio**: You might not need this for Pulse Audio, but still, to see all available devices use:
pactl list
**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