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

HackRF output: set FIFO size to 0.25s or 150 kS whichever is larger (600kS/s knee)

This commit is contained in:
f4exb 2017-08-08 22:37:53 +02:00
parent 7b851e8326
commit 3a9eec8463
4 changed files with 11 additions and 8 deletions

View File

@ -18,4 +18,5 @@
MESSAGE_CLASS_DEFINITION(DeviceHackRFShared::MsgConfigureFrequencyDelta, Message)
const float DeviceHackRFShared::m_sampleFifoLengthInSeconds = 0.25;
const int DeviceHackRFShared::m_sampleFifoMinSize = 150000; // 600kS/s knee

View File

@ -42,6 +42,9 @@ public:
m_frequencyDelta(frequencyDelta)
{ }
};
static const float m_sampleFifoLengthInSeconds;
static const int m_sampleFifoMinSize;
};

View File

@ -20,4 +20,4 @@ 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;
const int DeviceLimeSDRShared::m_sampleFifoMinSize = 48000; // 192kS/s knee

View File

@ -25,7 +25,7 @@
#include "dsp/dspengine.h"
#include "device/devicesourceapi.h"
#include "device/devicesinkapi.h"
#include "hackrf/devicehackrfshared.h"
#include "hackrfoutputgui.h"
#include "hackrfoutputthread.h"
@ -242,11 +242,10 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || (m_settings.m_log2Interp != settings.m_log2Interp) || force)
{
forwardChange = true;
// FIFO size:
// 1 s length up to interpolation by 16
// 2 s for interpolation by 32
m_sampleSourceFifo.resize(settings.m_devSampleRate/(1<<(settings.m_log2Interp <= 4 ? settings.m_log2Interp : 4)));
int fifoSize = std::max(
(int) ((settings.m_devSampleRate/(1<<settings.m_log2Interp)) * DeviceHackRFShared::m_sampleFifoLengthInSeconds),
DeviceHackRFShared::m_sampleFifoMinSize);
m_sampleSourceFifo.resize(fifoSize);
}
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || force)