Skip to content
Snippets Groups Projects
README.md 6.74 KiB
Newer Older
  • Learn to ignore specific revisions
  • David Trattnig's avatar
    David Trattnig committed
    <!-- TOC -->
    
    - [AURA Engine](#aura-engine)
        - [Features](#features)
        - [Architecture](#architecture)
    
    David Trattnig's avatar
    David Trattnig committed
        - [Requirements](#requirements)
        - [Getting Started](#getting-started)
            - [Install System Packages](#install-system-packages)
            - [Install Python Packages](#install-python-packages)
            - [Setup Database](#setup-database)
            - [Alternative Sound Servers](#alternative-sound-servers)
            - [Configuration](#configuration)
        - [Running the Engine](#running-the-engine)
        - [Logging](#logging)
    
    David Trattnig's avatar
    David Trattnig committed
        - [Frequently Asked Questions](#frequently-asked-questions)
    
    David Trattnig's avatar
    David Trattnig committed
            - [Which Audio Interface / Soundcard is compatible with Aura?](#which-audio-interface--soundcard-is-compatible-with-aura)
    
    David Trattnig's avatar
    David Trattnig committed
            - [ALSA Settings](#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?](#in-the-liquidsoap-logs-i-get-error-when-starting-output-output_lineout_0-failureerror-while-setting-open_pcm-device-or-resource-busy-what-does-it-mean)
                - [How can I find the audio device IDs, required for settings in engine.ini?](#how-can-i-find-the-audio-device-ids-required-for-settings-in-engineini)
        - [Resources](#resources)
    
    <!-- /TOC -->
    
    David Trattnig's avatar
    David Trattnig committed
    
    # AURA Engine
    
    David Trattnig's avatar
    David Trattnig committed
    Aura Engine is a play-out engine as part of Automated Radio (Aura) system,
    specifically build for the requirements of community radios.
    
    David Trattnig's avatar
    David Trattnig committed
    - Play audio from multiple sources
    - Dynamic switching of sources
    - Record output to filesystem
    - Stream output to an Icecast Server
    - Multichannel Line-out
    - Blank Detenction / Silence Detecter
    - Auto Pilot a.k.a. Fallback Handling
    
    David Trattnig's avatar
    David Trattnig committed
    Read more on the [Engine Features](docs/engine-features.md) page.
    
    
    ## Architecture
    
    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.
    
    
    David Trattnig's avatar
    David Trattnig committed
    To learn more, checkout the [Engine Developer Guide](docs/developer-guide.md) or visit
     the [Aura Meta](https://gitlab.servus.at/autoradio/meta) repository.
    
    David Trattnig's avatar
    David Trattnig committed
    ## Requirements
    
    David Trattnig's avatar
    David Trattnig committed
    **Hardware Requirements:** This depends on how many audio sources and targets you are
     going to use, but for the most common scenarios any current hardware should be sufficient.
     For the audio devices it is required to use an interface which has supported ALSA drivers.
    
    **Operating System:** Any linux system with ALSA, PulseAudio or Jack2 support should work. 
    It is tested and coded on Debian Stretch and Ubuntu 18.0 with Python 3.6+.
    
    
    David Trattnig's avatar
    David Trattnig committed
    
    ## Getting Started
    
    git clone https://gitlab.servus.at/autoradio/engine
    
    David Trattnig's avatar
    David Trattnig committed
    ### Install System Packages
    
        git \
        python3 python3-pip \
        redis-server \
        liquidsoap liquidsoap-plugin-icecast \
        mariadb-server libmariadbclient-dev \
        quelcom \
        liquidsoap-plugin-alsa liquidsoap-plugin-pulseaudio
    
    **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
    ```
    
    
    To simply install support for all available file formats do:
    
    David Trattnig's avatar
    David Trattnig committed
    ### Install Python Packages
    
    Gottfried Gaisbauer's avatar
    Gottfried Gaisbauer committed
    ```bash
    
    sudo pip3 install -r requirements.txt
    
    David Trattnig's avatar
    David Trattnig committed
    ### Setup Database
    
    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
    ```
    
    David Trattnig's avatar
    David Trattnig committed
    ### Alternative Sound Servers
    
    Beside ALSA the sound servers **Jack Audio** and **Pulse Audio** are supported.
    
    Install the JACK daemon and GUI:
    
    Gottfried Gaisbauer's avatar
    Gottfried Gaisbauer committed
    ```bash
    
        sudo apt-get install jackd qjackctl 
    
    Gottfried Gaisbauer's avatar
    Gottfried Gaisbauer committed
    ```
    
    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:
    
    Next you need to install the JACK plugin for Liquidsoap:
    
    ```bash
    sudo apt install \
        liquidsoap-plugin-jack
    ```
    
    David Trattnig's avatar
    David Trattnig committed
    ### Configuration
    
    This creates the folder */var/audio* and copies some default configuration
    to */etc/aura/engine.ini*
    
    After that, you have to edit the settings in */etc/aura/engine.ini*. Ensure to take your time to carefully review those settings!
    
    David Trattnig's avatar
    David Trattnig committed
    ## 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.
    
    
    David Trattnig's avatar
    David Trattnig committed
    ## Logging
    
    
    You can access the service logs using:
    
        journalctl -u aura-lqs
    
    and
    
        journalctl -u aura-engine
    
    respectively.
    
    
    David Trattnig's avatar
    David Trattnig committed
    ## Frequently Asked Questions
    
    David Trattnig's avatar
    David Trattnig committed
    ### Which Audio Interface / Soundcard is compatible with Aura?
    
    David Trattnig's avatar
    David Trattnig committed
    Basically any audio device which is supported by Linux Debian/Ubuntu and has ALSA drivers.
    Engine has been tested with following audio interfaces:
    
    David Trattnig's avatar
    David Trattnig committed
    - ASUS Xonar DGX,
    - Roland Duo-Capture Ex
    - Onboard Soundcard (HDA Intel ALC262)
    - Native Instruments Komplete Audio 6
    
    
    
    ### 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
    
     * install the realtime kernel with
    
     * invest in better hardware
    
    
    ## Resources ##
    
    * **Python**: https://docs.python.org/
    * **Redis**: https://redis.io/
    * **Liquidsoap**: https://www.liquidsoap.info/doc-1.4.0/
    * **Jack Audio**: https://jackaudio.org/