oe1rsa
27 September 2025 15:33
1
In classic LimeSuite it was possible to set the fifo size via the lms_stream_t struct. Using an appropriate size I was able to get a steady received packets stream whit no package drops at 4MHz Sampling rate.
Now with LimeSuiteNG I get a lot of missing packets with the very same HW setup and no idea how to tweak the FIFO size.
How shoud I deal with this case. Any ideas welcome.
Regards, Roland
LimeSuiteNG automatically sets up FIFO sizes based on sampling rates, to hold maximum of 250ms of data
mRxArgs.bufferSize = dmaBufferSize;
mRxArgs.packetSize = packetSize;
mRxArgs.packetsToBatch = mRx.packetsToBatch;
mRxArgs.samplesInPacket = mRx.samplesInPkt;
assert(mRxArgs.bufferSize > 0);
assert(mRxArgs.packetSize > 0);
assert(mRxArgs.packetsToBatch > 0);
assert(mRxArgs.samplesInPacket > 0);
const int packetsInFIFO = 0.25 * mConfig.hintSampleRate / mRx.samplesInPkt; // buffer 0.25 second of data
mRx.packetsPool = std::make_unique<PacketsFIFO<StreamPacket*>>(packetsInFIFO);
const uint32_t userSampleSize = mConfig.format == DataFormat::F32 ? sizeof(lime::complex32f_t) : sizeof(lime::complex16_t);
for (uint32_t i = 0; i < mRx.packetsPool->max_size(); ++i)
mRx.packetsPool->push(new StreamPacket(mRx.samplesInPkt, chCount, userSampleSize));
mRx.fifo = std::make_unique<PacketsFIFO<StreamPacket*>>(packetsInFIFO);
char msg[256];
std::snprintf(msg,
sizeof(msg),
"%s Rx%i Setup: usePoll:%i rxSamplesInPkt:%i rxPacketsInBatch:%i, DMA_ReadSize:%i, link:%s, batchSizeInTime:%gus FS:%f, "
chipId,
mTx.samplesInPkt,
mTx.packetsToBatch,
bufferTimeDuration * 1e6);
if (showStats)
printf("%s\n", msg);
if (mCallback_logMessage)
mCallback_logMessage(LogLevel::Verbose, msg);
}
const int packetsInFIFO = 0.25 * mConfig.hintSampleRate / (mTx.packetsToBatch * mTx.samplesInPkt); // buffer 0.25 second of data
mTx.packetsPool = std::make_unique<PacketsFIFO<StreamPacket*>>(packetsInFIFO);
const uint32_t userSampleSize = mConfig.format == DataFormat::F32 ? sizeof(lime::complex32f_t) : sizeof(lime::complex16_t);
for (uint32_t i = 0; i < mTx.packetsPool->max_size(); ++i)
mTx.packetsPool->push(new StreamPacket(mTx.packetsToBatch * mTx.samplesInPkt, chCount, userSampleSize));
mTx.fifo = std::make_unique<PacketsFIFO<StreamPacket*>>(packetsInFIFO);
mTx.terminate.store(false, std::memory_order_relaxed);
mTx.terminateWorker.store(false, std::memory_order_relaxed);
auto TxLoopFunction = std::bind(&TRXLooper::TxWorkLoop, this);
and aim for data latency of ~100us: LimeSuiteNG/src/streaming/TRXLooper.cpp at 33d5a94c4e3962b6ea1b5d9677a250f796e1658f · myriadrf/LimeSuiteNG · GitHub
The software performance difference between legacy LimeSuite and LimeSuiteNG is fixed now: LimeMini Maximum stable USB3 Rate? - #6 by ricardas