diff --git a/run.sh b/run.sh index 78364d227348600b9b42e0a396125a9b0cf2dcb4..a0455b8ba5e6302bffe79f47aa48e70218f575df 100755 --- a/run.sh +++ b/run.sh @@ -99,7 +99,7 @@ if [[ $docker == "true" ]]; then -v "$AUDIO_DIR/playlist":"/var/audio/playlist":ro \ -v "$AUDIO_DIR/station":"/var/audio/station":ro \ -v "$BASE_DIR/contrib":"/srv/contrib" \ - -v "$BASE_DIR/tests":"/srv/tests" \ + -v "$BASE_DIR/tests":"/srv/tests" \ -v "$BASE_DIR/logs":"/srv/logs" \ -v "/etc/asound.conf":"/etc/asound.conf" \ --mount type=tmpfs,destination=/tmp \ diff --git a/tests/docker/test_docker_analog.sh b/tests/docker/test_lqs2_alsa_live_unbuffered.sh similarity index 72% rename from tests/docker/test_docker_analog.sh rename to tests/docker/test_lqs2_alsa_live_unbuffered.sh index c860cacbe772fb76a47eb7133714ad90978ad537..a24e7966be2cb09d3feeead17d2feef010c30b06 100644 --- a/tests/docker/test_docker_analog.sh +++ b/tests/docker/test_lqs2_alsa_live_unbuffered.sh @@ -19,4 +19,8 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. -docker run -it -v /dev/snd:/dev/snd -v "/etc/asound.conf":"/etc/asound.conf" --privileged savonet/liquidsoap:main liquidsoap 'set("log.level",5)' 'set("frame.audio.size", 15052)' 'set("frame.video.framerate", 0)' 'output.alsa(bufferize=false, input.alsa(bufferize=false))' \ No newline at end of file +docker run -it \ + -v /dev/snd:/dev/snd \ + -v "/etc/asound.conf":"/etc/asound.conf" \ + --privileged savonet/liquidsoap:main \ + liquidsoap 'set("log.level",5)' 'set("frame.audio.size", 15052)' 'set("frame.video.framerate", 0)' 'output.alsa(bufferize=false, input.alsa(bufferize=false))' \ No newline at end of file diff --git a/tests/test_alsa_default_file.liq b/tests/test_alsa_file.liq similarity index 92% rename from tests/test_alsa_default_file.liq rename to tests/test_alsa_file.liq index d9f70671a17297244f6e94e11a5e20023cd134b4..93f1e8f2039c1ff219b82c18689d8204622268f1 100644 --- a/tests/test_alsa_default_file.liq +++ b/tests/test_alsa_file.liq @@ -1,8 +1,8 @@ -#!/usr/bin/liquidsoap --verbose +#!/usr/bin/env liquidsoap # # Aura Engine (https://gitlab.servus.at/aura/engine) # -# Copyright (C) 2017-2020 - The Aura Engine Team. +# Copyright (C) 2017-now() - The Aura Engine Team. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/tests/test_alsa_default_live.liq b/tests/test_alsa_framesize.liq old mode 100644 new mode 100755 similarity index 74% rename from tests/test_alsa_default_live.liq rename to tests/test_alsa_framesize.liq index 5c16083f85d13d8d7a8080115239879c571688a6..5e74c016d655a1a58879bc85d7000eccf3c50e8a --- a/tests/test_alsa_default_live.liq +++ b/tests/test_alsa_framesize.liq @@ -19,13 +19,11 @@ set("init.allow_root", true) -set("init.catch_exn", false) set("log.file.path", "../logs/<script>.log") -set("log.level", 5) -set("ffmpeg.log.level", 5) +# Set this to the value mentioned in the logs after the first run. Watch the logs and double the value if needed. +# Find more details here: https://gitlab.servus.at/aura/engine-core/-/blob/master/docs/audio-device-configuration.md set("frame.audio.size", 0) -# set("frame.audio.size", 7526) + set("frame.video.framerate", 0) -input_analog = input.alsa(id="analog_input", device="default", bufferize=false, start=true, fallible=true) -output.alsa(id="lineout", device="default", input_analog, bufferize=false, fallible=true) \ No newline at end of file +output.alsa(device="default", bufferize=false, input.alsa(device="default", bufferize=false)) \ No newline at end of file diff --git a/tests/test_alsa_live_buffered.liq b/tests/test_alsa_live_buffered.liq new file mode 100644 index 0000000000000000000000000000000000000000..1c9a849436ab175b0a8d8d89b33947b4b3d0a002 --- /dev/null +++ b/tests/test_alsa_live_buffered.liq @@ -0,0 +1,35 @@ +#!/usr/bin/env liquidsoap +# +# Aura Engine (https://gitlab.servus.at/aura/engine) +# +# Copyright (C) 2017-now() - The Aura Engine Team. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +set("init.allow_root", true) +set("init.catch_exn", false) +set("log.file.path", "../logs/<script>.log") +set("log.level", 5) +set("ffmpeg.log.level", 5) +set("audio.converter.samplerate.converters", ["ffmpeg"]) + +# Successfully tested with Liquidsoap 1.1.4 & ALSA 1.2.4 +# Low latency, no buffer underruns +set("frame.audio.size", 2048) +set("alsa.alsa_buffer", 8192) +set("alsa.buffer_length", 10) + +input_analog = input.alsa(device="default", bufferize=true) +output.alsa(device="default", input_analog, bufferize=true) \ No newline at end of file diff --git a/tests/test_alsa_live_double_buffered.liq b/tests/test_alsa_live_double_buffered.liq new file mode 100644 index 0000000000000000000000000000000000000000..37571c4da8b8e73aaff5c5105959d87298afd044 --- /dev/null +++ b/tests/test_alsa_live_double_buffered.liq @@ -0,0 +1,37 @@ +#!/usr/bin/env liquidsoap +# +# Aura Engine (https://gitlab.servus.at/aura/engine) +# +# Copyright (C) 2017-now() - The Aura Engine Team. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +set("init.allow_root", true) +set("init.catch_exn", false) +set("log.file.path", "../logs/<script>.log") +set("log.level", 5) +set("ffmpeg.log.level", 5) +set("audio.converter.samplerate.converters", ["ffmpeg"]) + +# Successfully tested with Liquidsoap 1.4.4 + 1.1.3 +# High latency, no buffer underruns +set("audio.converter.samplerate.converters", ["ffmpeg"]) +set("frame.audio.size", 2048) +set("alsa.alsa_buffer", 8192) +set("alsa.buffer_length", 10) + +input_analog = input.alsa(device="default", bufferize=true) +input_analog = mksafe(buffer(input_analog)) +output.alsa(device="default", input_analog, bufferize=true) \ No newline at end of file diff --git a/tests/test_framesize.liq b/tests/test_alsa_live_unbuffered.liq old mode 100755 new mode 100644 similarity index 66% rename from tests/test_framesize.liq rename to tests/test_alsa_live_unbuffered.liq index 95042b709b82f24ace8022f3348a9c14ef3fedce..8e3ac24075ebb43a2b3a1e288c15ff60ab442e40 --- a/tests/test_framesize.liq +++ b/tests/test_alsa_live_unbuffered.liq @@ -19,8 +19,17 @@ set("init.allow_root", true) +set("init.catch_exn", false) set("log.file.path", "../logs/<script>.log") +set("log.level", 5) +set("ffmpeg.log.level", 5) +set("audio.converter.samplerate.converters", ["ffmpeg"]) -set("frame.audio.size", 0) +# Successfully tested with Liquidsoap 2 & ALSA 1.2.4 +# Almost no latency, no buffer underruns +# Doesn't work in Liquidsoap 1.4 because of some calculation bug +set("frame.audio.size", 7526) set("frame.video.framerate", 0) -input.alsa(device="default", bufferize=false) \ No newline at end of file + +input_analog = input.alsa(device="default", bufferize=false) +output.alsa(device="default", input_analog, bufferize=false) \ No newline at end of file