From f656ba53cd6ad89d583f39a982390504a1ec6a94 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 12 Mar 2019 15:28:07 +0100 Subject: Lime: do not check fifoFilledCount before sending --- src/output/Lime.cpp | 13 +------------ src/output/Lime.h | 3 +++ 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/output/Lime.cpp b/src/output/Lime.cpp index 7aa7d67..3a5f893 100644 --- a/src/output/Lime.cpp +++ b/src/output/Lime.cpp @@ -378,18 +378,7 @@ void Lime::transmit_frame(const struct FrameData &frame) etiLog.level(info) << "overrun" << LimeStatus.overrun << "underun" << LimeStatus.underrun << "drop" << LimeStatus.droppedPackets; #endif - /* if(LimeStatus.fifoFilledCount>LimeStatus.fifoSize-2*FRAME_LENGTH*m_interpolate) // Drop if Fifo is just 2 frames before fullness - { - etiLog.level(info) << "Fifo overflow : drop"; - return; - }*/ - - // Wait if Fifo is just 2 frames before fullness - if (LimeStatus.fifoFilledCount < FRAME_LENGTH * 2 * m_interpolate) { - etiLog.level(info) << "Fifo underflow : duplicate for filling garbage"; - for (size_t i = 0; i < m_interpolate * 10; i++) - LMS_SendStream(&m_tx_stream, buf, numSamples, NULL, 1000); - } + m_last_fifo_filled_count.store(LimeStatus.fifoFilledCount); /* if(LimeStatus.fifoFilledCount>=5*FRAME_LENGTH*m_interpolate) // Start if FIFO is half full { diff --git a/src/output/Lime.h b/src/output/Lime.h index 89f3b7e..8658053 100644 --- a/src/output/Lime.h +++ b/src/output/Lime.h @@ -39,6 +39,7 @@ DESCRIPTION: #ifdef HAVE_LIMESDR +#include #include #include @@ -90,6 +91,8 @@ class Lime : public Output::SDRDevice size_t m_interpolate = 1; std::vector interpolatebuf; + std::atomic m_last_fifo_filled_count = ATOMIC_VAR_INIT(0); + size_t underflows = 0; size_t overflows = 0; size_t late_packets = 0; -- cgit v1.2.3