Skip to content

Prefer 48kHz RX audio sink on Windows to avoid WASAPI resampler artifacts (#2120)#2123

Merged
ten9876 merged 1 commit intomainfrom
aetherclaude/issue-2120
Apr 30, 2026
Merged

Prefer 48kHz RX audio sink on Windows to avoid WASAPI resampler artifacts (#2120)#2123
ten9876 merged 1 commit intomainfrom
aetherclaude/issue-2120

Conversation

@aethersdr-agent
Copy link
Copy Markdown
Contributor

Summary

Fixes #2120

What was changed

Prefer 48kHz RX audio sink on Windows to avoid WASAPI resampler artifacts (#2120)

Files modified

  • src/core/AudioEngine.cpp
 src/core/AudioEngine.cpp | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

Generated by AetherClaude (automated agent for AetherSDR)

…acts (#2120)

WASAPI shared mode accepts 24kHz but delegates rate conversion internally,
introducing low-level artifacts that become audible when radio-side NR
(especially RNN) aggressively removes the noise floor. Swap the sink
preference to try 48kHz first, routing through r8brain for clean 24k→48k
conversion — matching the macOS TX-side approach for the same class of issue.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@aethersdr-agent aethersdr-agent Bot requested a review from ten9876 as a code owner April 28, 2026 04:18
@aethersdr-agent aethersdr-agent Bot enabled auto-merge (squash) April 28, 2026 04:18
Copy link
Copy Markdown
Contributor Author

@aethersdr-agent aethersdr-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-scoped change. The logic correctly inverts the Windows RX sink preference from 24kHz-first to 48kHz-first, with 24kHz as fallback — mirroring the macOS path that already prefers 48kHz for the same class of resampler artifact issue.

A few observations:

  1. Correctness: The fmt starts at DEFAULT_SAMPLE_RATE (24000) from makeFormat(). The PR sets it to 48000 before the first sink attempt, and the fallback correctly resets to DEFAULT_SAMPLE_RATE with m_resampleTo48k = false. The flag and format stay consistent in both success paths. Looks good.

  2. Fallback log messages: Updated to match the new order ("48kHz failed, trying 24kHz" / "24kHz also failed"). Correct.

  3. Scope: Single file, only the Windows #ifdef Q_OS_WIN block is touched. No files outside the stated scope.

  4. No new resource or null-pointer risks: The sink creation/deletion pattern is unchanged — just the order is swapped. The existing delete m_audioSink + re-create pattern on fallback is preserved.

One minor note for the maintainer: the comment block was updated from describing WASAPI's transparent sample rate conversion to explaining why we now avoid relying on it. The new comment references the macOS TX-side fix and issue #2120, which is helpful context. Worth confirming the referenced macOS fix is the one in the non-Windows configureOutputFormat lambda (lines ~528-534) that already prefers 48kHz — it appears to be.

No bugs or convention issues found. Thanks for the fix, @aethersdr-agent — this is a clean, focused change. 👍

@ten9876 ten9876 merged commit 029613c into main Apr 30, 2026
5 checks passed
@ten9876 ten9876 deleted the aetherclaude/issue-2120 branch April 30, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Garbled RNN audio when RNN is accessed from AetherSDR

1 participant