Skip to content

Fix CW local sidetone silent on Windows (#2097)#2103

Closed
aethersdr-agent[bot] wants to merge 1 commit into
mainfrom
aetherclaude/issue-2097
Closed

Fix CW local sidetone silent on Windows (#2097)#2103
aethersdr-agent[bot] wants to merge 1 commit into
mainfrom
aetherclaude/issue-2097

Conversation

@aethersdr-agent

Copy link
Copy Markdown
Contributor

Summary

Fixes #2097

What was changed

Fix CW local sidetone silent on Windows (#2097)

Files modified

  • src/core/AudioEngine.cpp
  • src/models/RadioModel.cpp
  • src/models/RadioModel.h
 src/core/AudioEngine.cpp  |  4 ++++
 src/models/RadioModel.cpp | 13 +++++++++++--
 src/models/RadioModel.h   |  1 +
 3 files changed, 16 insertions(+), 2 deletions(-)

Generated by AetherClaude (automated agent for AetherSDR)

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>

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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!

@ten9876

ten9876 commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Closing — the AudioEngine.cpp startSidetoneStream() call was added by PR #2105 (merged earlier today), which made this PR conflict on rebase. Replaying just the substantive CWX-tracking part as PR #2181, which retains the Fixes #2097 linkage.

@ten9876 ten9876 closed this Apr 30, 2026
auto-merge was automatically disabled April 30, 2026 04:14

Pull request was closed

@ten9876 ten9876 deleted the aetherclaude/issue-2097 branch April 30, 2026 04:14
ten9876 added a commit that referenced this pull request Apr 30, 2026
#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>
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.

No CW local sidetone on Windows version 0.9.1

1 participant