mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 06:04:39 -04:00
LimeSDR: suspend buddy threads only around calls to LMS_SetupStream or LMS_DestroyStream. In output plugin move them back to open/close (undoes #50)
This commit is contained in:
@@ -198,6 +198,9 @@ bool LimeSDRInput::openDevice()
|
||||
m_streamId.isTx = false; //RX channel
|
||||
m_streamId.dataFmt = lms_stream_t::LMS_FMT_I12; //12-bit integers
|
||||
|
||||
suspendRxBuddies();
|
||||
suspendTxBuddies();
|
||||
|
||||
if (LMS_SetupStream(m_deviceShared.m_deviceParams->getDevice(), &m_streamId) != 0)
|
||||
{
|
||||
qCritical("LimeSDRInput::start: cannot setup the stream on Rx channel %d", m_deviceShared.m_channel);
|
||||
@@ -208,6 +211,9 @@ bool LimeSDRInput::openDevice()
|
||||
qDebug("LimeSDRInput::start: stream set up on Rx channel %d", m_deviceShared.m_channel);
|
||||
}
|
||||
|
||||
resumeTxBuddies();
|
||||
resumeRxBuddies();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -290,10 +296,16 @@ void LimeSDRInput::closeDevice()
|
||||
|
||||
if (m_running) { stop(); }
|
||||
|
||||
suspendRxBuddies();
|
||||
suspendTxBuddies();
|
||||
|
||||
// destroy the stream
|
||||
LMS_DestroyStream(m_deviceShared.m_deviceParams->getDevice(), &m_streamId);
|
||||
m_streamId.handle = 0;
|
||||
|
||||
resumeTxBuddies();
|
||||
resumeRxBuddies();
|
||||
|
||||
// release the channel
|
||||
|
||||
if (LMS_EnableChannel(m_deviceShared.m_deviceParams->getDevice(), LMS_CH_RX, m_deviceShared.m_channel, false) != 0)
|
||||
|
||||
Reference in New Issue
Block a user