From f4f9a742697582f6d16d5d1b838f55e3e1527c04 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 27 Aug 2015 08:31:02 +0200 Subject: [PATCH] Deep redesign: Changed Funcube read block from 8192 to 2048 bytes to fix fluidity problem --- plugins/samplesource/fcd/fcdinput.cpp | 2 +- plugins/samplesource/fcd/fcdthread.cpp | 4 ++-- plugins/samplesource/fcd/fcdthread.h | 2 +- plugins/samplesource/rtlsdr/rtlsdrthread.cpp | 6 +++--- plugins/samplesource/v4l-msi/v4lthread.cpp | 4 ++-- plugins/samplesource/v4l-msi/v4lthread.h | 2 +- plugins/samplesource/v4l-rtl/v4lthread.cpp | 4 ++-- plugins/samplesource/v4l-rtl/v4lthread.h | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/samplesource/fcd/fcdinput.cpp b/plugins/samplesource/fcd/fcdinput.cpp index 260531a4c..b9075b26a 100644 --- a/plugins/samplesource/fcd/fcdinput.cpp +++ b/plugins/samplesource/fcd/fcdinput.cpp @@ -105,7 +105,7 @@ bool FCDInput::start(int device) applySettings(m_settings, true); - if(!m_sampleFifo.setSize(4096*16)) + if(!m_sampleFifo.setSize(96000*4)) { qCritical("Could not allocate SampleFifo"); return false; diff --git a/plugins/samplesource/fcd/fcdthread.cpp b/plugins/samplesource/fcd/fcdthread.cpp index 46167d6b3..95f87ab0e 100644 --- a/plugins/samplesource/fcd/fcdthread.cpp +++ b/plugins/samplesource/fcd/fcdthread.cpp @@ -24,7 +24,7 @@ FCDThread::FCDThread(SampleFifo* sampleFifo, QObject* parent) : QThread(parent), fcd_handle(NULL), m_running(false), - m_convertBuffer(BLOCKSIZE), + m_convertBuffer(FCD_BLOCKSIZE), m_sampleFifo(sampleFifo) { start(); @@ -48,7 +48,7 @@ void FCDThread::run() m_running = true; while(m_running) { - if ( work(BLOCKSIZE) < 0) + if ( work(FCD_BLOCKSIZE) < 0) break; } CloseSource(); diff --git a/plugins/samplesource/fcd/fcdthread.h b/plugins/samplesource/fcd/fcdthread.h index b993d2296..dc7e4530d 100644 --- a/plugins/samplesource/fcd/fcdthread.h +++ b/plugins/samplesource/fcd/fcdthread.h @@ -26,7 +26,7 @@ #include #define FCDPP_RATE 192000 // FIXME: The Pro / Pro+ switch should be handled better than this! -#define BLOCKSIZE 8192 +#define FCD_BLOCKSIZE (1<<11) class FCDThread : public QThread { Q_OBJECT diff --git a/plugins/samplesource/rtlsdr/rtlsdrthread.cpp b/plugins/samplesource/rtlsdr/rtlsdrthread.cpp index 7dc6269f9..051b179a4 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrthread.cpp +++ b/plugins/samplesource/rtlsdr/rtlsdrthread.cpp @@ -20,13 +20,13 @@ #include "rtlsdrthread.h" #include "dsp/samplefifo.h" -#define BLOCKSIZE 16384 +#define FCD_BLOCKSIZE 16384 RTLSDRThread::RTLSDRThread(rtlsdr_dev_t* dev, SampleFifo* sampleFifo, QObject* parent) : QThread(parent), m_running(false), m_dev(dev), - m_convertBuffer(BLOCKSIZE), + m_convertBuffer(FCD_BLOCKSIZE), m_sampleFifo(sampleFifo), m_samplerate(288000), m_log2Decim(4) @@ -71,7 +71,7 @@ void RTLSDRThread::run() m_startWaiter.wakeAll(); while(m_running) { - if((res = rtlsdr_read_async(m_dev, &RTLSDRThread::callbackHelper, this, 32, BLOCKSIZE)) < 0) { + if((res = rtlsdr_read_async(m_dev, &RTLSDRThread::callbackHelper, this, 32, FCD_BLOCKSIZE)) < 0) { qCritical("RTLSDRThread: async error: %s", strerror(errno)); break; } diff --git a/plugins/samplesource/v4l-msi/v4lthread.cpp b/plugins/samplesource/v4l-msi/v4lthread.cpp index 57f517560..76a9e980a 100644 --- a/plugins/samplesource/v4l-msi/v4lthread.cpp +++ b/plugins/samplesource/v4l-msi/v4lthread.cpp @@ -23,7 +23,7 @@ V4LThread::V4LThread(SampleFifo* sampleFifo, double frequency, QObject* parent) : QThread(parent), m_running(false), - m_convertBuffer(BLOCKSIZE), + m_convertBuffer(FCD_BLOCKSIZE), m_sampleFifo(sampleFifo) { centerFreq = frequency; @@ -48,7 +48,7 @@ void V4LThread::run() return; while(m_running) { - work(BLOCKSIZE); + work(FCD_BLOCKSIZE); } CloseSource(); } diff --git a/plugins/samplesource/v4l-msi/v4lthread.h b/plugins/samplesource/v4l-msi/v4lthread.h index 834e98460..bcf3c6bcc 100644 --- a/plugins/samplesource/v4l-msi/v4lthread.h +++ b/plugins/samplesource/v4l-msi/v4lthread.h @@ -27,7 +27,7 @@ // lowest samplerate in the kernel is 1.2M, but this works better #define SAMPLERATE 1536000 #define IF_BANDWIDTH 300000 -#define BLOCKSIZE 8192 +#define FCD_BLOCKSIZE 8192 class V4LThread : public QThread { Q_OBJECT diff --git a/plugins/samplesource/v4l-rtl/v4lthread.cpp b/plugins/samplesource/v4l-rtl/v4lthread.cpp index 57f517560..76a9e980a 100644 --- a/plugins/samplesource/v4l-rtl/v4lthread.cpp +++ b/plugins/samplesource/v4l-rtl/v4lthread.cpp @@ -23,7 +23,7 @@ V4LThread::V4LThread(SampleFifo* sampleFifo, double frequency, QObject* parent) : QThread(parent), m_running(false), - m_convertBuffer(BLOCKSIZE), + m_convertBuffer(FCD_BLOCKSIZE), m_sampleFifo(sampleFifo) { centerFreq = frequency; @@ -48,7 +48,7 @@ void V4LThread::run() return; while(m_running) { - work(BLOCKSIZE); + work(FCD_BLOCKSIZE); } CloseSource(); } diff --git a/plugins/samplesource/v4l-rtl/v4lthread.h b/plugins/samplesource/v4l-rtl/v4lthread.h index cf4318761..ad7d859ea 100644 --- a/plugins/samplesource/v4l-rtl/v4lthread.h +++ b/plugins/samplesource/v4l-rtl/v4lthread.h @@ -25,7 +25,7 @@ #include "dsp/inthalfbandfilter.h" #define SAMPLERATE 1024000 -#define BLOCKSIZE 4096 +#define FCD_BLOCKSIZE 4096 class V4LThread : public QThread { Q_OBJECT