From 43ba0b2f6e7bbe8f97a06a41313e1c028d9e4046 Mon Sep 17 00:00:00 2001
From: David Trattnig <david.trattnig@o94.at>
Date: Thu, 7 May 2020 20:09:12 +0200
Subject: [PATCH] Ditch AAC for now to avoid the dependency hassle.

---
 .gitlab-ci.yml                              |  4 ++--
 Dockerfile                                  |  1 -
 configuration/sample-development.engine.ini | 22 ++++++++++-----------
 configuration/sample-docker.engine.ini      | 22 ++++++++++-----------
 configuration/sample-production.engine.ini  | 22 ++++++++++-----------
 docs/installation-development.md            |  5 ++---
 docs/installation-production.md             | 17 +---------------
 modules/liquidsoap/library.liq              |  8 ++++----
 script/install-opam-packages.sh             |  4 ++--
 9 files changed, 44 insertions(+), 61 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3fd43ea5..df0c7c08 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,8 +13,8 @@ before_script:
   # - opam switch create 4.08.0
   # - opam update -y
   # - opam install depext -y
-  # - opam depext taglib mad lame vorbis fdkaac flac opus cry samplerate pulseaudio bjack alsa liquidsoap -y
-  # - opam install taglib mad lame vorbis fdkaac flac opus cry samplerate pulseaudio bjack alsa liquidsoap -y
+  # - opam depext taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa liquidsoap -y
+  # - opam install taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa liquidsoap -y
   # - eval $(opam env)
   - python3 -V
   - pip3 install -r requirements.txt
diff --git a/Dockerfile b/Dockerfile
index 731b2f79..9dc518b9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -44,7 +44,6 @@ RUN opam init --disable-sandboxing -y
 RUN opam switch create 4.08.0
 RUN opam update -y
 RUN opam install depext -y
-# FIXME Missing "fdkaac" in dependencies below, which requires system package "libfaac-dev"
 RUN opam depext taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa liquidsoap -y 
 RUN opam install taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa liquidsoap -y
 RUN eval $(opam env)
\ No newline at end of file
diff --git a/configuration/sample-development.engine.ini b/configuration/sample-development.engine.ini
index c327e567..b8a22c9c 100644
--- a/configuration/sample-development.engine.ini
+++ b/configuration/sample-development.engine.ini
@@ -165,7 +165,7 @@ frame_size=""
 #####################
 
 # you can define up to 5 recorder types.
-# aac, flac, mp3, ogg, opus and wav is supported
+# flac, mp3, ogg, opus and wav is supported
 
 [recording]
 # flac example
@@ -182,20 +182,20 @@ rec_0_bitrate="128"
 # channels: everything else than 2 is considered as mono
 rec_0_channels="2"
 
-# aac example
+# mp3 example
 rec_1="n"
-rec_1_folder="/var/recordings/aac"
+rec_1_folder="/var/audio/rec/mp3"
 rec_1_duration="30"
-rec_1_encoding="aac"
-rec_1_bitrate="64"
+rec_1_encoding="mp3"
+rec_1_bitrate="320"
 rec_1_channels="2"
 
 # mp3 example
 rec_2="n"
-rec_2_folder="/var/recordings/mp3"
+rec_2_folder="/var/audio/rec/mp3"
 rec_2_duration="30"
 rec_2_encoding="mp3"
-rec_2_bitrate="32"
+rec_2_bitrate="192"
 rec_2_channels="2"
 
 # ogg example
@@ -227,13 +227,13 @@ rec_4_channels="2"
 ###################
 
 # You can define up to outgoing 5 streams
-# aac, flac, mp3, ogg and opus is supported
+# flac, mp3, ogg and opus is supported
 
 [stream]
 # defines enabled or not
 stream_0="n"
-# possible values: aac, flac, mp3, ogg, opus (depending on what liquidsoap-plugins you installed)
-stream_0_encoding="aac"
+# possible values: flac, mp3, ogg, opus (depending on what liquidsoap-plugins you installed)
+stream_0_encoding="ogg"
 # bitrate (with encoding types without bitrate like flac or ogg it is substituted. 32 => very poor quality. 320 => very high quality)
 stream_0_bitrate="128"
 # how many channels? everything else than 2 is considered as mono
