Skip to content

Fix RX applet pan slider broken with NR active (#1796)#1799

Merged
ten9876 merged 1 commit into
aethersdr:mainfrom
M7HNF-Ian:fix/1796-rxapplet-pan
Apr 21, 2026
Merged

Fix RX applet pan slider broken with NR active (#1796)#1799
ten9876 merged 1 commit into
aethersdr:mainfrom
M7HNF-Ian:fix/1796-rxapplet-pan

Conversation

@M7HNF-Ian

Copy link
Copy Markdown
Contributor

Problem

The original #1460 fix re-applies pan after client-side NR collapses audio to mono, but it only tracked pan changes from the VFO panel slider. The RX applet pan slider — and MIDI/keyboard shortcuts — call SliceModel::setAudioPan() directly without going through VfoWidget, so AudioEngine::m_rxPan never gets updated and stays at 50 (centre). applyRxPanInPlace with pan=50 is a no-op, making the RX applet pan slider appear completely non-functional when NR is active.

The reporter confirmed: VFO panel pan works, RX applet pan does not.

Root cause

// Before — only fires for VFO panel slider
connect(w, &VfoWidget::rxPanChanged, this, [this](int v) {
    m_audio->setRxPan(v);
});

VfoWidget::rxPanChanged is only emitted by the VFO widget's internal slider. The RX applet calls m_slice->setAudioPan(v) which emits SliceModel::audioPanChanged — a signal that wasn't connected to AudioEngine at all.

Fix

Connect SliceModel::audioPanChanged instead. Every code path that changes the pan calls setAudioPan(), which emits audioPanChanged. One connection covers all sources:

  • VFO panel pan slider ✅
  • RX applet pan slider ✅
  • MIDI / keyboard shortcuts ✅
  • Radio echo-back on connect (session restore) ✅

The active-slice guard (sliceId == m_activeSliceId) preserves the existing behaviour where AudioEngine tracks the pan of the currently active slice.

Verification

  1. Connect radio, enable NR2 (or NR4/DFNR)
  2. Move the RX applet pan slider to full left — audio should be left-only
  3. Move to full right — audio should be right-only
  4. VFO panel slider should continue to work as before

Fixes #1796

🤖 Generated with Claude Code

…rsdr#1796)

The original aethersdr#1460 fix wired VfoWidget::rxPanChanged → AudioEngine::setRxPan,
which only covers the VFO panel's pan slider.  The RX applet pan slider (and
MIDI / keyboard shortcuts) calls SliceModel::setAudioPan directly without
going through VfoWidget, so AudioEngine::m_rxPan stayed at the default 50
(centre).  With NR active, applyRxPanInPlace was always called with pan=50
(a no-op), making the RX applet pan slider appear broken.

Fix: connect SliceModel::audioPanChanged instead of VfoWidget::rxPanChanged.
Every path that changes the pan value goes through setAudioPan(), which emits
audioPanChanged.  This single connection covers:
  - VFO panel pan slider
  - RX applet pan slider
  - MIDI / shortcut controllers
  - Radio echo-back on initial connect (session restore)

The active-slice guard (sliceId == m_activeSliceId) keeps the existing
single-engine behaviour: AudioEngine tracks the pan of whichever slice is
currently active, which is the same slice NR is applied to.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@M7HNF-Ian M7HNF-Ian requested a review from ten9876 as a code owner April 21, 2026 06:17

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good fix, @Chaosuk97 — nice root-cause analysis and the approach of listening to SliceModel::audioPanChanged instead of VfoWidget::rxPanChanged is the right call. The active-slice guard with sliceId == m_activeSliceId is correct for the single-audio-stream model.

One gap to flag (pre-existing, but now easier to fix):

When the user switches the active slice (e.g. A→B), m_activeSliceId changes but SliceModel::audioPanChanged doesn't fire — the pan value didn't change, the active slice did. So AudioEngine::m_rxPan will still hold slice A's pan until slice B's pan is explicitly moved. With NR active this means the wrong pan is applied until the user touches the slider.

This was already broken in the old code (VfoWidget signal had the same issue), so it's not a regression from this PR. But since you're already in this area, it would be a nice follow-up to add a m_audio->setRxPan(s->audioPan()) call in MainWindow::setActiveSlice() (around line 6017) to sync on switch. Up to you whether to bundle it here or file a separate issue.

Minor cleanup (non-blocking): VfoWidget::rxPanChanged signal (declared in VfoWidget.h:84, emitted at VfoWidget.cpp:899) is now unused — no remaining connections. Could be cleaned up in a follow-up to avoid dead code confusion.

Code looks correct and well-scoped. Thanks for the contribution!

@ten9876 ten9876 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Correct root cause analysis — listening to the model signal is strictly better than the widget signal. Verified audioPanChanged fires from all 4 call sites. LGTM.

@ten9876 ten9876 merged commit 403f17b into aethersdr:main Apr 21, 2026
5 checks passed
ten9876 added a commit that referenced this pull request Apr 22, 2026
)

Cuts a community-contribution-heavy point release. Eight community PRs
landed plus three AetherClaude crash fixes. Highlights:

Community:
- Fix RADE RX not decoding on Windows (#1820, NF0T)
- Clamp stale DAX RX backlog on macOS — fixes +1.5s FT8 DT bias (#1822, jensenpat)
- Fix TCI DAX resampler crosstalk between slices (#1815, Chaosuk97)
- Fix RX applet pan slider with NR active (#1799, Chaosuk97)
- Fix TCI RX gain default 1.0 → 0.5 to match applet (#1811, NF0T)
- Fix HAVE_SERIALPORT guard (#1812, NF0T)
- Seamless ADIF logbook auto-reload (#1801, Chaosuk97)
- RAC Canada band-plan corrections (#1817, VE3NEM)

AetherClaude crash fixes:
- Applet reorder with floating containers (#1745#1746)
- Lazy-build RadioSetupDialog tabs, dodges Wayland FFmpeg/VDPAU crash (#1776#1777)
- PanAdapter float-freeze — show-after-reset + direct reparent (#1668#1669)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@M7HNF-Ian M7HNF-Ian deleted the fix/1796-rxapplet-pan branch June 7, 2026 14:58
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.

Audio pan broken with client NR active not fixed in 0.8.19

2 participants