1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Merge pull request #1854 from srcejon/fix_scope_streams

Fix 2 race conditions
This commit is contained in:
Edouard Griffiths 2023-10-23 17:25:28 +02:00 committed by GitHub
commit 11685fa70d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 19 additions and 18 deletions

View File

@ -32,6 +32,7 @@ AISDemodBaseband::AISDemodBaseband(AISDemod *aisDemod) :
{
qDebug("AISDemodBaseband::AISDemodBaseband");
m_scopeSink.setNbStreams(AISDemodSettings::m_scopeStreams);
m_sink.setScopeSink(&m_scopeSink);
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000));
m_channelizer = new DownChannelizer(&m_sink);

View File

@ -744,7 +744,6 @@ AISDemodGUI::AISDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_scopeVis = m_aisDemod->getScopeSink();
m_scopeVis->setGLScope(ui->glScope);
m_scopeVis->setNbStreams(AISDemodSettings::m_scopeStreams);
ui->glScope->connectTimer(MainCore::instance()->getMasterTimer());
ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope);
ui->scopeGUI->setStreams(QStringList({"IQ", "MagSq", "FM demod", "Gaussian", "RX buf", "Correlation", "Threshold met", "DC offset", "CRC"}));

View File

@ -26,12 +26,13 @@
MESSAGE_CLASS_DEFINITION(DSCDemodBaseband::MsgConfigureDSCDemodBaseband, Message)
DSCDemodBaseband::DSCDemodBaseband(DSCDemod *packetDemod) :
m_sink(packetDemod),
DSCDemodBaseband::DSCDemodBaseband(DSCDemod *dscDemod) :
m_sink(dscDemod),
m_running(false)
{
qDebug("DSCDemodBaseband::DSCDemodBaseband");
m_scopeSink.setNbStreams(DSCDemodSettings::m_scopeStreams);
m_sink.setScopeSink(&m_scopeSink);
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000));
m_channelizer = new DownChannelizer(&m_sink);
@ -92,7 +93,7 @@ void DSCDemodBaseband::handleData()
{
QMutexLocker mutexLocker(&m_mutex);
while ((m_sampleFifo.fill() > 0) && (m_inputMessageQueue.size() == 0))
while ((m_sampleFifo.fill() > 0) && (m_inputMessageQueue.size() == 0) && m_channelizer->getBasebandSampleRate())
{
SampleVector::iterator part1begin;
SampleVector::iterator part1end;

View File

@ -61,7 +61,7 @@ public:
{ }
};
DSCDemodBaseband(DSCDemod *packetDemod);
DSCDemodBaseband(DSCDemod *dscDemod);
~DSCDemodBaseband();
void reset();
void startWork();

View File

@ -576,7 +576,6 @@ DSCDemodGUI::DSCDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_scopeVis = m_dscDemod->getScopeSink();
m_scopeVis->setGLScope(ui->glScope);
m_scopeVis->setNbStreams(DSCDemodSettings::m_scopeStreams);
ui->glScope->connectTimer(MainCore::instance()->getMasterTimer());
ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope);
ui->scopeGUI->setStreams(QStringList({"IQ", "MagSq", "abs1", "abs2", "Unbiased", "Biased", "Data", "Clock", "Bit", "GotSOP"}));

View File

@ -29,8 +29,9 @@
#include "dscdemod.h"
#include "dscdemodsink.h"
DSCDemodSink::DSCDemodSink(DSCDemod *packetDemod) :
m_dscDemod(packetDemod),
DSCDemodSink::DSCDemodSink(DSCDemod *dscDemod) :
m_scopeSink(nullptr),
m_dscDemod(dscDemod),
m_channelSampleRate(DSCDemodSettings::DSCDEMOD_CHANNEL_SAMPLE_RATE),
m_channelFrequencyOffset(0),
m_magsqSum(0.0f),

View File

@ -41,7 +41,7 @@ class ScopeVis;
class DSCDemodSink : public ChannelSampleSink {
public:
DSCDemodSink(DSCDemod *packetDemod);
DSCDemodSink(DSCDemod *dscDemod);
~DSCDemodSink();
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);

View File

@ -26,8 +26,8 @@
MESSAGE_CLASS_DEFINITION(NavtexDemodBaseband::MsgConfigureNavtexDemodBaseband, Message)
NavtexDemodBaseband::NavtexDemodBaseband(NavtexDemod *packetDemod) :
m_sink(packetDemod),
NavtexDemodBaseband::NavtexDemodBaseband(NavtexDemod *navtexDemod) :
m_sink(navtexDemod),
m_running(false)
{
qDebug("NavtexDemodBaseband::NavtexDemodBaseband");
@ -92,7 +92,7 @@ void NavtexDemodBaseband::handleData()
{
QMutexLocker mutexLocker(&m_mutex);
while ((m_sampleFifo.fill() > 0) && (m_inputMessageQueue.size() == 0))
while ((m_sampleFifo.fill() > 0) && (m_inputMessageQueue.size() == 0) && m_channelizer->getBasebandSampleRate())
{
SampleVector::iterator part1begin;
SampleVector::iterator part1end;

View File

@ -61,7 +61,7 @@ public:
{ }
};
NavtexDemodBaseband(NavtexDemod *packetDemod);
NavtexDemodBaseband(NavtexDemod *navtexDemod);
~NavtexDemodBaseband();
void reset();
void startWork();

View File

@ -26,8 +26,8 @@
MESSAGE_CLASS_DEFINITION(RttyDemodBaseband::MsgConfigureRttyDemodBaseband, Message)
RttyDemodBaseband::RttyDemodBaseband(RttyDemod *packetDemod) :
m_sink(packetDemod),
RttyDemodBaseband::RttyDemodBaseband(RttyDemod *rttyDemod) :
m_sink(rttyDemod),
m_running(false)
{
qDebug("RttyDemodBaseband::RttyDemodBaseband");
@ -92,7 +92,7 @@ void RttyDemodBaseband::handleData()
{
QMutexLocker mutexLocker(&m_mutex);
while ((m_sampleFifo.fill() > 0) && (m_inputMessageQueue.size() == 0))
while ((m_sampleFifo.fill() > 0) && (m_inputMessageQueue.size() == 0) && m_channelizer->getBasebandSampleRate())
{
SampleVector::iterator part1begin;
SampleVector::iterator part1end;

View File

@ -61,7 +61,7 @@ public:
{ }
};
RttyDemodBaseband(RttyDemod *packetDemod);
RttyDemodBaseband(RttyDemod *rttyDemod);
~RttyDemodBaseband();
void reset();
void startWork();

View File

@ -33,6 +33,7 @@ RadioClockBaseband::RadioClockBaseband(RadioClock *radioClock) :
{
qDebug("RadioClockBaseband::RadioClockBaseband");
m_scopeSink.setNbStreams(RadioClockSettings::m_scopeStreams);
m_sink.setScopeSink(&m_scopeSink);
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000));
m_channelizer = new DownChannelizer(&m_sink);

View File

@ -292,7 +292,6 @@ RadioClockGUI::RadioClockGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
m_scopeVis = m_radioClock->getScopeSink();
m_scopeVis->setGLScope(ui->glScope);
m_scopeVis->setNbStreams(RadioClockSettings::m_scopeStreams);
m_scopeVis->setLiveRate(RadioClockSettings::RADIOCLOCK_CHANNEL_SAMPLE_RATE);
ui->glScope->connectTimer(MainCore::instance()->getMasterTimer());
ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope);