From 1a3e5fe2e89a78a2c1a9594211ecfe8cc38d8866 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 21 Oct 2024 06:43:56 -0700 Subject: [PATCH 1/7] Update README with Linux instructions for RADE. --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index 54f4b8a4..2131a59b 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,41 @@ This document describes how to build the FreeDV GUI program for various operatin $ ./build_linux/src/freedv ``` +## Running RADE mode on Linux + +RADE is a new FreeDV mode that uses machine learning to improve voice quality and decoding ability. +We are currently focused on Windows and macOS for initial development, but it is possible to run on +Linux by following these steps: + +1. Install PyTorch, TorchAudio and matplotlib Python packages. Some distros have packages for one or more of these, + but you can also use pip in a Python virtual environment (recommended to ensure the latest versions): + + ``` + $ cd freedv-gui + $ python3 -m venv rade-venv + $ ./rade-venv/bin/activate + (rade-venv) $ pip3 install -r cmake/rade-requirements.txt + ``` + +2. Build FreeDV to make sure the correct dependencies are linked in (namely numpy): + + ``` + (rade-venv) $ ./build_linux.sh + ``` + +3. Make sure FreeDV can find the ML model: + + ``` + (rade-venv) $ cd build_linux + (rade-venv) $ ln -s `pwd`/rade_src/model19_check3 model19_check3 + ``` + +4. Execute FreeDV: + + ``` + (rade-venv) $ PYTHONPATH=`pwd`/rade_src src/freedv + ``` + ## Building without LPCNet In preparation for possible future deprecation of FreeDV 2020 and 2020B modes, it is From 621e984cba69d25b9013f2a82659483d1c8b8594 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 21 Oct 2024 12:24:30 -0700 Subject: [PATCH 2/7] Fix typos. --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2131a59b..d344a07c 100644 --- a/README.md +++ b/README.md @@ -70,19 +70,23 @@ Linux by following these steps: ``` $ cd freedv-gui $ python3 -m venv rade-venv - $ ./rade-venv/bin/activate + $ . ./rade-venv/bin/activate (rade-venv) $ pip3 install -r cmake/rade-requirements.txt ``` 2. Build FreeDV to make sure the correct dependencies are linked in (namely numpy): ``` + (rade-venv) $ pwd + /home/user/freedv-gui (rade-venv) $ ./build_linux.sh ``` 3. Make sure FreeDV can find the ML model: ``` + (rade-venv) $ pwd + /home/user/freedv-gui (rade-venv) $ cd build_linux (rade-venv) $ ln -s `pwd`/rade_src/model19_check3 model19_check3 ``` @@ -90,7 +94,9 @@ Linux by following these steps: 4. Execute FreeDV: ``` - (rade-venv) $ PYTHONPATH=`pwd`/rade_src src/freedv + (rade-venv) $ pwd + /home/user/freedv-gui/build_linux + (rade-venv) $ PYTHONPATH=`pwd`/rade_src:$PYTHONPATH src/freedv ``` ## Building without LPCNet From e9c7413d14d64b175304285cdcd25dc49ee7698f Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 21 Oct 2024 12:53:33 -0700 Subject: [PATCH 3/7] Add note about needing to install python3-venv. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d344a07c..6f0f11d4 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,8 @@ Linux by following these steps: (rade-venv) $ pip3 install -r cmake/rade-requirements.txt ``` + *Note: you may need to install `python3-venv` or your distro's equivalent package in order to create Python virtual environments.* + 2. Build FreeDV to make sure the correct dependencies are linked in (namely numpy): ``` From 8887b22ab9cad068b469f9f791a7296546459e4a Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 21 Oct 2024 12:58:47 -0700 Subject: [PATCH 4/7] Manually specify Python packages to ensure GPU accelerated ones aren't unnecessarily downloaded. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f0f11d4..94c1ab49 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,8 @@ Linux by following these steps: $ cd freedv-gui $ python3 -m venv rade-venv $ . ./rade-venv/bin/activate - (rade-venv) $ pip3 install -r cmake/rade-requirements.txt + (rade-venv) $ pip3 install torch torchaudio --index-url https://download.pytorch.org/whl/cpu + (rade-venv) $ pip3 install matplotlib ``` *Note: you may need to install `python3-venv` or your distro's equivalent package in order to create Python virtual environments.* From 29b275b23947e77c6fe89b56c2702cf8e62dc9e2 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 21 Oct 2024 13:02:26 -0700 Subject: [PATCH 5/7] Use $PWD instead of backticks. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 94c1ab49..66061e13 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Linux by following these steps: (rade-venv) $ pwd /home/user/freedv-gui (rade-venv) $ cd build_linux - (rade-venv) $ ln -s `pwd`/rade_src/model19_check3 model19_check3 + (rade-venv) $ ln -s $PWD/rade_src/model19_check3 model19_check3 ``` 4. Execute FreeDV: @@ -99,7 +99,7 @@ Linux by following these steps: ``` (rade-venv) $ pwd /home/user/freedv-gui/build_linux - (rade-venv) $ PYTHONPATH=`pwd`/rade_src:$PYTHONPATH src/freedv + (rade-venv) $ PYTHONPATH="$PWD/rade_src:$PYTHONPATH" src/freedv ``` ## Building without LPCNet From 08c84e563300d5982a1944381e481c174a1f7b5b Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 21 Oct 2024 17:04:22 -0700 Subject: [PATCH 6/7] Additional updates per PR feedback. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 66061e13..4afd55b8 100644 --- a/README.md +++ b/README.md @@ -75,13 +75,13 @@ Linux by following these steps: (rade-venv) $ pip3 install matplotlib ``` - *Note: you may need to install `python3-venv` or your distro's equivalent package in order to create Python virtual environments.* + *Note: you may need to install `python3-venv` or your distro's equivalent package in order to create Python virtual environments. Python 3.9+ is also required for PyTorch to work.* 2. Build FreeDV to make sure the correct dependencies are linked in (namely numpy): ``` (rade-venv) $ pwd - /home/user/freedv-gui + /home//freedv-gui (rade-venv) $ ./build_linux.sh ``` @@ -89,7 +89,7 @@ Linux by following these steps: ``` (rade-venv) $ pwd - /home/user/freedv-gui + /home//freedv-gui (rade-venv) $ cd build_linux (rade-venv) $ ln -s $PWD/rade_src/model19_check3 model19_check3 ``` @@ -98,7 +98,7 @@ Linux by following these steps: ``` (rade-venv) $ pwd - /home/user/freedv-gui/build_linux + /home//freedv-gui/build_linux (rade-venv) $ PYTHONPATH="$PWD/rade_src:$PYTHONPATH" src/freedv ``` From ef33d48262b9147fc7745dbbe3e902a7e48c46f9 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 21 Oct 2024 17:05:24 -0700 Subject: [PATCH 7/7] $PWD -> $(pwd) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4afd55b8..ff04011f 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Linux by following these steps: (rade-venv) $ pwd /home//freedv-gui (rade-venv) $ cd build_linux - (rade-venv) $ ln -s $PWD/rade_src/model19_check3 model19_check3 + (rade-venv) $ ln -s $(pwd)/rade_src/model19_check3 model19_check3 ``` 4. Execute FreeDV: @@ -99,7 +99,7 @@ Linux by following these steps: ``` (rade-venv) $ pwd /home//freedv-gui/build_linux - (rade-venv) $ PYTHONPATH="$PWD/rade_src:$PYTHONPATH" src/freedv + (rade-venv) $ PYTHONPATH="$(pwd)/rade_src:$PYTHONPATH" src/freedv ``` ## Building without LPCNet