@@ -243,7 +243,7 @@ stream_0_host="localhost"
 # and which port?
 stream_0_port="8888"
 # the name of the mountpoint
-stream_0_mountpoint="aura-test-0.aac"
+stream_0_mountpoint="aura-test-0.ogg"
 # username
 stream_0_user="source"
 # and the password
diff --git a/configuration/sample-docker.engine.ini b/configuration/sample-docker.engine.ini
index ebcb2970..cd5639cc 100644
--- a/configuration/sample-docker.engine.ini
+++ b/configuration/sample-docker.engine.ini
@@ -164,7 +164,7 @@ frame_size=""
 #####################
 
 # you can define up to 5 recorder types.
-# aac, flac, mp3, ogg, opus and wav is supported
+# flac, mp3, ogg, opus and wav is supported
 
 [recording]
 # flac example
@@ -181,20 +181,20 @@ rec_0_bitrate="128"
 # channels: everything else than 2 is considered as mono
 rec_0_channels="2"
 
-# aac example
+# mp3 example
 rec_1="n"
-rec_1_folder="/var/recordings/aac"
+rec_1_folder="/var/audio/rec/mp3"
 rec_1_duration="30"
-rec_1_encoding="aac"
-rec_1_bitrate="64"
+rec_1_encoding="mp3"
+rec_1_bitrate="320"
 rec_1_channels="2"
 
 # mp3 example
 rec_2="n"
-rec_2_folder="/var/recordings/mp3"
+rec_2_folder="/var/audio/rec/mp3"
 rec_2_duration="30"
 rec_2_encoding="mp3"
-rec_2_bitrate="32"
+rec_2_bitrate="192"
 rec_2_channels="2"
 
 # ogg example
@@ -226,13 +226,13 @@ rec_4_channels="2"
 ###################
 
 # You can define up to outgoing 5 streams
-# aac, flac, mp3, ogg and opus is supported
+# flac, mp3, ogg and opus is supported
 
 [stream]
 # defines enabled or not
 stream_0="n"
-# possible values: aac, flac, mp3, ogg, opus (depending on what liquidsoap-plugins you installed)
-stream_0_encoding="aac"
+# possible values: flac, mp3, ogg, opus (depending on what liquidsoap-plugins you installed)
+stream_0_encoding="ogg"
 # bitrate (with encoding types without bitrate like flac or ogg it is substituted. 32 => very poor quality. 320 => very high quality)
 stream_0_bitrate="128"
 # how many channels? everything else than 2 is considered as mono
@@ -242,7 +242,7 @@ stream_0_host="localhost"
 # and which port?
 stream_0_port="8888"
 # the name of the mountpoint
-stream_0_mountpoint="aura-test-0.aac"
+stream_0_mountpoint="aura-test-0.ogg"
 # username
 stream_0_user="source"
 # and the password
diff --git a/configuration/sample-production.engine.ini b/configuration/sample-production.engine.ini
index 9dd9f9b3..c767a1b9 100644
--- a/configuration/sample-production.engine.ini
+++ b/configuration/sample-production.engine.ini
@@ -164,7 +164,7 @@ frame_size=""
 #####################
 
 # you can define up to 5 recorder types.
-# aac, flac, mp3, ogg, opus and wav is supported
+# flac, mp3, ogg, opus and wav is supported
 
 [recording]
 # flac example
@@ -181,20 +181,20 @@ rec_0_bitrate="128"
 # channels: everything else than 2 is considered as mono
 rec_0_channels="2"
 
-# aac example
+# mp3 example
 rec_1="n"
-rec_1_folder="/var/recordings/aac"
+rec_1_folder="/var/audio/rec/mp3"
 rec_1_duration="30"
-rec_1_encoding="aac"
-rec_1_bitrate="64"
+rec_1_encoding="mp3"
+rec_1_bitrate="320"
 rec_1_channels="2"
 
 # mp3 example
 rec_2="n"
-rec_2_folder="/var/recordings/mp3"
+rec_2_folder="/var/audio/rec/mp3"
 rec_2_duration="30"
 rec_2_encoding="mp3"
-rec_2_bitrate="32"
+rec_2_bitrate="192"
 rec_2_channels="2"
 
 # ogg example
@@ -226,13 +226,13 @@ rec_4_channels="2"
 ###################
 
 # You can define up to outgoing 5 streams
