Skip to content

[meters] Fix per-slice compression meter resolution#2073

Merged
ten9876 merged 1 commit intoten9876:mainfrom
jensenpat:aether/compression-meter-active-slice
Apr 27, 2026
Merged

[meters] Fix per-slice compression meter resolution#2073
ten9876 merged 1 commit intoten9876:mainfrom
jensenpat:aether/compression-meter-active-slice

Conversation

@jensenpat
Copy link
Copy Markdown
Collaborator

Summary

This PR fixes the compression gauge on multi-slice sessions by resolving TX compression meters against the active TX slice instead of using last-match-wins global meter IDs.

The implementation now tracks COMPPEAK, AFTEREQ, and SC_MIC by TX waveform source when the radio provides explicit per-slice source indices, and by manifest slice context for repeated TX- num=0 blocks seen on 8000-series captures. RadioModel keeps MeterModel updated with the active TX slice so runtime TX reassignment selects the correct meter pair without reconnecting.

Investigation Notes

Issue #2040 matches our FLEX-6600 findings. The 6600 manifest repeats TX waveform blocks per slice, with observed SC_MIC / COMPPEAK pairs such as 22/23, 44/45, 66/67, and 88/89. Those numeric IDs are session-specific manifest slots, not API contracts. The old scalar indexes bound to the highest-numbered slice, so any other active TX slice could publish VITA meter values that were silently ignored.

For 6000-series radios without AFTEREQ, the derived gauge uses active-slice SC_MIC and COMPPEAK:

compression_lift_db = max(0, COMPPEAK - SC_MIC)
display_db = -clamp(compression_lift_db, 0, 25)

For 8000-series radios with AFTEREQ, the derived gauge uses active-slice AFTEREQ and COMPPEAK:

compression_lift_db = max(0, COMPPEAK - AFTEREQ)
display_db = -clamp(compression_lift_db, 0, 25)

The 8400M validation logs showed slice 0 using AFTEREQ 24 + COMPPEAK 25 and slice 1 using AFTEREQ 47 + COMPPEAK 48, with compression activity on both slices after TX reassignment.

Changes

  • Replace scalar compression meter indexes with per-source and per-slice maps in MeterModel.
  • Add active TX slice tracking from RadioModel into MeterModel.
  • Clear stale compression state when the active TX slice changes or compression meter definitions are removed.
  • Add throttled meter diagnostics showing selected reference meter, COMPPEAK, active slice, source index, freshness, lift, display value, and availability.
  • Add unit tests for 6000-series explicit source mapping, 8000-series explicit source mapping, 8000-series repeated TX- num=0 mapping, sparse slice IDs, removal handling, freshness gating, and no-fallback behavior.
  • Update meter documentation with current formulas, FPS notes, and multi-slice resolution rules.

Validation

  • Rebasing branch onto latest origin/main at c215b4c completed cleanly.
  • cmake --build build -j 10
  • ./build/meter_model_test
  • git diff --check
  • Manual 8400M log review confirmed both slice 0 and slice 1 resolve active-slice compression pairs and show live compression values.

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

@jensenpat jensenpat changed the title Fix per-slice compression meter resolution [meters] Fix per-slice compression meter resolution Apr 27, 2026
@jensenpat jensenpat marked this pull request as ready for review April 27, 2026 03:26
@ten9876 ten9876 merged commit 104ef60 into ten9876:main Apr 27, 2026
5 checks passed
ten9876 added a commit that referenced this pull request Apr 27, 2026
Local iambic CW keyer (#2079), unified sidetone controls, CW pan
slider wiring, slice capacity notification (#48), three latent
netcw protocol bugs that prevented CW transmit on FLEX-8600 v4.1.5
firmware, optimistic updates for cwIambic/iambicMode/cwSpeed/cwPitch,
PortAudio JACK preference for sub-5 ms sidetone on Linux, plus the
graceful disconnect (#1997), memory recall (#2080), per-slice
compression meter (#2073), and m_activeTxSlice (#2078) fixes from
the community.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@aethersdr-agent aethersdr-agent Bot mentioned this pull request May 2, 2026
2 tasks
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.

2 participants