1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

LimeSDR output: used fixed time length with minimum length for sample FIFO

This commit is contained in:
f4exb 2017-08-08 00:25:13 +02:00
parent ea4cb1bbfd
commit 3a84cd8526
3 changed files with 17 additions and 1 deletions

View File

@ -18,3 +18,6 @@
MESSAGE_CLASS_DEFINITION(DeviceLimeSDRShared::MsgCrossReportToGUI, Message)
MESSAGE_CLASS_DEFINITION(DeviceLimeSDRShared::MsgReportDeviceInfo, Message)
const float DeviceLimeSDRShared::m_sampleFifoLengthInSeconds = 0.25;
const int DeviceLimeSDRShared::m_sampleFifoMinSize = 48000;

View File

@ -82,6 +82,9 @@ public:
uint64_t m_centerFrequency;
uint32_t m_log2Soft;
static const float m_sampleFifoLengthInSeconds;
static const int m_sampleFifoMinSize;
DeviceLimeSDRShared() :
m_deviceParams(0),
m_channel(-1),

View File

@ -505,7 +505,8 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
(m_settings.m_lpfFIRBW != settings.m_lpfFIRBW) ||
(m_settings.m_lpfFIREnable != settings.m_lpfFIREnable) ||
(m_settings.m_ncoEnable != settings.m_ncoEnable) ||
(m_settings.m_ncoFrequency != settings.m_ncoFrequency) || force)
(m_settings.m_ncoFrequency != settings.m_ncoFrequency) ||
(m_settings.m_log2SoftInterp != settings.m_log2SoftInterp) || force)
{
suspendOwnThread = true;
}
@ -618,6 +619,15 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
}
}
if ((m_settings.m_devSampleRate != settings.m_devSampleRate)
|| (m_settings.m_log2SoftInterp != settings.m_log2SoftInterp) || force)
{
int fifoSize = std::max(
(int) ((settings.m_devSampleRate/(1<<settings.m_log2SoftInterp)) * DeviceLimeSDRShared::m_sampleFifoLengthInSeconds),
DeviceLimeSDRShared::m_sampleFifoMinSize);
m_sampleSourceFifo.resize(fifoSize);
}
if ((m_settings.m_lpfBW != settings.m_lpfBW) || force)
{
if (m_deviceShared.m_deviceParams->getDevice() != 0)