Prefer 48kHz RX audio sink on Windows to avoid WASAPI resampler artifacts (#2120)#2123
Prefer 48kHz RX audio sink on Windows to avoid WASAPI resampler artifacts (#2120)#2123
Conversation
…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]>
There was a problem hiding this comment.
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:
-
Correctness: The
fmtstarts atDEFAULT_SAMPLE_RATE(24000) frommakeFormat(). The PR sets it to 48000 before the first sink attempt, and the fallback correctly resets toDEFAULT_SAMPLE_RATEwithm_resampleTo48k = false. The flag and format stay consistent in both success paths. Looks good. -
Fallback log messages: Updated to match the new order ("48kHz failed, trying 24kHz" / "24kHz also failed"). Correct.
-
Scope: Single file, only the Windows
#ifdef Q_OS_WINblock is touched. No files outside the stated scope. -
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. 👍
Summary
Fixes #2120
What was changed
Prefer 48kHz RX audio sink on Windows to avoid WASAPI resampler artifacts (#2120)
Files modified
src/core/AudioEngine.cppGenerated by AetherClaude (automated agent for AetherSDR)