-# aac, flac, mp3, ogg and opus is supported
+# flac, mp3, ogg and opus is supported
 
 [stream]
 # defines enabled or not
 stream_0="n"
-# possible values: aac, flac, mp3, ogg, opus (depending on what liquidsoap-plugins you installed)
-stream_0_encoding="aac"
+# possible values: flac, mp3, ogg, opus (depending on what liquidsoap-plugins you installed)
+stream_0_encoding="ogg"
 # bitrate (with encoding types without bitrate like flac or ogg it is substituted. 32 => very poor quality. 320 => very high quality)
 stream_0_bitrate="128"
 # how many channels? everything else than 2 is considered as mono
@@ -242,7 +242,7 @@ stream_0_host="localhost"
 # and which port?
 stream_0_port="8888"
 # the name of the mountpoint
-stream_0_mountpoint="aura-test-0.aac"
+stream_0_mountpoint="aura-test-0.ogg"
 # username
 stream_0_user="source"
 # and the password
diff --git a/docs/installation-development.md b/docs/installation-development.md
index 64963b62..d24b8393 100644
--- a/docs/installation-development.md
+++ b/docs/installation-development.md
@@ -31,11 +31,10 @@ sudo apt-get install \
     ffmpeg \
     quelcom \
     python3-pip \
-    virtualenv \
-    libfaac-dev
+    virtualenv
 ```
 
-Depending on the database management system you gonna use, you'll also need to install those packages. 
+Depending on the database management system you gonna use, you'll also need to install those packages.
 
 In case of MariaDB this is:
 
diff --git a/docs/installation-production.md b/docs/installation-production.md
index 8b5bcf2b..c1e4ebc2 100644
--- a/docs/installation-production.md
+++ b/docs/installation-production.md
@@ -23,20 +23,6 @@ Aura Engine runs on any modern Debian-based OS. It requires at least
 
 Additionally you'll need these system packages below.
 
-Some packages may require *Non-Free* (Debian) or *Multiverse* (Ubuntu) Repository support. One of these
-packages is `libfaac-dev`. Therefor edit your `/etc/apt/sources.list` and add `contrib non-free` in case of Debian:
-
-```
-deb http://ftp.at.debian.org/debian/ buster main contrib non-free
-```
-
-In case of Ubuntu you can add Universe and Multiverse support by:
-
-```shell
-sudo add-apt-repository universe
-sudo add-apt-repository multiverse
-```
-
 ```shell
 sudo apt-get update
 sudo apt-get install \
@@ -47,8 +33,7 @@ sudo apt-get install \
     ffmpeg \
     quelcom \
     python3-pip \
-    virtualenv \
-    libfaac-dev
+    virtualenv
 ```
 
 
diff --git a/modules/liquidsoap/library.liq b/modules/liquidsoap/library.liq
index 6983197b..666ec54f 100644
--- a/modules/liquidsoap/library.liq
+++ b/modules/liquidsoap/library.liq
@@ -167,10 +167,10 @@ def start_recorder(folder, duration, encoding, bitrate, channels, filenamepatter
     output_filesystem_stereo = output.file(id="recorder_"^recorder_number, perm = 0o664, on_start=on_start, on_close=on_close, on_stop=on_stop, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 })
 
 #    %ifencoder %aac
-    if encoding == "aac" then
-        log("ENABLING aac recorder to filesystem")
-        %include "outgoing_recordings/aac.liq"
-    end
+    # if encoding == "aac" then
+    #     log("ENABLING aac recorder to filesystem")
+    #     %include "outgoing_recordings/aac.liq"
+    # end
 #    %endif
 
 #    %ifencoder %flac
diff --git a/script/install-opam-packages.sh b/script/install-opam-packages.sh
index ff9c8c7b..4304b6d6 100755
--- a/script/install-opam-packages.sh
+++ b/script/install-opam-packages.sh
@@ -4,6 +4,6 @@ opam update -y
 opam init -y
 opam switch create 4.08.0
 opam install depext -y
-opam depext taglib mad lame vorbis fdkaac flac opus cry samplerate pulseaudio bjack alsa liquidsoap -y
-opam install taglib mad lame vorbis fdkaac flac opus cry samplerate pulseaudio bjack alsa liquidsoap -y
+opam depext taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa liquidsoap -y
+opam install taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa liquidsoap -y
 eval $(opam env)
-- 
GitLab