Skip to content

Gate compression meter on radio TX state#2363

Merged
ten9876 merged 1 commit intoten9876:mainfrom
jensenpat:aether/issue-2325-compression-meter
May 5, 2026
Merged

Gate compression meter on radio TX state#2363
ten9876 merged 1 commit intoten9876:mainfrom
jensenpat:aether/issue-2325-compression-meter

Conversation

@jensenpat
Copy link
Copy Markdown
Collaborator

@jensenpat jensenpat commented May 5, 2026

Summary

  • Track the raw interlock TX state in RadioModel and expose it as the model-owned source of truth.
  • Gate the P/CW compression gauge on actual radio TX state plus speech processor enable.
  • Clear the compression gauge when the radio leaves TX so RX quiescent TX-chain meter values cannot leave the display pegged.

Fixes #2325

Root Cause

FLEX-8000 radios can continue publishing TX-chain compression source meters while the radio is in receive. AetherSDR forwarded the derived compression value whenever PROC was enabled, without checking whether the radio was actually transmitting. In FT8/DIGU receive this could show a full red compression meter even though compression has no meaningful RX value.

Impact

The P/CW compression gauge now stays at zero during RX and on initial connection/reconnect until the radio reports TRANSMITTING. Voice TX with PROC enabled can still show compression, including raw radio TX paths such as VOX or hardware PTT. Digital TX paths that bypass PROC continue to show no compression.

Validation

  • cmake -B build-ninja -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
  • env -u CPLUS_INCLUDE_PATH cmake --build build-ninja --parallel 22
  • ctest --test-dir build-ninja --output-on-failure
  • ./build-ninja/transmit_model_test

Note: ./build-ninja/meter_model_test still fails several existing compression derivation assertions on current main; this PR does not change MeterModel derivation logic.

👨🏼‍💻 Generated with OpenAI Codex (GPT-5.5 Pro 4/23) and tested by @jensenpat

Copy link
Copy Markdown
Contributor

@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, minimal fix. The model-owned m_radioTransmitting flag is correctly stored alongside the existing radioTransmittingChanged emit, reset on disconnect, and used to gate the P/CW compression gauge through the meter handler. The explicit updateCompression(0.0f) on the TX→RX transition is a sensible belt-and-suspenders against quiescent RX meter publishes that would otherwise leave the gauge pegged until the next mic-meter event arrived.

A few observations:

  1. Order of operations is correct: in onStatusReceived you set m_radioTransmitting = radioTx before emitting the signal, so any handler reading isRadioTransmitting() synchronously sees the new value. Same pattern in onDisconnected.

  2. Access pattern in the new TX→RX clear is consistent with the surrounding lambda — m_appletPanel->sMeterWidget() is dereferenced two lines above, so the new phoneCwApplet() call has the same lifetime guarantee. No null risk introduced.

  3. One thought, not blocking: since the micMetersChanged lambda also gates on isRadioTransmitting(), the explicit clear on the radio-transmitting signal is only load-bearing when the radio stops publishing mic meters during RX. Worth a one-line comment on that explicit clear so a future reader doesn't think it's redundant with the gating below.

  4. Out of scope but flagged in the PR body: noting meter_model_test failing on main independently — agree, that's not yours to fix here.

Thanks for the focused fix and the clear root-cause writeup, @jensenpat.

@ten9876 ten9876 merged commit 8aa9b57 into ten9876:main May 5, 2026
5 checks passed
@ten9876
Copy link
Copy Markdown
Owner

ten9876 commented May 5, 2026

Claude here on Jeremy's behalf — merged via admin squash. Clean fix for a real user-reported regression. The raw-interlock-vs-owned-by-us distinction is the right call (matches the #752 DAX passthrough rationale), and the on-disconnect reset is the kind of detail that's easy to miss but matters on reconnect-to-different-radio scenarios.

73, Jeremy KK7GWY & Claude (AI dev partner)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants