Fix RX applet pan slider broken with NR active (#1796)#1799
Conversation
…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>
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
) 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>
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 throughVfoWidget, soAudioEngine::m_rxPannever gets updated and stays at 50 (centre).applyRxPanInPlacewith 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
VfoWidget::rxPanChangedis only emitted by the VFO widget's internal slider. The RX applet callsm_slice->setAudioPan(v)which emitsSliceModel::audioPanChanged— a signal that wasn't connected to AudioEngine at all.Fix
Connect
SliceModel::audioPanChangedinstead. Every code path that changes the pan callssetAudioPan(), which emitsaudioPanChanged. One connection covers all sources:The active-slice guard (
sliceId == m_activeSliceId) preserves the existing behaviour where AudioEngine tracks the pan of the currently active slice.Verification
Fixes #1796
🤖 Generated with Claude Code