From 6885dd1fe60ce5689dfdd1676b09bd06adf0e739 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 9 Jan 2018 00:59:10 +0100 Subject: [PATCH] All concerned demods: call applyChannelSettings with force=true at construction and start. --- plugins/channelrx/demodam/amdemod.cpp | 8 +++++--- plugins/channelrx/demodam/amdemod.h | 2 +- plugins/channelrx/demodam/amdemodplugin.cpp | 2 +- plugins/channelrx/demodbfm/bfmdemod.cpp | 8 +++++--- plugins/channelrx/demodbfm/bfmdemod.h | 2 +- plugins/channelrx/demodbfm/bfmplugin.cpp | 2 +- plugins/channelrx/demoddsd/dsddemod.cpp | 8 +++++--- plugins/channelrx/demoddsd/dsddemod.h | 2 +- plugins/channelrx/demoddsd/dsddemodplugin.cpp | 2 +- plugins/channelrx/demodnfm/nfmdemod.cpp | 8 +++++--- plugins/channelrx/demodnfm/nfmdemod.h | 2 +- plugins/channelrx/demodnfm/nfmplugin.cpp | 2 +- plugins/channelrx/demodwfm/wfmdemod.cpp | 8 +++++--- plugins/channelrx/demodwfm/wfmdemod.h | 2 +- plugins/channelrx/demodwfm/wfmplugin.cpp | 2 +- plugins/channelrx/udpsrc/udpsrc.cpp | 8 +++++--- plugins/channelrx/udpsrc/udpsrc.h | 2 +- plugins/channelrx/udpsrc/udpsrcplugin.cpp | 2 +- 18 files changed, 42 insertions(+), 30 deletions(-) diff --git a/plugins/channelrx/demodam/amdemod.cpp b/plugins/channelrx/demodam/amdemod.cpp index 78b2e625c..6ccfa9cb1 100644 --- a/plugins/channelrx/demodam/amdemod.cpp +++ b/plugins/channelrx/demodam/amdemod.cpp @@ -67,6 +67,7 @@ AMDemod::AMDemod(DeviceSourceAPI *deviceAPI) : m_deviceAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); applySettings(m_settings, true); } @@ -133,6 +134,7 @@ void AMDemod::start() qDebug("AMDemod::start"); m_squelchCount = 0; m_audioFifo.clear(); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); } void AMDemod::stop() @@ -181,19 +183,19 @@ bool AMDemod::handleMessage(const Message& cmd) } } -void AMDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset) +void AMDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force) { qDebug() << "AMDemod::applyChannelSettings:" << " inputSampleRate: " << inputSampleRate << " inputFrequencyOffset: " << inputFrequencyOffset; if ((m_inputFrequencyOffset != inputFrequencyOffset) || - (m_inputSampleRate != inputSampleRate)) + (m_inputSampleRate != inputSampleRate) || force) { m_nco.setFreq(-inputFrequencyOffset, inputSampleRate); } - if (m_inputSampleRate != inputSampleRate) + if ((m_inputSampleRate != inputSampleRate) || force) { m_settingsMutex.lock(); m_interpolator.create(16, inputSampleRate, m_settings.m_rfBandwidth / 2.2f); diff --git a/plugins/channelrx/demodam/amdemod.h b/plugins/channelrx/demodam/amdemod.h index 3fe84b803..b6cc056e3 100644 --- a/plugins/channelrx/demodam/amdemod.h +++ b/plugins/channelrx/demodam/amdemod.h @@ -156,7 +156,7 @@ private: QMutex m_settingsMutex; - void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset); + void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false); void applySettings(const AMDemodSettings& settings, bool force = false); void processOneSample(Complex &ci) diff --git a/plugins/channelrx/demodam/amdemodplugin.cpp b/plugins/channelrx/demodam/amdemodplugin.cpp index 0f3b4c174..d8b44e840 100644 --- a/plugins/channelrx/demodam/amdemodplugin.cpp +++ b/plugins/channelrx/demodam/amdemodplugin.cpp @@ -8,7 +8,7 @@ const PluginDescriptor AMDemodPlugin::m_pluginDescriptor = { QString("AM Demodulator"), - QString("3.9.0"), + QString("3.10.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channelrx/demodbfm/bfmdemod.cpp b/plugins/channelrx/demodbfm/bfmdemod.cpp index 02e5d87a0..5dc2f6075 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.cpp +++ b/plugins/channelrx/demodbfm/bfmdemod.cpp @@ -91,6 +91,7 @@ BFMDemod::BFMDemod(DeviceSourceAPI *deviceAPI) : m_deviceAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); applySettings(m_settings, true); } @@ -300,6 +301,7 @@ void BFMDemod::start() m_squelchState = 0; m_audioFifo.clear(); m_phaseDiscri.reset(); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); } void BFMDemod::stop() @@ -363,19 +365,19 @@ bool BFMDemod::handleMessage(const Message& cmd) } } -void BFMDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset) +void BFMDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force) { qDebug() << "BFMDemod::applyChannelSettings:" << " inputSampleRate: " << inputSampleRate << " inputFrequencyOffset: " << inputFrequencyOffset; if((inputFrequencyOffset != m_inputFrequencyOffset) || - (inputSampleRate != m_inputSampleRate)) + (inputSampleRate != m_inputSampleRate) || force) { m_nco.setFreq(-inputFrequencyOffset, inputSampleRate); } - if (inputSampleRate != m_inputSampleRate) + if ((inputSampleRate != m_inputSampleRate) || force) { m_pilotPLL.configure(19000.0/inputSampleRate, 50.0/inputSampleRate, 0.01); diff --git a/plugins/channelrx/demodbfm/bfmdemod.h b/plugins/channelrx/demodbfm/bfmdemod.h index d8f823f78..cf0a7ee33 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.h +++ b/plugins/channelrx/demodbfm/bfmdemod.h @@ -225,7 +225,7 @@ private: static const int m_udpBlockSize; - void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset); + void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false); void applySettings(const BFMDemodSettings& settings, bool force = false); }; diff --git a/plugins/channelrx/demodbfm/bfmplugin.cpp b/plugins/channelrx/demodbfm/bfmplugin.cpp index 5dc76d776..1e0217d53 100644 --- a/plugins/channelrx/demodbfm/bfmplugin.cpp +++ b/plugins/channelrx/demodbfm/bfmplugin.cpp @@ -25,7 +25,7 @@ const PluginDescriptor BFMPlugin::m_pluginDescriptor = { QString("Broadcast FM Demodulator"), - QString("3.9.0"), + QString("3.10.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index 91d7d595c..a02c8c637 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -86,6 +86,7 @@ DSDDemod::DSDDemod(DeviceSourceAPI *deviceAPI) : m_deviceAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); applySettings(m_settings, true); } @@ -313,6 +314,7 @@ void DSDDemod::start() m_audioFifo1.clear(); m_audioFifo2.clear(); m_phaseDiscri.reset(); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); } void DSDDemod::stop() @@ -365,19 +367,19 @@ bool DSDDemod::handleMessage(const Message& cmd) } } -void DSDDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset) +void DSDDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force) { qDebug() << "DSDDemod::applyChannelSettings:" << " inputSampleRate: " << inputSampleRate << " inputFrequencyOffset: " << inputFrequencyOffset; if ((inputFrequencyOffset != m_inputFrequencyOffset) || - (inputSampleRate != m_inputSampleRate)) + (inputSampleRate != m_inputSampleRate) || force) { m_nco.setFreq(-inputFrequencyOffset, inputSampleRate); } - if (inputSampleRate != m_inputSampleRate) + if ((inputSampleRate != m_inputSampleRate) || force) { m_settingsMutex.lock(); m_interpolator.create(16, inputSampleRate, (m_settings.m_rfBandwidth) / 2.2); diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index 23054c5e9..80ec2d758 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -202,7 +202,7 @@ private: static const int m_udpBlockSize; - void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset); + void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false); void applySettings(const DSDDemodSettings& settings, bool force = false); }; diff --git a/plugins/channelrx/demoddsd/dsddemodplugin.cpp b/plugins/channelrx/demoddsd/dsddemodplugin.cpp index 88db9c590..9d0ce86fd 100644 --- a/plugins/channelrx/demoddsd/dsddemodplugin.cpp +++ b/plugins/channelrx/demoddsd/dsddemodplugin.cpp @@ -25,7 +25,7 @@ const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = { QString("DSD Demodulator"), - QString("3.9.1"), + QString("3.10.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index 4124092c3..bf2c1965d 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -86,6 +86,7 @@ NFMDemod::NFMDemod(DeviceSourceAPI *devieAPI) : m_deviceAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); applySettings(m_settings, true); } @@ -315,6 +316,7 @@ void NFMDemod::start() m_squelchCount = 0; m_audioFifo.clear(); m_phaseDiscri.reset(); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); } void NFMDemod::stop() @@ -361,19 +363,19 @@ bool NFMDemod::handleMessage(const Message& cmd) } } -void NFMDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset) +void NFMDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force) { qDebug() << "NFMDemod::applyChannelSettings:" << " inputSampleRate: " << inputSampleRate << " inputFrequencyOffset: " << inputFrequencyOffset; if ((inputFrequencyOffset != m_inputFrequencyOffset) || - (inputSampleRate != m_inputSampleRate)) + (inputSampleRate != m_inputSampleRate) || force) { m_nco.setFreq(-inputFrequencyOffset, inputSampleRate); } - if (inputSampleRate != m_inputSampleRate) + if ((inputSampleRate != m_inputSampleRate) || force) { m_settingsMutex.lock(); m_interpolator.create(16, inputSampleRate, m_settings.m_rfBandwidth / 2.2); diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index d2a4136fd..ea456f022 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -220,7 +220,7 @@ private: static const int m_udpBlockSize; // void apply(bool force = false); - void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset); + void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false); void applySettings(const NFMDemodSettings& settings, bool force = false); void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const NFMDemodSettings& settings); }; diff --git a/plugins/channelrx/demodnfm/nfmplugin.cpp b/plugins/channelrx/demodnfm/nfmplugin.cpp index 5ee26501a..4f8817f06 100644 --- a/plugins/channelrx/demodnfm/nfmplugin.cpp +++ b/plugins/channelrx/demodnfm/nfmplugin.cpp @@ -7,7 +7,7 @@ const PluginDescriptor NFMPlugin::m_pluginDescriptor = { QString("NFM Demodulator"), - QString("3.9.0"), + QString("3.10.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channelrx/demodwfm/wfmdemod.cpp b/plugins/channelrx/demodwfm/wfmdemod.cpp index 0c66af406..5a8cd282d 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.cpp +++ b/plugins/channelrx/demodwfm/wfmdemod.cpp @@ -70,6 +70,7 @@ WFMDemod::WFMDemod(DeviceSourceAPI* deviceAPI) : m_deviceAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); applySettings(m_settings, true); } @@ -200,6 +201,7 @@ void WFMDemod::start() m_squelchState = 0; m_audioFifo.clear(); m_phaseDiscri.reset(); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); } void WFMDemod::stop() @@ -253,19 +255,19 @@ bool WFMDemod::handleMessage(const Message& cmd) } } -void WFMDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset) +void WFMDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force) { qDebug() << "WFMDemod::applyChannelSettings:" << " inputSampleRate: " << inputSampleRate << " inputFrequencyOffset: " << inputFrequencyOffset; if((inputFrequencyOffset != m_inputFrequencyOffset) || - (inputSampleRate != m_inputSampleRate)) + (inputSampleRate != m_inputSampleRate) || force) { m_nco.setFreq(-inputFrequencyOffset, inputSampleRate); } - if (inputSampleRate != m_inputSampleRate) + if ((inputSampleRate != m_inputSampleRate) || force) { qDebug() << "WFMDemod::applyChannelSettings: m_interpolator.create"; m_interpolator.create(16, inputSampleRate, m_settings.m_afBandwidth); diff --git a/plugins/channelrx/demodwfm/wfmdemod.h b/plugins/channelrx/demodwfm/wfmdemod.h index 120612ee4..5956cc60d 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.h +++ b/plugins/channelrx/demodwfm/wfmdemod.h @@ -167,7 +167,7 @@ private: static const int m_udpBlockSize; - void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset); + void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false); void applySettings(const WFMDemodSettings& settings, bool force = false); }; diff --git a/plugins/channelrx/demodwfm/wfmplugin.cpp b/plugins/channelrx/demodwfm/wfmplugin.cpp index 78afb944d..0bf17c9cc 100644 --- a/plugins/channelrx/demodwfm/wfmplugin.cpp +++ b/plugins/channelrx/demodwfm/wfmplugin.cpp @@ -8,7 +8,7 @@ const PluginDescriptor WFMPlugin::m_pluginDescriptor = { QString("WFM Demodulator"), - QString("3.9.0"), + QString("3.10.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channelrx/udpsrc/udpsrc.cpp b/plugins/channelrx/udpsrc/udpsrc.cpp index 768a45a35..c0aa7be87 100644 --- a/plugins/channelrx/udpsrc/udpsrc.cpp +++ b/plugins/channelrx/udpsrc/udpsrc.cpp @@ -102,6 +102,7 @@ UDPSrc::UDPSrc(DeviceSourceAPI *deviceAPI) : m_deviceAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); applySettings(m_settings, true); } @@ -313,6 +314,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: void UDPSrc::start() { m_phaseDiscri.reset(); + applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); } void UDPSrc::stop() @@ -445,19 +447,19 @@ void UDPSrc::audioReadyRead() //qDebug("UDPSrc::audioReadyRead: done"); } -void UDPSrc::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset) +void UDPSrc::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force) { qDebug() << "UDPSrc::applyChannelSettings:" << " inputSampleRate: " << inputSampleRate << " inputFrequencyOffset: " << inputFrequencyOffset; if((inputFrequencyOffset != m_inputFrequencyOffset) || - (inputSampleRate != m_inputSampleRate)) + (inputSampleRate != m_inputSampleRate) || force) { m_nco.setFreq(-inputFrequencyOffset, inputSampleRate); } - if (inputSampleRate != m_inputSampleRate) + if ((inputSampleRate != m_inputSampleRate) || force) { m_settingsMutex.lock(); m_interpolator.create(16, inputSampleRate, m_settings.m_rfBandwidth / 2.0); diff --git a/plugins/channelrx/udpsrc/udpsrc.h b/plugins/channelrx/udpsrc/udpsrc.h index 7f6050d67..f575443e3 100644 --- a/plugins/channelrx/udpsrc/udpsrc.h +++ b/plugins/channelrx/udpsrc/udpsrc.h @@ -198,7 +198,7 @@ protected: QMutex m_settingsMutex; - void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset); + void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = true); void applySettings(const UDPSrcSettings& settings, bool force = false); inline void calculateSquelch(double value) diff --git a/plugins/channelrx/udpsrc/udpsrcplugin.cpp b/plugins/channelrx/udpsrc/udpsrcplugin.cpp index 2ea355c73..b226c4bb1 100644 --- a/plugins/channelrx/udpsrc/udpsrcplugin.cpp +++ b/plugins/channelrx/udpsrc/udpsrcplugin.cpp @@ -25,7 +25,7 @@ const PluginDescriptor UDPSrcPlugin::m_pluginDescriptor = { QString("UDP Channel Source"), - QString("3.9.0"), + QString("3.10.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true,