From 0dd3b9bf70e15fcafdaccf5970084b4f4ddc4adf Mon Sep 17 00:00:00 2001 From: Andrea Bondavalli Date: Wed, 19 Apr 2023 12:49:47 +0200 Subject: [PATCH 1/3] Set of changes to the daemon to support additional sample rates and to enhance the test suites to verify with 192Khz and 384Khz The build script has been modified to checkout the driver branch aes67-daemon-issue11 with fixes to support sample rates higher than 192Khz. These changes fix #124 and #122 --- build.sh | 2 +- run_latency_test.sh | 8 ++++++-- run_test.sh | 6 +++++- test/createtest.cc | 2 +- test/daemon.conf | 2 +- test/latency.cc | 4 ++-- webui/src/Config.jsx | 2 ++ 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 1ead070..298202c 100755 --- a/build.sh +++ b/build.sh @@ -11,7 +11,7 @@ TOPDIR=$(pwd) cd 3rdparty if [ ! -d ravenna-alsa-lkm ]; then - git clone --single-branch --branch aes67-daemon https://github.com/bondagit/ravenna-alsa-lkm.git + git clone --single-branch --branch aes67-daemon-issue11 https://github.com/bondagit/ravenna-alsa-lkm.git cd ravenna-alsa-lkm/driver make cd ../.. diff --git a/run_latency_test.sh b/run_latency_test.sh index 8e23e33..1938201 100755 --- a/run_latency_test.sh +++ b/run_latency_test.sh @@ -13,9 +13,9 @@ function cleanup { } function usage { - echo 'Usage run_latenvy_test.sh sample_format sample_rate channels duration frames' >&2 + echo 'Usage run_latency_test.sh sample_format sample_rate channels duration frames' >&2 echo ' sample_format can be one of S16_LE, S24_3LE, S32_LE' >&2 - echo ' sample_rate can be one of 44100, 48000, 96000' >&2 + echo ' sample_rate can be one of 44100, 48000, 96000, 192000, 384000' >&2 echo ' channels can be one of 2, 4, 6, up to 64' >&2 echo ' duration in seconds' >&2 echo ' frames buffer size in frames' >&2 @@ -85,6 +85,10 @@ elif [ $SAMPLE_RATE == "48000" ]; then PTIME="1" elif [ $SAMPLE_RATE == "96000" ]; then PTIME="0.5" +elif [ $SAMPLE_RATE == "192000" ]; then + PTIME="0.25" +elif [ $SAMPLE_RATE == "384000" ]; then + PTIME="0.125" else usage fi diff --git a/run_test.sh b/run_test.sh index 72d60ed..bcdac37 100755 --- a/run_test.sh +++ b/run_test.sh @@ -45,7 +45,7 @@ echo 'Creating test file ...' >&2 if ! ./createtest $1 $2 $3 $4 ; then echo 'Usage run_test.sh sample_format sample_rate channels duration' >&2 echo ' sample_format can be one of S16_LE, S24_3LE, S32_LE' >&2 - echo ' sample_rate can be one of 44100, 48000, 96000' >&2 + echo ' sample_rate can be one of 44100, 48000, 96000, 192000, 384000' >&2 echo ' channels can be one of 2, 4, 6, up to 64' >&2 echo ' duration is in the range 1 to 10 minutes' >&2 exit 1 @@ -74,6 +74,10 @@ elif [ $SAMPLE_RATE == "48000" ]; then PTIME="1" elif [ $SAMPLE_RATE == "96000" ]; then PTIME="0.5" +elif [ $SAMPLE_RATE == "192000" ]; then + PTIME="0.25" +elif [ $SAMPLE_RATE == "384000" ]; then + PTIME="0.125" fi SOURCE=$(cat <<-END diff --git a/test/createtest.cc b/test/createtest.cc index c2370d7..1011103 100644 --- a/test/createtest.cc +++ b/test/createtest.cc @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) } int rate(atoi(argv[2])); - if (rate != 44100 && rate != 48000 && rate != 96000) { + if (rate != 44100 && rate != 48000 && rate != 96000 && rate != 192000 && rate != 384000) { cerr << "Unsupported rate " << rate << endl; exit(1); } diff --git a/test/daemon.conf b/test/daemon.conf index bf88a92..bec67fe 100644 --- a/test/daemon.conf +++ b/test/daemon.conf @@ -4,7 +4,7 @@ "http_base_dir": "./webui/dist", "log_severity": 3, "playout_delay": 0, - "tic_frame_size_at_1fs": 64, + "tic_frame_size_at_1fs": 48, "max_tic_frame_size": 1024, "sample_rate": 48000, "rtp_mcast_base": "239.1.0.1", diff --git a/test/latency.cc b/test/latency.cc index 5b590e7..251a53a 100644 --- a/test/latency.cc +++ b/test/latency.cc @@ -583,7 +583,7 @@ int main(int argc, char *argv[]) break; case 'r': err = atoi(optarg); - rate = err >= 4000 && err < 200000 ? err : 44100; + rate = err >= 4000 && err < 400000 ? err : 44100; break; case 'B': err = atoi(optarg); @@ -624,7 +624,7 @@ int main(int argc, char *argv[]) loop_limit = loop_sec * rate; latency = latency_min - 4; - buffer = (char*)malloc((latency_max * 2 * snd_pcm_format_width(format) / 8) * channels); + buffer = (char*)malloc((latency_max * 4 * snd_pcm_format_width(format) / 8) * channels); setscheduler(); diff --git a/webui/src/Config.jsx b/webui/src/Config.jsx index 99af251..91b12f9 100644 --- a/webui/src/Config.jsx +++ b/webui/src/Config.jsx @@ -186,6 +186,8 @@ class Config extends Component { + + From a8b833ddc02205245a540fa071abc4d678e3cd2b Mon Sep 17 00:00:00 2001 From: Andrea Bondavalli Date: Sat, 13 May 2023 12:36:40 +0200 Subject: [PATCH 2/3] Changed daemon version to v1.6.3, updated documentation and restored daemon test parameters --- README.md | 4 ++-- daemon/README.md | 2 +- daemon/main.cpp | 2 +- systemd/install.sh | 4 ++-- test/daemon.conf | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1be6524..c98484d 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ The script allows a user to test a specific configuration and it can be used to Usage run_test.sh sample_format sample_rate channels duration sample_format can be one of S16_LE, S24_3LE, S32_LE - sample_rate can be one of 44100, 48000, 96000 + sample_rate can be one of 44100, 48000, 96000, 192000, 384000 channels can be one of 2, 4, 6, up to 64 duration is in the range 1 to 10 minutes @@ -269,7 +269,7 @@ The script allows a user to test the latency on a specific configuration and it Usage run_latency_test.sh sample_format sample_rate channels duration frames sample_format can be one of S16_LE, S24_3LE, S32_LE - sample_rate can be one of 44100, 48000, 96000 + sample_rate can be one of 44100, 48000, 96000, 192000, 384000 channels can be one of 2, 4, 6, up to 64 duration of the test in seconds frames buffer size in frames diff --git a/daemon/README.md b/daemon/README.md index 9ddc21e..877ec1d 100644 --- a/daemon/README.md +++ b/daemon/README.md @@ -237,7 +237,7 @@ where: > **sample\_rate** > JSON number specifying the default sample rate. -> Valid values are 44100Hz, 48000Hz and 96000Hz. +> Valid values are 44100Hz, 48000Hz, 96000Hz, 192000Hz and 384000Hz. > **playout\_delay** > JSON number specifying the default safety playout delay at 1FS in samples. diff --git a/daemon/main.cpp b/daemon/main.cpp index 8706fbe..0a8aa8d 100644 --- a/daemon/main.cpp +++ b/daemon/main.cpp @@ -39,7 +39,7 @@ namespace po = boost::program_options; namespace postyle = boost::program_options::command_line_style; namespace logging = boost::log; -static const std::string version("bondagit-1.6.2"); +static const std::string version("bondagit-1.6.3"); static std::atomic terminate = false; void termination_handler(int signum) { diff --git a/systemd/install.sh b/systemd/install.sh index dadee42..9990737 100755 --- a/systemd/install.sh +++ b/systemd/install.sh @@ -5,9 +5,9 @@ #create a user for the daemon sudo useradd -M -l aes67-daemon -c "AES67 Linux daemon" -#copy the daemon binary +#copy the daemon binary, make sure -DWITH_SYSTEMD=ON sudo cp ../daemon/aes67-daemon /usr/local/bin/aes67-daemon -#create the daemon webui and scripts directories +#create the daemon webui and script directories sudo install -d -o aes67-daemon /var/lib/aes67-daemon /usr/local/share/aes67-daemon/scripts/ /usr/local/share/aes67-daemon/webui/ #copy the ptp script sudo install -o aes67-daemon ../daemon/scripts/ptp_status.sh /usr/local/share/aes67-daemon/scripts/ diff --git a/test/daemon.conf b/test/daemon.conf index bec67fe..bf88a92 100644 --- a/test/daemon.conf +++ b/test/daemon.conf @@ -4,7 +4,7 @@ "http_base_dir": "./webui/dist", "log_severity": 3, "playout_delay": 0, - "tic_frame_size_at_1fs": 48, + "tic_frame_size_at_1fs": 64, "max_tic_frame_size": 1024, "sample_rate": 48000, "rtp_mcast_base": "239.1.0.1", From 4c88ed4a4932f0b63a01a4b0118d1a11564b340e Mon Sep 17 00:00:00 2001 From: Andrea Bondavalli Date: Thu, 18 May 2023 10:51:39 +0200 Subject: [PATCH 3/3] Changes to README.md to align with driver version 1.7 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c98484d..ef988d6 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ The [aes67-daemon branch of ravenna-alsa-lkm repository](https://github.com/bond The following patches have been applied to the original module: +* patch to support sample rates 192Khz and 384Khz (from driver version v1.7) +* patch to compile with Linux Kernel v6.2 and above (from driver version v1.7) * patch to make the PTP slave status change from locked to unlocked if no announcement messages are received from the Master for more than 5 seconds (from driver version v1.6). See [issue 87](https://github.com/bondagit/aes67-linux-daemon/issues/87). * patch to fix issue causing the usage of wrong Sources and Sinks buffer offsets in case of reconfiguration or daemon restart (from driver version v1.5). See [issue 55](https://github.com/bondagit/aes67-linux-daemon/issues/55). * patch to enable the configuration of smaller ALSA buffer sizes to reduce end-to-end latency up to 8ms (from driver version v1.4). See [platform latency test](#latency) and See [issue 53](https://github.com/bondagit/aes67-linux-daemon/issues/53)