Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 2 race conditions #1854

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/channelrx/demodais/aisdemodbaseband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion plugins/channelrx/demodais/aisdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"}));
Expand Down
7 changes: 4 additions & 3 deletions plugins/channelrx/demoddsc/dscdemodbaseband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/demoddsc/dscdemodbaseband.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DSCDemodBaseband : public QObject
{ }
};

DSCDemodBaseband(DSCDemod *packetDemod);
DSCDemodBaseband(DSCDemod *dscDemod);
~DSCDemodBaseband();
void reset();
void startWork();
Expand Down
1 change: 0 additions & 1 deletion plugins/channelrx/demoddsc/dscdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"}));
Expand Down
5 changes: 3 additions & 2 deletions plugins/channelrx/demoddsc/dscdemodsink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/demoddsc/dscdemodsink.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions plugins/channelrx/demodnavtex/navtexdemodbaseband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/demodnavtex/navtexdemodbaseband.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class NavtexDemodBaseband : public QObject
{ }
};

NavtexDemodBaseband(NavtexDemod *packetDemod);
NavtexDemodBaseband(NavtexDemod *navtexDemod);
~NavtexDemodBaseband();
void reset();
void startWork();
Expand Down
6 changes: 3 additions & 3 deletions plugins/channelrx/demodrtty/rttydemodbaseband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/demodrtty/rttydemodbaseband.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class RttyDemodBaseband : public QObject
{ }
};

RttyDemodBaseband(RttyDemod *packetDemod);
RttyDemodBaseband(RttyDemod *rttyDemod);
~RttyDemodBaseband();
void reset();
void startWork();
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/radioclock/radioclockbaseband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion plugins/channelrx/radioclock/radioclockgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading