1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 13:47:01 -04:00

Ensure IQ buffer size is a power of two, as required by decimators

This commit is contained in:
Jon Beniston
2022-02-24 16:27:32 +00:00
parent 113aff6e57
commit ffe96cbf63
2 changed files with 47 additions and 1 deletions
+5 -1
View File
@@ -35,6 +35,7 @@
#include "device/deviceapi.h"
#include "dsp/dspcommands.h"
#include "dsp/dspengine.h"
#include "util/poweroftwo.h"
#include "usrpinput.h"
#include "usrpinputthread.h"
#include "usrp/deviceusrpparam.h"
@@ -338,8 +339,11 @@ bool USRPInput::acquireChannel()
m_streamId = m_deviceShared.m_deviceParams->getDevice()->get_rx_stream(stream_args);
// Match our receive buffer size to what UHD uses
// Decimators require buffers to sized as powers of two (See #1161)
m_bufSamples = m_streamId->get_max_num_samps();
if (!isPowerOfTwo(m_bufSamples)) {
m_bufSamples = lowerPowerOfTwo(m_bufSamples);
}
// Wait for reference and LO to lock
DeviceUSRP::waitForLock(usrp, m_settings.m_clockSource, m_deviceShared.m_channel);