342.1. freedv-gui-2.4.0
HF digital voice for amateur radio: RADE, 700D, 700E and 1600 modes over a sound card
| Version | 2.4.0, release 2 |
| Shelf | hamradio — Amateur-radio operation: rig control, digital modes, logging, packet and APRS, propagation, and mesh radio |
| Phase | 44_apps (Applications), 243 of 422 in build order |
| Licence | LGPL-2.1-only AND BSD-2-Clause AND BSD-3-Clause |
| Homepage | https://freedv.org/ |
| Build time | 7.4 SBU |
| Installed size | 45.5 MiB in 16 files |
| Recipe | ports/core/hamradio/freedv-gui/kpkgbuild |
About
FreeDV is digital voice for HF amateur radio over a sound card: it encodes speech into the RADE, 700D, 700E and 1600 modes, keys the transmitter through hamlib, and decodes the received signal back to speech. The GUI is built on wxwidgets with GTK 3. Its modem and codec code is freedv-backend, which in turn builds RADE (the machine-learning voice mode), its own Opus with the FARGAN vocoder, and RNNoise for noise suppression.
Sources
freedv-gui-2.4.0.tar.gz(28.9 MiB)
sha2569e4b1bcf5d4ce3b18a1b120acb4d4483d4f635990b18a97b98174fc51fae5678
upstream: https://github.com/drowe67/freedv-gui/archive/refs/tags/v2.4.0.tar.gz
archive copy: sources-3/hamradio--freedv-gui-2.4.0.tar.gzfreedv-backend-1.0.0.tar.gz(579.9 KiB)
sha256cdab91c479653eb6595c2f94461565e8a23603db246b5c9a578ea8d8c404c216
upstream: https://github.com/tmiw/freedv-backend/archive/refs/tags/v1.0.0.tar.gz
archive copy: sources-3/hamradio--freedv-backend-1.0.0.tar.gzrade_c-cc17222acc597339199bdfd7253c3e6cf147f953.tar.gz(82.7 MiB)
sha2563d51bc21c823898531be932dcfff684904b6090db1b98dbd39a4fb8a2771c10b
upstream: https://github.com/freedv/rade_c/archive/cc17222acc597339199bdfd7253c3e6cf147f953.tar.gz
archive copy: sources-3/hamradio--rade_c-cc17222acc597339199bdfd7253c3e6cf147f953.tar.gzopus-940d4e5af64351ca8ba8390df3f555484c567fbb.tar.gz(4.7 MiB)
sha256285c74f5130ee074f123aaad81cd52c2fc8db653ee130941afafe3ee0ae8cec2
upstream: https://github.com/xiph/opus/archive/940d4e5af64351ca8ba8390df3f555484c567fbb.tar.gz
archive copy: sources-3/hamradio--opus-940d4e5af64351ca8ba8390df3f555484c567fbb.tar.gzopus_data-4ed9445b96698bad25d852e912b41495ddfa30c8dbc8a55f9cde5826ed793453.tar.gz(175.0 MiB)
sha2564ed9445b96698bad25d852e912b41495ddfa30c8dbc8a55f9cde5826ed793453
upstream: https://media.xiph.org/opus/models/opus_data-4ed9445b96698bad25d852e912b41495ddfa30c8dbc8a55f9cde5826ed793453.tar.gz
archive copy: sources-3/hamradio--opus_data-4ed9445b96698bad25d852e912b41495ddfa30c8dbc8a55f9cde5826ed793453.tar.gzrnnoise-70f1d256acd4b34a572f999a05c87bf00b67730d.tar.gz(91.2 KiB)
sha256f61ee0b3f4c4cd337303e003d333357c5eaf25ef5d75a742109ee59e9a0a3932
upstream: https://github.com/xiph/rnnoise/archive/70f1d256acd4b34a572f999a05c87bf00b67730d.tar.gz
archive copy: sources-3/hamradio--rnnoise-70f1d256acd4b34a572f999a05c87bf00b67730d.tar.gzrnnoise_data-0a8755f8e2d834eff6a54714ecc7d75f9932e845df35f8b59bc52a7cfe6e8b37.tar.gz(55.9 MiB)
sha2560a8755f8e2d834eff6a54714ecc7d75f9932e845df35f8b59bc52a7cfe6e8b37
upstream: https://media.xiph.org/rnnoise/models/rnnoise_data-0a8755f8e2d834eff6a54714ecc7d75f9932e845df35f8b59bc52a7cfe6e8b37.tar.gz
archive copy: sources-3/hamradio--rnnoise_data-0a8755f8e2d834eff6a54714ecc7d75f9932e845df35f8b59bc52a7cfe6e8b37.tar.gz
Dependencies
Depends on: cmake, pkgconf, autoconf, automake, libtool, wxwidgets, gtk3, libpulse, hamlib, libsndfile, libsamplerate, libebur128, openssl, dbus.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
backend-local-sources.patch— In freedv-backend, turn the RADE and RNNoise ExternalProjects fromGIT_REPOSITORY … GIT_TAG mainintoURL ${RADE_C_URL}andURL ${RNNOISE_URL}, make RADE’s Opus location the variableOPUS_URL, each keeping upstream’s address as the default when it is unset, and configure RNNoise withautoreconf -isfinstead ofautogen.sh, which downloads its model weights.backend-musl.patch— In freedv-backend, wait on semaphores withsem_timedwaitagainstCLOCK_REALTIMEinstead of glibc’ssem_clockwaitonCLOCK_MONOTONIC; take error text fromstrerrorin the real-time helper; and use the POSIXstrerror_r, which returns an int, whenever the C library is not glibc.musl.patch— The same changes in FreeDV’s own PulseAudio device and engine, and an explicit#include <signal.h>inPulseAudioDevice.h, which glibc’s headers pull in by way of others and musl’s do not.rade-opus-no-model-download.patch— In RADE, configure its Opus withautoreconf -isfinstead ofautogen.sh, which downloads the model weights from media.xiph.org.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install freedv-gui'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/hamradio/freedv-gui.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/hamradio/freedv-gui
echo '9e4b1bcf5d4ce3b18a1b120acb4d4483d4f635990b18a97b98174fc51fae5678 freedv-gui-2.4.0.tar.gz' | sha256sum -c -
echo 'cdab91c479653eb6595c2f94461565e8a23603db246b5c9a578ea8d8c404c216 freedv-backend-1.0.0.tar.gz' | sha256sum -c -
echo '3d51bc21c823898531be932dcfff684904b6090db1b98dbd39a4fb8a2771c10b rade_c-cc17222acc597339199bdfd7253c3e6cf147f953.tar.gz' | sha256sum -c -
echo '285c74f5130ee074f123aaad81cd52c2fc8db653ee130941afafe3ee0ae8cec2 opus-940d4e5af64351ca8ba8390df3f555484c567fbb.tar.gz' | sha256sum -c -
echo '4ed9445b96698bad25d852e912b41495ddfa30c8dbc8a55f9cde5826ed793453 opus_data-4ed9445b96698bad25d852e912b41495ddfa30c8dbc8a55f9cde5826ed793453.tar.gz' | sha256sum -c -
echo 'f61ee0b3f4c4cd337303e003d333357c5eaf25ef5d75a742109ee59e9a0a3932 rnnoise-70f1d256acd4b34a572f999a05c87bf00b67730d.tar.gz' | sha256sum -c -
echo '0a8755f8e2d834eff6a54714ecc7d75f9932e845df35f8b59bc52a7cfe6e8b37 rnnoise_data-0a8755f8e2d834eff6a54714ecc7d75f9932e845df35f8b59bc52a7cfe6e8b37.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/freedv-gui
SRC=$SRC_ROOT/freedv-gui-2.4.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf freedv-gui-2.4.0.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf freedv-backend-1.0.0.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf rade_c-cc17222acc597339199bdfd7253c3e6cf147f953.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf opus-940d4e5af64351ca8ba8390df3f555484c567fbb.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf opus_data-4ed9445b96698bad25d852e912b41495ddfa30c8dbc8a55f9cde5826ed793453.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf rnnoise-70f1d256acd4b34a572f999a05c87bf00b67730d.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf rnnoise_data-0a8755f8e2d834eff6a54714ecc7d75f9932e845df35f8b59bc52a7cfe6e8b37.tar.gz -C "$SRC_ROOT"
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _backend, _rade, _opus, _opusdata, _rnnoise, _rnnoisedata and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
_be="$SRC_ROOT/freedv-backend-$_backend"
_rade_src="$SRC_ROOT/rade_c-$_rade"
_opus_src="$SRC_ROOT/opus-$_opus"
_rnnoise_src="$SRC_ROOT/rnnoise-$_rnnoise"
patch -p1 -i "$PORT_SRC/musl.patch"
patch -d "$_be" -p1 -i "$PORT_SRC/backend-local-sources.patch"
patch -d "$_be" -p1 -i "$PORT_SRC/backend-musl.patch"
patch -d "$_rade_src" -p1 -i "$PORT_SRC/rade-opus-no-model-download.patch"
cp -a "$SRC_ROOT/dnn/." "$_opus_src/dnn/"
cp -a "$SRC_ROOT"/src/rnnoise_data* "$_rnnoise_src/src/"
export X86_AVX2_CFLAGS="-mavx -mfma -mavx2 -Wno-error=incompatible-pointer-types"
export LDFLAGS="$LDFLAGS -Wl,--strip-debug"
cmake -B build \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
-DFETCHCONTENT_SOURCE_DIR_FREEDV_BACKEND="$_be" \
-DRADE_C_URL="$_rade_src" \
-DOPUS_URL="$_opus_src" \
-DRNNOISE_URL="$_rnnoise_src" \
-DUSE_NATIVE_AUDIO=TRUE \
-DUSE_STATIC_DEPS=FALSE \
-DBOOTSTRAP_WXWIDGETS=FALSE \
-DDISABLE_TLS_SUPPORT=FALSE \
-DUSE_STATIC_LIBRESSL=FALSE \
-DUNITTEST=OFF \
-DBUILD_BACKEND_UNITTESTS=OFF \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
install -d "$PKG/usr/lib"
cp -a build/_deps/freedv_backend-build/rade_build/src/librade.so* "$PKG/usr/lib/"
cat > "$PKG/usr/share/applications/freedv.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=FreeDV
GenericName=HF Digital Voice
Comment=Digital voice for HF amateur radio over a sound card: RADE, 700D, 700E and 1600
Exec=freedv
Icon=freedv
Terminal=false
StartupWMClass=freedv
Categories=Network;HamRadio;AudioVideo;Audio;
Keywords=ham;radio;digital;voice;hf;codec2;rade;freedv;
DESKTOP
chmod 644 "$PKG/usr/share/applications/freedv.desktop"
test -x "$PKG/usr/bin/freedv"
test -e "$PKG/usr/lib/librade.so.0.1"
test -e "$PKG/usr/share/icons/hicolor/48x48/apps/freedv.png"
The switches, and why each is set:
-DFETCHCONTENT_FULLY_DISCONNECTED=ON— Never let CMake’s FetchContent go to the network.-DFETCHCONTENT_SOURCE_DIR_FREEDV_BACKENDpoints freedv-backend, which the configure always pulls in through FetchContent, at its unpacked later source. The other FetchContent dependencies (PortAudio, wxWidgets, libsamplerate, LibreSSL) are fallbacks, which the switches below and the libraries independskeep from being declared at all.-DRADE_C_URL="$_rade_src"— The variablesbackend-local-sources.patchadds: the RADE, Opus and RNNoise ExternalProjects build from the unpacked later sources named here (-DOPUS_URL,-DRNNOISE_URL) instead of cloning a branch head or downloading an archive.-DUSE_NATIVE_AUDIO=TRUE— Use FreeDV’s own PulseAudio engine instead of PortAudio; PipeWire answers it through its PulseAudio server (see Audio). It is upstream’s default.-DUSE_STATIC_DEPS=FALSE— Link the system libraries instead of downloading and building static ones. With-DUSE_STATIC_LIBRESSL=FALSEand-DDISABLE_TLS_SUPPORT=FALSE, the TLS connection to FreeDV Reporter uses the openssl port instead of a static LibreSSL, and with libsamplerate and libebur128 independsthe backend builds none of its static fallbacks.-DBOOTSTRAP_WXWIDGETS=FALSE— Use the wxwidgets port instead of downloading and building a static wxWidgets.-DUNITTEST=OFF— No unit test programs;-DBUILD_BACKEND_UNITTESTS=OFFdoes the same for the backend.X86_AVX2_CFLAGS="-mavx -mfma -mavx2 -Wno-error=incompatible-pointer-types"— Opus’s configure compiles its AVX2 sources with the flags in this variable. The value is Opus’s default with-Wno-error=incompatible-pointer-typesadded, which turns that diagnostic, an error by default in GCC, into a warning in those files.LDFLAGS="$LDFLAGS -Wl,--strip-debug"— Have the linker drop debug sections from everything it links.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/freedv-gui, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf freedv-gui-2.4.0-2.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/freedv-gui, and runs the triggers its paths call for.
Contents
Installed programs: freedv.
Installed libraries: librade.so.
Installed directories: /usr/share/freedv-gui, /usr/share/licenses/freedv-gui.
Notes
Nothing is fetched at build time. Every tree upstream would download is a later source, and the two model weight archives (opus_data-*, rnnoise_data-*) unpack into $SRC_ROOT, from where build.sh copies dnn/ into the Opus tree and src/rnnoise_data* into the RNNoise tree before the configure. Each commit and weight hash is a helper in the recipe.
The generator is CMake’s default, Unix Makefiles, never Ninja: the Opus and RNNoise ExternalProjects build with a literal $(MAKE), which Ninja cannot run.
RADE is a shared library that the backend builds and upstream installs only in its macOS bundle. freedv links it by soname, so build.sh copies librade.so* from the build tree into /usr/lib, and the test lines at the end fail the build if it, the program or the icon is missing.
The desktop entry replaces upstream’s to carry StartupWMClass=freedv: wxGTK names the GTK program after the command, so that is the Wayland app id.