From 2369cb62afc9fd64c0d16c637a63d50428afbe48 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 23 Apr 2017 03:44:19 +0200 Subject: [PATCH] LimeSDR output: handle cross allocation from Rx properly --- .../limesdroutput/limesdroutput.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugins/samplesink/limesdroutput/limesdroutput.cpp b/plugins/samplesink/limesdroutput/limesdroutput.cpp index a30efde15..e6ad2e389 100644 --- a/plugins/samplesink/limesdroutput/limesdroutput.cpp +++ b/plugins/samplesink/limesdroutput/limesdroutput.cpp @@ -131,6 +131,16 @@ bool LimeSDROutput::openDevice() qDebug("LimeSDROutput::openDevice: getting device parameters from Rx buddy"); } + for (int i = 0; i < m_deviceAPI->getSourceBuddies().size(); i++) + { + DeviceSourceAPI *buddy = m_deviceAPI->getSourceBuddies()[i]; + DeviceLimeSDRShared *buddyShared = (DeviceLimeSDRShared *) buddy->getBuddySharedPtr(); + + if (buddyShared->m_thread) { // suspend Rx buddy's thread for proper stream allocation later + buddyShared->m_thread->stopWork(); + } + } + m_deviceShared.m_channel = 0; // take first channel } // There are no buddies then create the first LimeSDR common parameters @@ -191,6 +201,18 @@ bool LimeSDROutput::openDevice() } } + // resume Rx buddy's threads + + for (int i = 0; i < m_deviceAPI->getSourceBuddies().size(); i++) + { + DeviceSourceAPI *buddy = m_deviceAPI->getSourceBuddies()[i]; + DeviceLimeSDRShared *buddyShared = (DeviceLimeSDRShared *) buddy->getBuddySharedPtr(); + + if (buddyShared->m_thread) { // suspend Rx buddy's thread for proper stream allocation later + buddyShared->m_thread->startWork(); + } + } + return true; }