Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

135.19. codec2-1.2.0

The open low-bitrate speech codec and FreeDV modem library, with freedv_tx and freedv_rx

1.2.0-1 · LGPL-2.1-only · 0.5 SBU · 1.8 MiB, 25 files · 41_system, 121 of 1047 · ports/core/audio-codecs/codec2

Homepage: https://github.com/drowe67/codec2

Why it is in KDOS. The comment above it in script/phases/41_system/packages.d/audio-codecs.txt:

The low-bit-rate speech codec FreeDV's digital voice is built on.

Depends on: cmake, ninja.

Required by (4): gnuradio, sdrangel, sdrpp, sideband.

Sources: codec2-1.2.0.tar.gz (7.3 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install codec2'

build.sh:

cmake -B build -G Ninja \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DBUILD_SHARED_LIBS=ON \
	-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
	-DLPCNET=OFF \
	-DUNITTEST=OFF
ninja -C build
DESTDIR=$PKG ninja -C build install

for t in c2enc c2dec freedv_tx freedv_rx freedv_data_raw_tx freedv_data_raw_rx; do
	install -Dm755 "build/src/$t" "$PKG/usr/bin/$t"
done

test -e "$PKG/usr/lib/libcodec2.so"
test -e "$PKG/usr/lib/pkgconfig/codec2.pc"

Programs: c2dec, c2enc, freedv_data_raw_rx, freedv_data_raw_tx, freedv_rx, freedv_tx.

Libraries: libcodec2.so.

Directories: /usr/include/codec2, /usr/lib/cmake/codec2, /usr/share/licenses/codec2.