1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-08 00:44:48 -04:00

Merge pull request #1163 from srcejon/fix_1161

USRPInput - Ensure IQ buffer size is a power of two, as required by decimators
This commit is contained in:
Edouard Griffiths
2022-02-25 10:55:53 +01:00
committed by GitHub
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);