diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f0926440802ccb472a0b3d503e757318bc19ea9a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +*.pyc +*.log diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..5ca1868a8c990ae3ac798d8e8059ffe2eba75858 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,23 @@ +image: python:3.6 + +stages: + - test + +before_script: + - apt-get -qq update + - apt-cache search libmariadb + - apt-get install -y python3-virtualenv virtualenv redis-server redis-tools libev4 libev-dev # mariadb-server libmariadbclient-dev + - /usr/bin/virtualenv venv + - . venv/bin/activate + - python3 -V + - pip3 install -r requirements.txt + - mkdir /etc/aura + - mkdir /var/log/aura + - cp ./configuration/engine.ini /etc/aura/ + +simple_guru_help: + stage: test + script: + - whoami + - python3 guru.py -h + diff --git a/README.md b/README.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b9b548f54ed229e8830f2dd78f828f31d146c8e6 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,88 @@ +# 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 + +## Installation + +### Software + +#### Operating System + +Any sound supporting linux system should work. It is tested and coded on a **debian stretch** + +#### Packages + +On a debian machine: + +```bash +sudo apt install \ + git \ + python3 python3-pip \ + redis-server redis-tools \ + liquidsoap liquidsoap-plugin-alsa liquidsoap-plugin-flac liquidsoap-plugin-icecast liquidsoap-plugin-pulseaudio \ + libev4 libev-dev \ + mariadb-server libmariadbclient-dev +``` + + +#### Python Packages + +```bash +sudo pip3 install \ + Flask Flask-Babel Flask-SQLAlchemy Flask-WTF \ + mysqlclient redis simplejson mutagen + pyev python-dateutil +``` + +#### get the code + +git clone https://gitlab.servus.at/autoradio/engine + +#### Set Up a database + +```bash +mysql -u root -p + +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'; +``` + +#### Files and Folders + +Create the audio folder defined in your aura.ini + +```bash +mkdir /var/audio +mkdir /etc/aura +cp {where you cloned the repo}/configuration/aura.ini /etc/aura/aura.ini +``` + +edit installation dir and database settings in aura.ini + +#### aura.py + +It is the server which is connected to the external programme source, to liquidsoap and is listening for redis pubsub messages. + +#### Guru + +The commandline tool for interacting with the server. + +#### Liquidsoap + +The heart of AURA Engine. It uses the built in mixer, to switch between different sources. A source can be a stream, the filesystem or linein + +### Hardware + +#### Soundcard + +AURA Engine ist tested with an ASUS Xonar DGX. It should work with every by ALSA supported soundcard. PulseAudio support is planned. + +#### 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 can help you to find correct ALSA settings. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..92f76983d90b76a0ce412f2f6d47e0e006a955c4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +Flask==0.12.2 +Flask-Babel==0.11.2 +Flask-SQLAlchemy==2.2 +Flask-WTF==0.14.2 +mysqlclient==1.3.7 +redis==2.10.5 +simplejson==3.11.1 +mutagen==1.38 +python-dateutil==2.6.0