From c59a3941118ef3cdbd78201548b327279c806c8b Mon Sep 17 00:00:00 2001 From: your name Date: Fri, 19 Mar 2021 18:36:29 -0500 Subject: [PATCH] hackrfinput - restore baseband filter Restore baseband filter setting. libhackrf automatically sets baseband filter when sample rate is set and it leads to a settings mismatch between gui and hardware. --- plugins/samplesource/hackrfinput/hackrfinput.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/samplesource/hackrfinput/hackrfinput.cpp b/plugins/samplesource/hackrfinput/hackrfinput.cpp index a5d414529..e41a455bd 100644 --- a/plugins/samplesource/hackrfinput/hackrfinput.cpp +++ b/plugins/samplesource/hackrfinput/hackrfinput.cpp @@ -375,6 +375,12 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force) qDebug("HackRFInput::applySettings: sample rate set to %llu S/s", settings.m_devSampleRate); m_hackRFThread->setSamplerate(settings.m_devSampleRate); } + rc = (hackrf_error) hackrf_set_baseband_filter_bandwidth(m_dev, m_settings.m_bandwidth); // restore baseband bandwidth filter. libhackrf automatically sets baseband filter when sample rate is set. + if (rc != HACKRF_SUCCESS) { + qDebug("HackRFInput::applySettings: Restore baseband filter failed: %s", hackrf_error_name(rc)); + } else { + qDebug() << "HackRFInput:applySettings: Baseband BW filter restored to " << m_settings.m_bandwidth << " Hz"; + } } } }