From ac39e557794f9fcdb795da5dccaba468911c30bb Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 7 Sep 2019 10:44:40 +0200 Subject: [PATCH] TestMI and MIMO engine fixes --- plugins/samplemimo/testmi/testmi.cpp | 2 +- sdrbase/dsp/dspdevicemimoengine.cpp | 73 ++++++++++++++++++++++------ 2 files changed, 59 insertions(+), 16 deletions(-) diff --git a/plugins/samplemimo/testmi/testmi.cpp b/plugins/samplemimo/testmi/testmi.cpp index 6d43c1633..c2a6a5296 100644 --- a/plugins/samplemimo/testmi/testmi.cpp +++ b/plugins/samplemimo/testmi/testmi.cpp @@ -45,7 +45,7 @@ MESSAGE_CLASS_DEFINITION(TestMI::MsgStartStop, Message) TestMI::TestMI(DeviceAPI *deviceAPI) : m_deviceAPI(deviceAPI), m_settings(), - m_deviceDescription(), + m_deviceDescription("TestMI"), m_running(false), m_masterTimer(deviceAPI->getMasterTimer()) { diff --git a/sdrbase/dsp/dspdevicemimoengine.cpp b/sdrbase/dsp/dspdevicemimoengine.cpp index be2150fab..936ce1377 100644 --- a/sdrbase/dsp/dspdevicemimoengine.cpp +++ b/sdrbase/dsp/dspdevicemimoengine.cpp @@ -89,7 +89,7 @@ void DSPDeviceMIMOEngine::stop() bool DSPDeviceMIMOEngine::initProcess() { - qDebug() << "DSPDeviceMIMOEngine::initGeneration"; + qDebug() << "DSPDeviceMIMOEngine::initProcess"; DSPGenerationInit cmd; return m_syncMessenger.sendWait(cmd) == StReady; @@ -97,7 +97,7 @@ bool DSPDeviceMIMOEngine::initProcess() bool DSPDeviceMIMOEngine::startProcess() { - qDebug() << "DSPDeviceMIMOEngine::startGeneration"; + qDebug() << "DSPDeviceMIMOEngine::startProcess"; DSPGenerationStart cmd; return m_syncMessenger.sendWait(cmd) == StRunning; @@ -105,7 +105,7 @@ bool DSPDeviceMIMOEngine::startProcess() void DSPDeviceMIMOEngine::stopProcess() { - qDebug() << "DSPDeviceMIMOEngine::stopGeneration"; + qDebug() << "DSPDeviceMIMOEngine::stopProcess"; DSPGenerationStop cmd; m_syncMessenger.storeMessage(cmd); handleSynchronousMessages(); @@ -302,6 +302,11 @@ void DSPDeviceMIMOEngine::workSampleSink(unsigned int sinkIndex) { (*it)->feed(vbegin, vend, positiveOnly); } + + // feed data to MIMO channels + for (MIMOChannels::const_iterator it = m_mimoChannels.begin(); it != m_mimoChannels.end(); ++it) { + (*it)->feed(vbegin, vend, sinkIndex); + } } // notStarted -> idle -> init -> running -+ @@ -335,20 +340,41 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoIdle() for (; vbit != m_basebandSampleSinks.end(); ++vbit) { - for (BasebandSampleSinks::const_iterator it = vbit->begin(); it != vbit->end(); ++it) { + for (BasebandSampleSinks::const_iterator it = vbit->begin(); it != vbit->end(); ++it) + { + qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping BasebandSampleSink: " << (*it)->objectName().toStdString().c_str(); (*it)->stop(); } } - std::vector::const_iterator vtit = m_threadedBasebandSampleSinks.begin(); + std::vector::const_iterator vtSinkIt = m_threadedBasebandSampleSinks.begin(); - for (; vtit != m_threadedBasebandSampleSinks.end(); vtit++) + for (; vtSinkIt != m_threadedBasebandSampleSinks.end(); vtSinkIt++) { - for (ThreadedBasebandSampleSinks::const_iterator it = vtit->begin(); it != vtit->end(); ++it) { + for (ThreadedBasebandSampleSinks::const_iterator it = vtSinkIt->begin(); it != vtSinkIt->end(); ++it) + { + qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping ThreadedBasebandSampleSource(" << (*it)->getSampleSinkObjectName().toStdString().c_str() << ")"; (*it)->stop(); } } + std::vector::const_iterator vtSourceIt = m_threadedBasebandSampleSources.begin(); + + for (; vtSourceIt != m_threadedBasebandSampleSources.end(); vtSourceIt++) + { + for (ThreadedBasebandSampleSources::const_iterator it = vtSourceIt->begin(); it != vtSourceIt->end(); ++it) + { + qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping ThreadedBasebandSampleSource(" << (*it)->getSampleSourceObjectName().toStdString().c_str() << ")"; + (*it)->stop(); + } + } + + for (MIMOChannels::const_iterator it = m_mimoChannels.begin(); it != m_mimoChannels.end(); ++it) + { + qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping MIMOChannel: " << (*it)->objectName().toStdString().c_str(); + (*it)->stop(); + } + m_deviceSampleMIMO->stop(); m_deviceDescription.clear(); @@ -381,8 +407,8 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoInit() m_deviceDescription = m_deviceSampleMIMO->getDeviceDescription(); - qDebug() << "DSPDeviceMIMOEngine::gotoInit: " - << " m_deviceDescription: " << m_deviceDescription.toStdString().c_str(); + qDebug() << "DSPDeviceMIMOEngine::gotoInit:" + << "m_deviceDescription: " << m_deviceDescription.toStdString().c_str(); // Rx @@ -466,7 +492,7 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoRunning() return gotoError("DSPDeviceMIMOEngine::gotoRunning: No sample source configured"); } - qDebug() << "DSPDeviceMIMOEngine::gotoRunning: " << m_deviceDescription.toStdString().c_str() << " started"; + qDebug() << "DSPDeviceMIMOEngine::gotoRunning:" << m_deviceDescription.toStdString().c_str() << "started"; // Start everything @@ -480,22 +506,39 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoRunning() { for (BasebandSampleSinks::const_iterator it = vbit->begin(); it != vbit->end(); ++it) { - qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting " << (*it)->objectName().toStdString().c_str(); + qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting BasebandSampleSink: " << (*it)->objectName().toStdString().c_str(); (*it)->start(); } } - std::vector::const_iterator vtit = m_threadedBasebandSampleSinks.begin(); + std::vector::const_iterator vtSinkIt = m_threadedBasebandSampleSinks.begin(); - for (; vtit != m_threadedBasebandSampleSinks.end(); vtit++) + for (; vtSinkIt != m_threadedBasebandSampleSinks.end(); vtSinkIt++) { - for (ThreadedBasebandSampleSinks::const_iterator it = vtit->begin(); it != vtit->end(); ++it) + for (ThreadedBasebandSampleSinks::const_iterator it = vtSinkIt->begin(); it != vtSinkIt->end(); ++it) { - qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting ThreadedSampleSink(" << (*it)->getSampleSinkObjectName().toStdString().c_str() << ")"; + qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting ThreadedBasebandSampleSink(" << (*it)->getSampleSinkObjectName().toStdString().c_str() << ")"; (*it)->start(); } } + std::vector::const_iterator vtSourceIt = m_threadedBasebandSampleSources.begin(); + + for (; vtSourceIt != m_threadedBasebandSampleSources.end(); vtSourceIt++) + { + for (ThreadedBasebandSampleSources::const_iterator it = vtSourceIt->begin(); it != vtSourceIt->end(); ++it) + { + qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting ThreadedBasebandSampleSource(" << (*it)->getSampleSourceObjectName().toStdString().c_str() << ")"; + (*it)->start(); + } + } + + for (MIMOChannels::const_iterator it = m_mimoChannels.begin(); it != m_mimoChannels.end(); ++it) + { + qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting MIMOChannel: " << (*it)->objectName().toStdString().c_str(); + (*it)->start(); + } + qDebug() << "DSPDeviceMIMOEngine::gotoRunning:input message queue pending: " << m_inputMessageQueue.size(); return StRunning;