Skip to content
Snippets Groups Projects
README.md 5.38 KiB
Newer Older
  • Learn to ignore specific revisions
  • # 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 \
    
    ##### 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
    ```
    
    
    Gottfried Gaisbauer's avatar
    Gottfried Gaisbauer committed
    ```bash
    
    sudo pip3 install \
    
        mysqlclient redis \
    
    git clone https://gitlab.servus.at/autoradio/engine
    
    ##### Command line way 
    
    
    Gottfried Gaisbauer's avatar
    Gottfried Gaisbauer committed
    ```bash
    
    Gottfried Gaisbauer's avatar
    Gottfried Gaisbauer committed
    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
    ```
    
    ##### phpmyadmin / adminer way
    
    
    Log into your phpmyadmin or adminer with correct privileges, create a database and a user for the aura engine.
    
    Gottfried Gaisbauer's avatar
    Gottfried Gaisbauer committed
    #### Files and Folders
    
    * Create the audio folder defined in your aura.ini
    
    Gottfried Gaisbauer's avatar
    Gottfried Gaisbauer committed
    
    ```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
    
    Gottfried Gaisbauer's avatar
    Gottfried Gaisbauer committed
    ```
    
    * Edit settings in aura.ini. Take your time for that.
    
    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.
    
    The commandline tool for interacting with the server. Also provides the communication from Liquidsoap to the python (Command-)Server.
    
    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.
    
    ##### 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
    
    Gottfried Gaisbauer's avatar
    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's avatar
    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.
    
    You can configure up to **five** streams. You find the settings in the engine.ini. You can choose between different streaming formats.
    
    **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
    
       or
     * invest in better hardware