From 44374bb3a6df11b7fd13a6f8418cfb57f586dbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Blizi=C5=84ski?= Date: Mon, 22 Jul 2024 16:53:14 +0100 Subject: [PATCH 1/4] Use `--timestamping` to avoid re-downloading. When a newer version of the file appears, wget will automatically update the file on disk. --- build.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build.sh b/build.sh index c4535c2..c090090 100755 --- a/build.sh +++ b/build.sh @@ -26,11 +26,8 @@ fi cd .. cd webui -if [ -f webui.tar.gz ]; then - rm -f webui.tar.gz -fi echo "Downloading current webui release ..." -wget https://github.com/bondagit/aes67-linux-daemon/releases/latest/download/webui.tar.gz +wget --timestamping https://github.com/bondagit/aes67-linux-daemon/releases/latest/download/webui.tar.gz if [ -f webui.tar.gz ]; then tar -xzvf webui.tar.gz else From 2ca48a054bc3bf49143d115a50927256bd8dc428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Blizi=C5=84ski?= Date: Mon, 22 Jul 2024 17:17:43 +0100 Subject: [PATCH 2/4] Split the cmake invocation into multiple lines. The `-D` statements are lined up and easier to read. It's also easier to compare the `build.sh` and `buildfake.sh` files side-by-side. --- build.sh | 9 ++++++++- buildfake.sh | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index c4535c2..1218f70 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,14 @@ cd .. cd daemon echo "Building aes67-daemon ..." -cmake -DCPP_HTTPLIB_DIR="$TOPDIR"/3rdparty/cpp-httplib -DRAVENNA_ALSA_LKM_DIR="$TOPDIR"/3rdparty/ravenna-alsa-lkm -DENABLE_TESTS=ON -DWITH_AVAHI=ON -DFAKE_DRIVER=OFF -DWITH_SYSTEMD=ON . +cmake \ + -DCPP_HTTPLIB_DIR="${TOPDIR}/3rdparty/cpp-httplib" \ + -DRAVENNA_ALSA_LKM_DIR="${TOPDIR}/3rdparty/ravenna-alsa-lkm" \ + -DENABLE_TESTS=ON \ + -DWITH_AVAHI=ON \ + -DFAKE_DRIVER=OFF \ + -DWITH_SYSTEMD=ON \ + . make cd .. diff --git a/buildfake.sh b/buildfake.sh index 801e560..2c9b325 100755 --- a/buildfake.sh +++ b/buildfake.sh @@ -26,7 +26,13 @@ cd .. cd daemon echo "Building aes67-daemon ..." -cmake -DCPP_HTTPLIB_DIR="$TOPDIR"/3rdparty/cpp-httplib -DRAVENNA_ALSA_LKM_DIR="$TOPDIR"/3rdparty/ravenna-alsa-lkm -DENABLE_TESTS=ON -DWITH_AVAHI=OFF -DFAKE_DRIVER=ON . +cmake \ + -DCPP_HTTPLIB_DIR="${TOPDIR}/3rdparty/cpp-httplib" \ + -DRAVENNA_ALSA_LKM_DIR="${TOPDIR}/3rdparty/ravenna-alsa-lkm" \ + -DENABLE_TESTS=ON \ + -DWITH_AVAHI=OFF \ + -DFAKE_DRIVER=ON \ + . make cd .. From 519de0341fdb8783124c17ec2e544520bf5a985f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Blizi=C5=84ski?= Date: Tue, 23 Jul 2024 14:20:22 +0100 Subject: [PATCH 3/4] Return to the main directory after inserting the module. I followed the instructions and copy/pasted the code snippets. Here's a small convenience change: after inserting the module, we can go back to the main directory instead of trying to cd into `3rdparty/ravenna-alsa-lkm/driver/daemon`. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2f874e3..5e45fe8 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,8 @@ The daemon should work on all Ubuntu starting from 18.04 onward, it's possible t * edit the daemon configuration file _daemon/daemon.conf_ and change the _interface_name_ parameter to the ethernet network interface you want to use. Ex: _eth0_ * install the driver by executing from the main folder: - cd 3rdparty/ravenna-alsa-lkm/driver - sudo insmod ./MergingRavennaALSA.ko + (cd 3rdparty/ravenna-alsa-lkm/driver && sudo insmod ./MergingRavennaALSA.ko) + * start the daemon by executing from the main folder: cd daemon From 8629916eceb7696cca0aca490bb67a0f8fa3b3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Blizi=C5=84ski?= Date: Tue, 23 Jul 2024 15:01:17 +0100 Subject: [PATCH 4/4] Define mount point as "/" rather than nullptr. This fixes the stuckness in the newer versions of httplib. I compiled and ran the daemon using https://github.com/yhirose/cpp-httplib/tree/c8bcaf8a913f1ac087b076488e0cbbc272cccd19 which is the newest cpp-httplib version at the time of writing. --- daemon/http_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/http_server.cpp b/daemon/http_server.cpp index ee56d5e..e3f67bd 100644 --- a/daemon/http_server.cpp +++ b/daemon/http_server.cpp @@ -83,7 +83,7 @@ bool HttpServer::init() { return false; } - svr_.set_mount_point(nullptr, config_->get_http_base_dir().c_str()); + svr_.set_mount_point("/", config_->get_http_base_dir().c_str()); svr_.Get("(/|/Config|/PTP|/Sources|/Sinks|/Browser)", [&](const Request& req, Response& res) {