Fix CW local sidetone silent on Windows (#2097)#2103
Fix CW local sidetone silent on Windows (#2097)#2103aethersdr-agent[bot] wants to merge 1 commit into
Conversation
Two bugs from the v0.9.1 sidetone rewrite prevented local CW sidetone on Windows: 1. The Windows-specific startRxStream() path (Q_OS_WIN ifdef) returned before calling startSidetoneStream(), so the sidetone QAudioSink was never created. All local sidetone (CW key/paddle and CWX) was silently discarded. 2. The interlock handler did not recognise CWX as a local TX source. When the radio entered TRANSMITTING via CWX, the handler forced the audio gate off because neither m_txRequested nor m_cwKeyActive was set. Added m_cwxActive flag, set on "cwx send"/"cwx macro send" and cleared on "cwx clear" or when the interlock leaves TX state. Both fixes were originally discovered in #2045/#2047 but were not carried forward into the PortAudio backend rewrite. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Reviewed the diff across all three files. This is a clean, well-scoped fix for #2097.
AudioEngine.cpp — Calling startSidetoneStream() from startRxStream() makes sense. The method already has a proper idempotency guard (if (m_sidetoneSink && m_sidetoneSink->isRunning()) return true) so repeated calls are safe. The return value is intentionally ignored here, which is correct — sidetone failure shouldn't block RX audio from starting.
RadioModel.cpp / RadioModel.h — The m_cwxActive flag tracks CWX send state so the interlock handler doesn't prematurely force the audio gate off during CWX transmissions. The cmd.startsWith() patterns match exactly what CwxModel emits ("cwx send ", "cwx macro send ", "cwx clear"). The flag is properly reset in three places: on cwx clear, on TX-complete (interlock returns to non-transitioning state), and on disconnect — no stale state risk.
The interlock condition at line ~2667 now correctly mirrors the existing pattern for m_cwKeyActive, just extended to cover CWX alongside CW paddle keying.
All changes are within the stated scope. No issues found — looks good to merge. Thanks for the fix, @aethersdr-agent!
Pull request was closed
#2181) When CWX is sending (the user pressed Send in the CWX window or fired a macro), the radio enters TRANSMITTING via CW keying. The interlock handler at onStatusReceived gates m_txAudioGate based on whether we believe we're the source of TX — but for CWX it had no signal that the local CWX queue is in flight, so the gate was forced off and the local sidetone path silenced. Adds an m_cwxActive flag, set in the cwxModel commandReady lambda when "cwx send" / "cwx macro send" goes out and cleared on "cwx clear" or when the radio leaves the transmitting state. The interlock guard now includes !m_cwxActive in the "should we force gate off" check. Carved out from PR #2103 (which also added a now-redundant startSidetoneStream() call in AudioEngine — already landed via PR #2105 / commit c906165). This PR contains only the substantive CWX-tracking changes. Fixes #2097. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Fixes #2097
What was changed
Fix CW local sidetone silent on Windows (#2097)
Files modified
src/core/AudioEngine.cppsrc/models/RadioModel.cppsrc/models/RadioModel.hGenerated by AetherClaude (automated agent for AetherSDR)