1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-07 08:24:43 -04:00

post sample rate changes directly on DSP input message queue. Removed sample source output queue entirely as it was not reliable under stress

This commit is contained in:
f4exb
2015-09-27 12:50:38 +02:00
parent 7cc0d95054
commit 525a3f0024
12 changed files with 24 additions and 34 deletions
+3 -18
View File
@@ -502,7 +502,6 @@ void DSPEngine::handleSetSource(SampleSource* source)
if(m_sampleSource != 0)
{
disconnect(m_sampleSource->getSampleFifo(), SIGNAL(dataReady()), this, SLOT(handleData()));
disconnect(m_sampleSource->getOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
}
m_sampleSource = source;
@@ -511,7 +510,6 @@ void DSPEngine::handleSetSource(SampleSource* source)
{
qDebug() << " - set " << source->getDeviceDescription().toStdString().c_str();
connect(m_sampleSource->getSampleFifo(), SIGNAL(dataReady()), this, SLOT(handleData()), Qt::QueuedConnection);
connect(m_sampleSource->getOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
}
else
{
@@ -638,21 +636,8 @@ void DSPEngine::handleInputMessages()
delete message;
}
}
}
void DSPEngine::handleSourceMessages()
{
Message *message;
while ((message = m_sampleSource->getOutputMessageQueue()->pop()) != 0)
{
qDebug() << "DSPEngine::handleSourceMessages: " << message->getIdentifier();
if (DSPSignalNotification::match(*message))
else if (DSPSignalNotification::match(*message))
{
qDebug() << "DSPEngine::handleSourceMessages: process DSPSignalNotification";
DSPSignalNotification *notif = (DSPSignalNotification *) message;
// update DSP values
@@ -660,13 +645,13 @@ void DSPEngine::handleSourceMessages()
m_sampleRate = notif->getSampleRate();
m_centerFrequency = notif->getCenterFrequency();
qDebug() << "DSPEngine::handleSourceMessages: DSPSignalNotification(" << m_sampleRate << "," << m_centerFrequency << ")";
qDebug() << "DSPEngine::handleInputMessages: DSPSignalNotification(" << m_sampleRate << "," << m_centerFrequency << ")";
// forward source changes to sinks with immediate execution
for(SampleSinks::const_iterator it = m_sampleSinks.begin(); it != m_sampleSinks.end(); it++)
{
qDebug() << "DSPEngine::handleSourceMessages: forward message to " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPEngine::handleInputMessages: forward message to " << (*it)->objectName().toStdString().c_str();
(*it)->handleMessage(*message);
}