GUI Application for FreeDV – open source digital voice for HF radio
 
 
 
 
 
 
Go to file
Mooneer Salem 7cdb9e8a7d
Improve EOO TX/RX reliability (#855)
* Create FIFOs with correct sizes to reduce EOO time.

* Try using configured fifo size for all FIFOs.

* Use correct variable names when definining FIFO sizes.

* Update wxWidgets to 3.2.7 to see if that fixes the build failure.

* Use Ubuntu 24.04 for Windows build to match Linux.

* Patch libsamplerate to avoid GH action failure.

* Need to remove 3.1 from samplerate-cmake.patch

* Fix issue causing cmake to hang if being rerun.

* Temporarily use wxWidgets master as latest Xcode can't build 3.2.7.

* Add support for rig control during RADE EOO ctests.

* Try adding a bit of time to see if it'll decode.

* Fix GH action failure.

* Fix Windows build failure.

* Use same delay code as other existing similar logic.

* Add 20ms delay in mock rigctld to better match behavior with actual hardware.

* Fix Windows build issue for real.

* Fix samplerate patch issue.

* Include wxWidgets manifest code since 3.3 will soon require it.

* Use 3.2 branch as we can build on macOS now in that branch.

* Add IAudioDevice function to allow retrieval of device latency.

* Try shrinking the number of samples FreeDVInterface returns for RADE.

* Add missed get() call in PortAudio logic.

* We really shouldn't need to add txIn latency.

* We need to see the logs from when TX happens during ctest.

* Explicitly disable power savings for audio (macOS).

* Allow partial reads from TX output FIFO.

* First pass at calculating latency for WASAPI.

* Try IO frame size of 1024 to improve pass rate of GH Actions.

* Initial implementation of RADE reporting test on Windows.

* Remove unneeded flag from previously added script.

* Fix various issues with PS script.

* Revert "Try IO frame size of 1024 to improve pass rate of GH Actions."

This reverts commit 1161d9505d.

* Use FDV output, not mock rigctl output, for comparison.

* Use GetStreamLatency() instead.

* Add logging to help determine why WASAPI latency is incorrect.

* Need GetDevicePeriod as well for fully accurate latency measurements.

* Buffer size is the minimum bound on latency. Or at least it seems like it would be, anyway.

* Guarantee that we have universal macOS binary even if tests fail.

* Also take into account PTT response time (i.e. for SDRs).

* Only need to add half of the rig response time for good results.

* Forgot implementation of getRigResponseTimeMicroseconds() for OmniRig.

* Prevent negative zero SNRs from appearing in GUI.

* Try smallest buffer size possible for macOS audio.

* Fix macOS compiler error.

* (Windows) Use event based triggering to provide audio to/from FreeDV.

* Divide by number of channels to get actual latency on macOS.

* Increase minimum frame size to 128 on macOS.

* Oops, types need to be the same.

* Fix deadlock in Windows audio from previous commits.

* Try 256 buffer size on macOS.

* Use minimum of 40ms latency on macOS and Windows.

* No need for the samplerate patch anymore.

* Fix comments.
2025-04-11 19:33:33 -07:00
.github Improve EOO TX/RX reliability (#855) 2025-04-11 19:33:33 -07:00
cmake Improve EOO TX/RX reliability (#855) 2025-04-11 19:33:33 -07:00
contrib Improve EOO TX/RX reliability (#855) 2025-04-11 19:33:33 -07:00
cross-compile Integrate RADE into FreeDV application (#748) 2024-10-20 18:09:11 -07:00
db
doc Add info on actually signing binaries. 2023-07-26 22:21:03 -07:00
src Improve EOO TX/RX reliability (#855) 2025-04-11 19:33:33 -07:00
test Improve EOO TX/RX reliability (#855) 2025-04-11 19:33:33 -07:00
wav Remove unneeded 2400B and 2020B sample files. 2023-09-02 00:22:46 -07:00
.gitignore Minor build improvements. 2021-11-07 23:40:56 +01:00
.travis.yml Update Ubuntu Travis instance to Bionic (18.04 LTS). 2020-12-12 23:19:17 -08:00
.wenv.json Integrate RADE into FreeDV application (#748) 2024-10-20 18:09:11 -07:00
CHANGELOG_OLD.md Move changelog to separate file. 2024-01-14 22:20:27 -08:00
CMakeLists.txt Improve EOO TX/RX reliability (#855) 2025-04-11 19:33:33 -07:00
CODE_SIGNING.md Update code signing documentation to not recommend bringing your own token. 2023-09-11 22:50:10 -07:00
COPYING
README.md Move to using native audio on macOS and Windows (#847) 2025-03-31 22:35:35 -07:00
USER_MANUAL.html latest user manual PDF 2025-03-26 23:31:08 +00:00
USER_MANUAL.md Report "unk" for mode on Hamlib disconnect (#851) 2025-03-26 16:28:34 -07:00
USER_MANUAL.pdf latest user manual PDF 2025-03-26 23:31:08 +00:00
build_linux.sh Move to using native audio on macOS and Windows (#847) 2025-03-31 22:35:35 -07:00
build_macos_sound_drivers.sh Fix dropouts related to virtual audio cables. (#840) 2025-03-06 00:40:05 -08:00
build_osx.sh Move to using native audio on macOS and Windows (#847) 2025-03-31 22:35:35 -07:00
build_signed_windows_release.sh Update build scripts to use optimal number of parallel builds. (#842) 2025-03-10 22:35:54 -07:00
delocating.py.patched Integrate RADE into FreeDV application (#748) 2024-10-20 18:09:11 -07:00
disable_float.tex attempt to disable Tex float image placement 2022-01-02 17:27:39 +10:30
fargan_config.h.in Suppress spurious warnings from Opus/RADE compilation. 2024-10-28 02:04:08 -07:00
generate-univ-pkgs.sh Integrate RADE into FreeDV application (#748) 2024-10-20 18:09:11 -07:00

README.md

Building FreeDV GUI

This document describes how to build the FreeDV GUI program for various operating systems. FreeDV GUI is developed on Ubuntu Linux, and then cross compiled for Windows using Fedora Linux (Fedora has great cross compiling support) and Docker.

Further Reading

Building on Ubuntu Linux

$ sudo apt install libspeexdsp-dev libsamplerate0-dev sox git \
libwxgtk3.2-dev libhamlib-dev libasound2-dev libao-dev \
libgsm1-dev libsndfile1-dev cmake module-assistant build-essential
$ git clone https://github.com/drowe67/freedv-gui.git
$ cd freedv-gui

(if using pipewire/PulseAudio -- recommended and the default) 
$ sudo apt install libpulse-dev
$ ./build_linux.sh

(if using PortAudio)
$ sudo apt install portaudio19-dev
$ USE_NATIVE_AUDIO=0 ./build_linux.sh 

(Depending on release you may need to use libwxgtk3.0-gtk3-dev instead of libwxgtk3.2-dev.)

Then run with:

$ ./build_linux/src/freedv

Note this builds all libraries locally, nothing is installed on your machine. make install is not required.

Building on Fedora Linux

$ sudo dnf groupinstall "Development Tools"
$ sudo dnf install cmake wxGTK3-devel libsamplerate-devel \
  libsndfile-devel speexdsp-devel hamlib-devel alsa-lib-devel libao-devel \
  gsm-devel gcc-c++ sox
$ git clone https://github.com/drowe67/freedv-gui.git
$ cd freedv-gui

(if using pipewire/PulseAudio -- default and recommended)
$ sudo dnf install pulseaudio-libs-devel
$ ./build_linux.sh

(if using PortAudio)
$ sudo dnf install portaudio-devel
$ USE_NATIVE_AUDIO=0 ./build_linux.sh

Then run with:

$ ./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 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. 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
    (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
    
  4. Execute FreeDV:

    (rade-venv) $ pwd
    /home/<user>/freedv-gui/build_linux
    (rade-venv) $ PYTHONPATH="$(pwd)/rade_src:$PYTHONPATH" src/freedv
    

Alternatively, you can use this script developed by Barry Jackson G4MKT to automate the above steps. While the FreeDV project thanks him for his contribution to helping Linux users more easily get on the air with FreeDV, the FreeDV development team will not provide support. All support inquiries regarding this script should be directed to the linked repo.

Building without LPCNet

In preparation for possible future deprecation of FreeDV 2020 and 2020B modes, it is possible to build without requiring the LPCNet library. To do this, pass LPCNET_DISABLE=1 as an environment variable to the build script, i.e.

$ LPCNET_DISABLE=1 ./build_linux.sh

or alternatively, do not pass in LPCNET_BUILD_DIR to cmake if manually executing the build. This also has the side effect of disabling 2020 and 2020B in the user interface, preventing either from being selected.

Note: if you don't already have Codec2 installed on your machine, you will need to pass -DBOOTSTRAP_LPCNET=1 to cmake in order for LPCNet to also be built.

Audio driver selection

By default, FreeDV uses the native audio APIs on certain platforms. These are as follows:

Platform Audio API
macOS Core Audio
Linux pipewire (via PulseAudio library)
Windows WASAPI

On platforms not listed above, PortAudio is used instead. PortAudio can also be explicitly selected by the user by defining the environment variable USE_NATIVE_AUDIO=0 before running the build_*.sh script (or specifying -DUSE_NATIVE_AUDIO=0 to cmake).

Installing on Linux

You need to install the codec2 and lpcnetfreedv shared libraries, and freedv-gui:

$ cd ~/freedv-gui/codec2/build_linux
$ sudo make install
$ cd ~/freedv-gui/LPCNet/build_linux
$ sudo make install
$ cd ~/freedv-gui/build_linux
$ sudo make install
$ sudo ldconfig

Testing

The wav directory contains test files of modulated audio that you can use to test FreeDV (see the USER_MANUAL).

Building for Windows

Windows releases are built using the LLVM version of MinGW. This allows one to build FreeDV for ARM as well as for Intel Windows systems, including support for 2020 mode (on systems fast enough to acceptably decode it).

Prerequisites

  • CMake >= 3.25.0
  • Linux (tested on Ubuntu 22.04)
    • NOTE: This does not currently work on macOS due to CMake using incorrect library suffixes.
  • NSIS for generating the installer (for example, sudo apt install nsis on Ubuntu)

Instructions

  1. Download LLVM MinGW at https://github.com/mstorsjo/llvm-mingw/releases/.
  2. Decompress into your preferred location. For example: tar xvf llvm-mingw-20220906-ucrt-ubuntu-18.04-x86_64.tar.xz (The exact filename here will depend on the file downloaded in step (1). Note that for best results, you should use a build containing "ucrt" in the file name corresponding to the platform which you're building the Windows binary from.)
  3. Add LLVM MinGW to your PATH: export PATH=/path/to/llvm-mingw-20220906-ucrt-ubuntu-18.04-x86_64/bin:$PATH. (The folder containing the LLVM tools is typically named the same as the file downloaded in step (2) minus the extension.)
  4. Create a build folder inside freedv-gui: mkdir build_windows
  5. Run CMake to configure the FreeDV build: cd build_windows && cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../cross-compile/freedv-mingw-llvm-[architecture].cmake ..
    • Valid architectures are: aarch64 (64 bit ARM), i686 (32 bit Intel/AMD), x86_64 (64 bit Intel/AMD)
  6. Build FreeDV as normal: make (You can also add -j[num] to the end of this command to use multiple cores and shorten the build time.)
  7. Create FreeDV installer: make package

Known Issues

  • NSIS-related issues:
    • ARM installers will not properly register in Windows despite installing properly. You can still run the application manually by navigating to C:\Program Files\FreeDV [version]\ using File Explorer and double-clicking on freedv.exe.

Building and installing on macOS

Using MacPorts, most of the appropriate dependencies can be installed by:

$ sudo port install automake git libtool sox +universal cmake

and on Homebrew:

$ brew install automake libtool git sox cmake

Once the dependencies are installed, you can then run the build_osx.sh script inside the source tree to build FreeDV and associated libraries (codec2, LPCNet, hamlib). A FreeDV.app app bundle will be created inside the build_osx/src folder which can be copied to your system's Applications folder.