A free, open-source, multi-platform application for sending files and messages, using the codec2 HF modems
 
 
 
 
 
 
Go to file
Steve Pinkham f522b46fa8 fix(audio): re-block captured RX audio into whole DSP blocks
With blocksize=0 PortAudio picks the capture block size per device. On
the devices measured for the previous commit it happened to deliver
multiple-of-6 block sizes, but other hardware returns 512/1024-class
blocks. codec2's resample48_to_8 asserts len(input) % 6 == 0
(FDMDV_OS_48), so on such a device every captured block raised
AssertionError, the DSP chain never ran, and RX was completely deaf.

The fix decouples the capture block size from the DSP block size
instead of pinning the stream back to blocksize=4800, which is the
configuration that negotiates a two-period ring on snd-aloop and drops
audio continuously (the deaf-on-loopback case the previous commit
fixed). Captured audio is appended to a carry buffer and the DSP chain
runs once per whole RX_DSP_BLOCK_48K (4800 samples, 100 ms) available;
the remainder carries into the next captured block, so the sample
stream handed to the resampler stays gapless (its filter memory spans
blocks) and always has a valid length, whatever the device delivers.

Running the DSP only on whole 4800-sample blocks also fixes three
silent degradations that short blocks caused:

- calculate_fft pads its input to 800 samples at 8 kHz, so short
  blocks fed the waterfall, channel-busy detection and audio_dbfs
  mostly zeros
- enqueue_streaming_audio_chunks zero-pads every block up to 2400
  samples and emits one chunk per block regardless of size, so short
  blocks streamed mostly silence and flooded the RX audio queue
- normalize_audio (rx_auto_audio_level, on by default) normalizes per
  block, so shorter blocks made the auto level faster and jumpier

Tests: the old test captured 4800-frame blocks, a multiple of 6, which
is exactly why this was never caught. The capture size is now 512 and
TestRxAudioReblocking covers odd sizes never reaching the resampler,
exact block accounting including the carried remainder, sample-stream
preservation (nothing dropped, duplicated or reordered), and every
re-blocked block being accepted end to end by the real codec2
resampler. Against the pre-fix code 5 of the 6 tests fail; with the
fix all pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 21:34:19 -04:00
.github Merge remote-tracking branch 'origin/develop' into develop 2026-07-23 09:15:49 +02:00
.obs update workflow 2025-09-22 09:51:47 +02:00
documentation adjusted readme 2024-05-17 16:33:32 +02:00
freedata_gui Merge branch 'main' into develop 2026-07-23 09:19:18 +02:00
freedata_server fix(audio): re-block captured RX audio into whole DSP blocks 2026-07-24 21:34:19 -04:00
tests fix(audio): re-block captured RX audio into whole DSP blocks 2026-07-24 21:34:19 -04:00
tools Merge pull request #1052 from as3ii/ruff2 2026-01-10 21:41:48 +01:00
.gitignore Removed setup.py, fixed build of pip module 2025-11-11 23:19:20 +01:00
.prettierignore another folder renaming 2024-04-18 11:04:25 +02:00
.stignore adjusted linting stuff 2024-07-23 13:10:28 +02:00
CONTRIBUTING.md Prettified Code! 2026-06-02 18:49:23 +00:00
Dockerfile Install only required dependencies 2025-11-11 23:22:22 +01:00
LICENSE moved to GPLv3 2023-05-20 10:18:13 +02:00
README.docker.md Prettified Code! 2025-04-05 08:04:20 +00:00
README.md adjusted readme 2026-07-23 08:51:17 +02:00
add-osx-cert.sh add osx_certs 2023-01-21 12:03:13 +01:00
entrypoint.sh Add Dockerfile and build action 2025-01-03 16:30:13 +00:00
freedata-nsis-config.nsi updated nsis 2024-07-22 23:20:53 +02:00
pyproject.toml Update nuitka requirement from <=4.1.2 to <=4.1.3 2026-07-01 16:12:43 +00:00
requirements.txt Update nuitka requirement from <=4.1.2 to <=4.1.3 2026-07-01 16:12:43 +00:00

README.md

FreeDATA

[!NOTE] Development has slowed due to limited maintainer time.

[!WARNING] Latest release accumulated many changes towards the 0.18.x release, including a new broadcast feature for group chats. If you run into issues, please fall back to the more stable release, v0.17.8.

FreeDATA is a versatile, open-source platform designed specifically for HF communications, leveraging codec2 data modes for robust global digital communication. It features a network-based server-client architecture, a REST API, multi-platform compatibility, and a messaging system.

Please keep in mind, this project is still under development with many issues which need to be solved.

CodeFactor Modem tests

FreeDATA_main_screen.png

FreeDATA_chat_screen.png

Installation

Please check the wiki for installation instructions Please check the 'Releases' section for downloading precompiled builds

Credits