mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-23 18:52:28 -04:00
Renamed SampleSourceFifo to SampleSourceFifoDB to mark double buffered nature of FIFO
This commit is contained in:
parent
5bc6b7e702
commit
e6a929470f
@ -14431,7 +14431,7 @@
|
|||||||
"height": 13,
|
"height": 13,
|
||||||
"autoResize": false,
|
"autoResize": false,
|
||||||
"underline": false,
|
"underline": false,
|
||||||
"text": "SampleSourceFifo",
|
"text": "SampleSourceFifoDB",
|
||||||
"horizontalAlignment": 2,
|
"horizontalAlignment": 2,
|
||||||
"verticalAlignment": 5
|
"verticalAlignment": 5
|
||||||
},
|
},
|
||||||
@ -29096,7 +29096,7 @@
|
|||||||
"height": 13,
|
"height": 13,
|
||||||
"autoResize": false,
|
"autoResize": false,
|
||||||
"underline": false,
|
"underline": false,
|
||||||
"text": "Lifeline2: SampleSourceFifo",
|
"text": "Lifeline2: SampleSourceFifoDB",
|
||||||
"horizontalAlignment": 2,
|
"horizontalAlignment": 2,
|
||||||
"verticalAlignment": 5
|
"verticalAlignment": 5
|
||||||
},
|
},
|
||||||
@ -31908,7 +31908,7 @@
|
|||||||
"_parent": {
|
"_parent": {
|
||||||
"$ref": "AAAAAAFQXc4WXZjpioY="
|
"$ref": "AAAAAAFQXc4WXZjpioY="
|
||||||
},
|
},
|
||||||
"name": "SampleSourceFifo",
|
"name": "SampleSourceFifoDB",
|
||||||
"visibility": "public",
|
"visibility": "public",
|
||||||
"operations": [
|
"operations": [
|
||||||
{
|
{
|
||||||
|
@ -172,7 +172,7 @@ private:
|
|||||||
|
|
||||||
LocalSourceSettings m_settings;
|
LocalSourceSettings m_settings;
|
||||||
LocalSourceThread *m_sinkThread;
|
LocalSourceThread *m_sinkThread;
|
||||||
SampleSourceFifo *m_localSampleSourceFifo;
|
SampleSourceFifoDB *m_localSampleSourceFifo;
|
||||||
int m_chunkSize;
|
int m_chunkSize;
|
||||||
SampleVector m_localSamples;
|
SampleVector m_localSamples;
|
||||||
int m_localSamplesIndex;
|
int m_localSamplesIndex;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
|
|
||||||
#include "localsourcethread.h"
|
#include "localsourcethread.h"
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ void LocalSourceThread::startStop(bool start)
|
|||||||
m_inputMessageQueue.push(msg);
|
m_inputMessageQueue.push(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalSourceThread::setSampleFifo(SampleSourceFifo *sampleFifo)
|
void LocalSourceThread::setSampleFifo(SampleSourceFifoDB *sampleFifo)
|
||||||
{
|
{
|
||||||
m_sampleFifo = sampleFifo;
|
m_sampleFifo = sampleFifo;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "util/message.h"
|
#include "util/message.h"
|
||||||
#include "util/messagequeue.h"
|
#include "util/messagequeue.h"
|
||||||
|
|
||||||
class SampleSourceFifo;
|
class SampleSourceFifoDB;
|
||||||
|
|
||||||
class LocalSourceThread : public QThread {
|
class LocalSourceThread : public QThread {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -55,7 +55,7 @@ public:
|
|||||||
~LocalSourceThread();
|
~LocalSourceThread();
|
||||||
|
|
||||||
void startStop(bool start);
|
void startStop(bool start);
|
||||||
void setSampleFifo(SampleSourceFifo *sampleFifo);
|
void setSampleFifo(SampleSourceFifoDB *sampleFifo);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void pullSamples(unsigned int count);
|
void pullSamples(unsigned int count);
|
||||||
@ -67,7 +67,7 @@ private:
|
|||||||
QMutex m_startWaitMutex;
|
QMutex m_startWaitMutex;
|
||||||
QWaitCondition m_startWaiter;
|
QWaitCondition m_startWaiter;
|
||||||
volatile bool m_running;
|
volatile bool m_running;
|
||||||
SampleSourceFifo *m_sampleFifo;
|
SampleSourceFifoDB *m_sampleFifo;
|
||||||
|
|
||||||
MessageQueue m_inputMessageQueue;
|
MessageQueue m_inputMessageQueue;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Bladerf1OutputThread::Bladerf1OutputThread(struct bladerf* dev, SampleSourceFifo* sampleFifo, QObject* parent) :
|
Bladerf1OutputThread::Bladerf1OutputThread(struct bladerf* dev, SampleSourceFifoDB* sampleFifo, QObject* parent) :
|
||||||
QThread(parent),
|
QThread(parent),
|
||||||
m_running(false),
|
m_running(false),
|
||||||
m_dev(dev),
|
m_dev(dev),
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QWaitCondition>
|
#include <QWaitCondition>
|
||||||
#include <libbladeRF.h>
|
#include <libbladeRF.h>
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
#include "dsp/interpolators.h"
|
#include "dsp/interpolators.h"
|
||||||
|
|
||||||
#define BLADERFOUTPUT_BLOCKSIZE (1<<16)
|
#define BLADERFOUTPUT_BLOCKSIZE (1<<16)
|
||||||
@ -31,7 +31,7 @@ class Bladerf1OutputThread : public QThread {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Bladerf1OutputThread(struct bladerf* dev, SampleSourceFifo* sampleFifo, QObject* parent = NULL);
|
Bladerf1OutputThread(struct bladerf* dev, SampleSourceFifoDB* sampleFifo, QObject* parent = NULL);
|
||||||
~Bladerf1OutputThread();
|
~Bladerf1OutputThread();
|
||||||
|
|
||||||
void startWork();
|
void startWork();
|
||||||
@ -46,7 +46,7 @@ private:
|
|||||||
|
|
||||||
struct bladerf* m_dev;
|
struct bladerf* m_dev;
|
||||||
qint16 m_buf[2*BLADERFOUTPUT_BLOCKSIZE];
|
qint16 m_buf[2*BLADERFOUTPUT_BLOCKSIZE];
|
||||||
SampleSourceFifo* m_sampleFifo;
|
SampleSourceFifoDB* m_sampleFifo;
|
||||||
|
|
||||||
unsigned int m_log2Interp;
|
unsigned int m_log2Interp;
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ bool BladeRF2Output::start()
|
|||||||
{
|
{
|
||||||
qDebug("BladeRF2Output::start: expand channels. Re-allocate thread and take ownership");
|
qDebug("BladeRF2Output::start: expand channels. Re-allocate thread and take ownership");
|
||||||
|
|
||||||
SampleSourceFifo **fifos = new SampleSourceFifo*[nbOriginalChannels];
|
SampleSourceFifoDB **fifos = new SampleSourceFifoDB*[nbOriginalChannels];
|
||||||
unsigned int *log2Interps = new unsigned int[nbOriginalChannels];
|
unsigned int *log2Interps = new unsigned int[nbOriginalChannels];
|
||||||
|
|
||||||
for (int i = 0; i < nbOriginalChannels; i++) // save original FIFO references and data
|
for (int i = 0; i < nbOriginalChannels; i++) // save original FIFO references and data
|
||||||
@ -407,7 +407,7 @@ void BladeRF2Output::stop()
|
|||||||
{
|
{
|
||||||
qDebug("BladeRF2Output::stop: MO mode. Reduce by deleting and re-creating the thread");
|
qDebug("BladeRF2Output::stop: MO mode. Reduce by deleting and re-creating the thread");
|
||||||
bladeRF2OutputThread->stopWork();
|
bladeRF2OutputThread->stopWork();
|
||||||
SampleSourceFifo **fifos = new SampleSourceFifo*[nbOriginalChannels-1];
|
SampleSourceFifoDB **fifos = new SampleSourceFifoDB*[nbOriginalChannels-1];
|
||||||
unsigned int *log2Interps = new unsigned int[nbOriginalChannels-1];
|
unsigned int *log2Interps = new unsigned int[nbOriginalChannels-1];
|
||||||
bool stillActiveFIFO = false;
|
bool stillActiveFIFO = false;
|
||||||
|
|
||||||
@ -714,7 +714,7 @@ bool BladeRF2Output::applySettings(const BladeRF2OutputSettings& settings, bool
|
|||||||
{
|
{
|
||||||
reverseAPIKeys.append("devSampleRate");
|
reverseAPIKeys.append("devSampleRate");
|
||||||
BladeRF2OutputThread *bladeRF2OutputThread = findThread();
|
BladeRF2OutputThread *bladeRF2OutputThread = findThread();
|
||||||
SampleSourceFifo *fifo = 0;
|
SampleSourceFifoDB *fifo = 0;
|
||||||
|
|
||||||
if (bladeRF2OutputThread)
|
if (bladeRF2OutputThread)
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
|
|
||||||
#include "bladerf2outputthread.h"
|
#include "bladerf2outputthread.h"
|
||||||
|
|
||||||
@ -151,14 +151,14 @@ unsigned int BladeRF2OutputThread::getLog2Interpolation(unsigned int channel) co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BladeRF2OutputThread::setFifo(unsigned int channel, SampleSourceFifo *sampleFifo)
|
void BladeRF2OutputThread::setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo)
|
||||||
{
|
{
|
||||||
if (channel < m_nbChannels) {
|
if (channel < m_nbChannels) {
|
||||||
m_channels[channel].m_sampleFifo = sampleFifo;
|
m_channels[channel].m_sampleFifo = sampleFifo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SampleSourceFifo *BladeRF2OutputThread::getFifo(unsigned int channel)
|
SampleSourceFifoDB *BladeRF2OutputThread::getFifo(unsigned int channel)
|
||||||
{
|
{
|
||||||
if (channel < m_nbChannels) {
|
if (channel < m_nbChannels) {
|
||||||
return m_channels[channel].m_sampleFifo;
|
return m_channels[channel].m_sampleFifo;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "bladerf2/devicebladerf2shared.h"
|
#include "bladerf2/devicebladerf2shared.h"
|
||||||
#include "dsp/interpolators.h"
|
#include "dsp/interpolators.h"
|
||||||
|
|
||||||
class SampleSourceFifo;
|
class SampleSourceFifoDB;
|
||||||
|
|
||||||
class BladeRF2OutputThread : public QThread {
|
class BladeRF2OutputThread : public QThread {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -41,13 +41,13 @@ public:
|
|||||||
unsigned int getNbChannels() const { return m_nbChannels; }
|
unsigned int getNbChannels() const { return m_nbChannels; }
|
||||||
void setLog2Interpolation(unsigned int channel, unsigned int log2_interp);
|
void setLog2Interpolation(unsigned int channel, unsigned int log2_interp);
|
||||||
unsigned int getLog2Interpolation(unsigned int channel) const;
|
unsigned int getLog2Interpolation(unsigned int channel) const;
|
||||||
void setFifo(unsigned int channel, SampleSourceFifo *sampleFifo);
|
void setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo);
|
||||||
SampleSourceFifo *getFifo(unsigned int channel);
|
SampleSourceFifoDB *getFifo(unsigned int channel);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Channel
|
struct Channel
|
||||||
{
|
{
|
||||||
SampleSourceFifo* m_sampleFifo;
|
SampleSourceFifoDB* m_sampleFifo;
|
||||||
unsigned int m_log2Interp;
|
unsigned int m_log2Interp;
|
||||||
Interpolators<qint16, SDR_TX_SAMP_SZ, 12> m_interpolators;
|
Interpolators<qint16, SDR_TX_SAMP_SZ, 12> m_interpolators;
|
||||||
|
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
#include "filesinkthread.h"
|
#include "filesinkthread.h"
|
||||||
|
|
||||||
FileSinkThread::FileSinkThread(std::ofstream *samplesStream, SampleSourceFifo* sampleFifo, QObject* parent) :
|
FileSinkThread::FileSinkThread(std::ofstream *samplesStream, SampleSourceFifoDB* sampleFifo, QObject* parent) :
|
||||||
QThread(parent),
|
QThread(parent),
|
||||||
m_running(false),
|
m_running(false),
|
||||||
m_ofstream(samplesStream),
|
m_ofstream(samplesStream),
|
||||||
|
@ -33,13 +33,13 @@
|
|||||||
|
|
||||||
#define FILESINK_THROTTLE_MS 50
|
#define FILESINK_THROTTLE_MS 50
|
||||||
|
|
||||||
class SampleSourceFifo;
|
class SampleSourceFifoDB;
|
||||||
|
|
||||||
class FileSinkThread : public QThread {
|
class FileSinkThread : public QThread {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FileSinkThread(std::ofstream *samplesStream, SampleSourceFifo* sampleFifo, QObject* parent = 0);
|
FileSinkThread(std::ofstream *samplesStream, SampleSourceFifoDB* sampleFifo, QObject* parent = 0);
|
||||||
~FileSinkThread();
|
~FileSinkThread();
|
||||||
|
|
||||||
void startWork();
|
void startWork();
|
||||||
@ -61,7 +61,7 @@ private:
|
|||||||
std::ofstream* m_ofstream;
|
std::ofstream* m_ofstream;
|
||||||
std::size_t m_bufsize;
|
std::size_t m_bufsize;
|
||||||
unsigned int m_samplesChunkSize;
|
unsigned int m_samplesChunkSize;
|
||||||
SampleSourceFifo* m_sampleFifo;
|
SampleSourceFifoDB* m_sampleFifo;
|
||||||
std::size_t m_samplesCount;
|
std::size_t m_samplesCount;
|
||||||
|
|
||||||
int m_samplerate;
|
int m_samplerate;
|
||||||
|
@ -20,9 +20,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
|
|
||||||
HackRFOutputThread::HackRFOutputThread(hackrf_device* dev, SampleSourceFifo* sampleFifo, QObject* parent) :
|
HackRFOutputThread::HackRFOutputThread(hackrf_device* dev, SampleSourceFifoDB* sampleFifo, QObject* parent) :
|
||||||
QThread(parent),
|
QThread(parent),
|
||||||
m_running(false),
|
m_running(false),
|
||||||
m_dev(dev),
|
m_dev(dev),
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <QWaitCondition>
|
#include <QWaitCondition>
|
||||||
#include <libhackrf/hackrf.h>
|
#include <libhackrf/hackrf.h>
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
#include "dsp/interpolators.h"
|
#include "dsp/interpolators.h"
|
||||||
|
|
||||||
#define HACKRF_BLOCKSIZE (1<<17)
|
#define HACKRF_BLOCKSIZE (1<<17)
|
||||||
@ -32,7 +32,7 @@ class HackRFOutputThread : public QThread {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HackRFOutputThread(hackrf_device* dev, SampleSourceFifo* sampleFifo, QObject* parent = NULL);
|
HackRFOutputThread(hackrf_device* dev, SampleSourceFifoDB* sampleFifo, QObject* parent = NULL);
|
||||||
~HackRFOutputThread();
|
~HackRFOutputThread();
|
||||||
|
|
||||||
void startWork();
|
void startWork();
|
||||||
@ -47,7 +47,7 @@ private:
|
|||||||
|
|
||||||
hackrf_device* m_dev;
|
hackrf_device* m_dev;
|
||||||
qint8 m_buf[2*HACKRF_BLOCKSIZE];
|
qint8 m_buf[2*HACKRF_BLOCKSIZE];
|
||||||
SampleSourceFifo* m_sampleFifo;
|
SampleSourceFifoDB* m_sampleFifo;
|
||||||
|
|
||||||
unsigned int m_log2Interp;
|
unsigned int m_log2Interp;
|
||||||
int m_fcPos;
|
int m_fcPos;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "limesdroutputthread.h"
|
#include "limesdroutputthread.h"
|
||||||
#include "limesdroutputsettings.h"
|
#include "limesdroutputsettings.h"
|
||||||
|
|
||||||
LimeSDROutputThread::LimeSDROutputThread(lms_stream_t* stream, SampleSourceFifo* sampleFifo, QObject* parent) :
|
LimeSDROutputThread::LimeSDROutputThread(lms_stream_t* stream, SampleSourceFifoDB* sampleFifo, QObject* parent) :
|
||||||
QThread(parent),
|
QThread(parent),
|
||||||
m_running(false),
|
m_running(false),
|
||||||
m_stream(stream),
|
m_stream(stream),
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "lime/LimeSuite.h"
|
#include "lime/LimeSuite.h"
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
#include "dsp/interpolators.h"
|
#include "dsp/interpolators.h"
|
||||||
#include "limesdr/devicelimesdrshared.h"
|
#include "limesdr/devicelimesdrshared.h"
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ class LimeSDROutputThread : public QThread, public DeviceLimeSDRShared::ThreadIn
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LimeSDROutputThread(lms_stream_t* stream, SampleSourceFifo* sampleFifo, QObject* parent = 0);
|
LimeSDROutputThread(lms_stream_t* stream, SampleSourceFifoDB* sampleFifo, QObject* parent = 0);
|
||||||
~LimeSDROutputThread();
|
~LimeSDROutputThread();
|
||||||
|
|
||||||
virtual void startWork();
|
virtual void startWork();
|
||||||
@ -51,7 +51,7 @@ private:
|
|||||||
|
|
||||||
lms_stream_t* m_stream;
|
lms_stream_t* m_stream;
|
||||||
qint16 m_buf[2*LIMESDROUTPUT_BLOCKSIZE]; //must hold I+Q values of each sample hence 2xcomplex size
|
qint16 m_buf[2*LIMESDROUTPUT_BLOCKSIZE]; //must hold I+Q values of each sample hence 2xcomplex size
|
||||||
SampleSourceFifo* m_sampleFifo;
|
SampleSourceFifoDB* m_sampleFifo;
|
||||||
|
|
||||||
unsigned int m_log2Interp; // soft decimation
|
unsigned int m_log2Interp; // soft decimation
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "iio.h"
|
#include "iio.h"
|
||||||
#include "plutosdroutputthread.h"
|
#include "plutosdroutputthread.h"
|
||||||
|
|
||||||
PlutoSDROutputThread::PlutoSDROutputThread(uint32_t blocksizeSamples, DevicePlutoSDRBox* plutoBox, SampleSourceFifo* sampleFifo, QObject* parent) :
|
PlutoSDROutputThread::PlutoSDROutputThread(uint32_t blocksizeSamples, DevicePlutoSDRBox* plutoBox, SampleSourceFifoDB* sampleFifo, QObject* parent) :
|
||||||
QThread(parent),
|
QThread(parent),
|
||||||
m_running(false),
|
m_running(false),
|
||||||
m_plutoBox(plutoBox),
|
m_plutoBox(plutoBox),
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QWaitCondition>
|
#include <QWaitCondition>
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
#include "dsp/interpolators.h"
|
#include "dsp/interpolators.h"
|
||||||
#include "plutosdr/deviceplutosdrshared.h"
|
#include "plutosdr/deviceplutosdrshared.h"
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ class PlutoSDROutputThread : public QThread, public DevicePlutoSDRShared::Thread
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PlutoSDROutputThread(uint32_t blocksize, DevicePlutoSDRBox* plutoBox, SampleSourceFifo* sampleFifo, QObject* parent = 0);
|
PlutoSDROutputThread(uint32_t blocksize, DevicePlutoSDRBox* plutoBox, SampleSourceFifoDB* sampleFifo, QObject* parent = 0);
|
||||||
~PlutoSDROutputThread();
|
~PlutoSDROutputThread();
|
||||||
|
|
||||||
virtual void startWork();
|
virtual void startWork();
|
||||||
@ -51,7 +51,7 @@ private:
|
|||||||
int16_t *m_buf; //!< holds I+Q values of each sample from devce
|
int16_t *m_buf; //!< holds I+Q values of each sample from devce
|
||||||
// int16_t *m_bufConv; //!< holds I+Q values of each sample converted to host format via iio_channel_convert
|
// int16_t *m_bufConv; //!< holds I+Q values of each sample converted to host format via iio_channel_convert
|
||||||
uint32_t m_blockSizeSamples; //!< buffer sizes in number of (I,Q) samples
|
uint32_t m_blockSizeSamples; //!< buffer sizes in number of (I,Q) samples
|
||||||
SampleSourceFifo* m_sampleFifo; //!< DSP sample FIFO (I,Q)
|
SampleSourceFifoDB* m_sampleFifo; //!< DSP sample FIFO (I,Q)
|
||||||
|
|
||||||
unsigned int m_log2Interp; // soft interpolation
|
unsigned int m_log2Interp; // soft interpolation
|
||||||
|
|
||||||
|
@ -21,11 +21,11 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
#include "util/timeutil.h"
|
#include "util/timeutil.h"
|
||||||
#include "remoteoutputthread.h"
|
#include "remoteoutputthread.h"
|
||||||
|
|
||||||
RemoteOutputThread::RemoteOutputThread(SampleSourceFifo* sampleFifo, QObject* parent) :
|
RemoteOutputThread::RemoteOutputThread(SampleSourceFifoDB* sampleFifo, QObject* parent) :
|
||||||
QThread(parent),
|
QThread(parent),
|
||||||
m_running(false),
|
m_running(false),
|
||||||
m_samplesChunkSize(0),
|
m_samplesChunkSize(0),
|
||||||
|
@ -36,14 +36,14 @@
|
|||||||
|
|
||||||
#define REMOTEOUTPUT_THROTTLE_MS 50
|
#define REMOTEOUTPUT_THROTTLE_MS 50
|
||||||
|
|
||||||
class SampleSourceFifo;
|
class SampleSourceFifoDB;
|
||||||
struct timeval;
|
struct timeval;
|
||||||
|
|
||||||
class RemoteOutputThread : public QThread {
|
class RemoteOutputThread : public QThread {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RemoteOutputThread(SampleSourceFifo* sampleFifo, QObject* parent = 0);
|
RemoteOutputThread(SampleSourceFifoDB* sampleFifo, QObject* parent = 0);
|
||||||
~RemoteOutputThread();
|
~RemoteOutputThread();
|
||||||
|
|
||||||
void startWork();
|
void startWork();
|
||||||
@ -68,7 +68,7 @@ private:
|
|||||||
volatile bool m_running;
|
volatile bool m_running;
|
||||||
|
|
||||||
int m_samplesChunkSize;
|
int m_samplesChunkSize;
|
||||||
SampleSourceFifo* m_sampleFifo;
|
SampleSourceFifoDB* m_sampleFifo;
|
||||||
uint32_t m_samplesCount;
|
uint32_t m_samplesCount;
|
||||||
int m_chunkCorrection;
|
int m_chunkCorrection;
|
||||||
|
|
||||||
|
@ -463,7 +463,7 @@ bool SoapySDROutput::start()
|
|||||||
{
|
{
|
||||||
qDebug("SoapySDROutput::start: expand channels. Re-allocate thread and take ownership");
|
qDebug("SoapySDROutput::start: expand channels. Re-allocate thread and take ownership");
|
||||||
|
|
||||||
SampleSourceFifo **fifos = new SampleSourceFifo*[nbOriginalChannels];
|
SampleSourceFifoDB **fifos = new SampleSourceFifoDB*[nbOriginalChannels];
|
||||||
unsigned int *log2Interps = new unsigned int[nbOriginalChannels];
|
unsigned int *log2Interps = new unsigned int[nbOriginalChannels];
|
||||||
|
|
||||||
for (int i = 0; i < nbOriginalChannels; i++) // save original FIFO references and data
|
for (int i = 0; i < nbOriginalChannels; i++) // save original FIFO references and data
|
||||||
@ -574,7 +574,7 @@ void SoapySDROutput::stop()
|
|||||||
{
|
{
|
||||||
qDebug("SoapySDROutput::stop: MO mode. Reduce by deleting and re-creating the thread");
|
qDebug("SoapySDROutput::stop: MO mode. Reduce by deleting and re-creating the thread");
|
||||||
soapySDROutputThread->stopWork();
|
soapySDROutputThread->stopWork();
|
||||||
SampleSourceFifo **fifos = new SampleSourceFifo*[nbOriginalChannels-1];
|
SampleSourceFifoDB **fifos = new SampleSourceFifoDB*[nbOriginalChannels-1];
|
||||||
unsigned int *log2Interps = new unsigned int[nbOriginalChannels-1];
|
unsigned int *log2Interps = new unsigned int[nbOriginalChannels-1];
|
||||||
int highestActiveChannelIndex = -1;
|
int highestActiveChannelIndex = -1;
|
||||||
|
|
||||||
@ -871,7 +871,7 @@ bool SoapySDROutput::applySettings(const SoapySDROutputSettings& settings, bool
|
|||||||
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || (m_settings.m_log2Interp != settings.m_log2Interp) || force)
|
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || (m_settings.m_log2Interp != settings.m_log2Interp) || force)
|
||||||
{
|
{
|
||||||
SoapySDROutputThread *soapySDROutputThread = findThread();
|
SoapySDROutputThread *soapySDROutputThread = findThread();
|
||||||
SampleSourceFifo *fifo = 0;
|
SampleSourceFifoDB *fifo = 0;
|
||||||
|
|
||||||
if (soapySDROutputThread)
|
if (soapySDROutputThread)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <SoapySDR/Formats.hpp>
|
#include <SoapySDR/Formats.hpp>
|
||||||
#include <SoapySDR/Errors.hpp>
|
#include <SoapySDR/Errors.hpp>
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
|
|
||||||
#include "soapysdroutputthread.h"
|
#include "soapysdroutputthread.h"
|
||||||
|
|
||||||
@ -218,14 +218,14 @@ unsigned int SoapySDROutputThread::getLog2Interpolation(unsigned int channel) co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoapySDROutputThread::setFifo(unsigned int channel, SampleSourceFifo *sampleFifo)
|
void SoapySDROutputThread::setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo)
|
||||||
{
|
{
|
||||||
if (channel < m_nbChannels) {
|
if (channel < m_nbChannels) {
|
||||||
m_channels[channel].m_sampleFifo = sampleFifo;
|
m_channels[channel].m_sampleFifo = sampleFifo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SampleSourceFifo *SoapySDROutputThread::getFifo(unsigned int channel)
|
SampleSourceFifoDB *SoapySDROutputThread::getFifo(unsigned int channel)
|
||||||
{
|
{
|
||||||
if (channel < m_nbChannels) {
|
if (channel < m_nbChannels) {
|
||||||
return m_channels[channel].m_sampleFifo;
|
return m_channels[channel].m_sampleFifo;
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include "dsp/interpolators.h"
|
#include "dsp/interpolators.h"
|
||||||
#include "dsp/interpolatorsif.h"
|
#include "dsp/interpolatorsif.h"
|
||||||
|
|
||||||
class SampleSourceFifo;
|
class SampleSourceFifoDB;
|
||||||
|
|
||||||
class SoapySDROutputThread : public QThread {
|
class SoapySDROutputThread : public QThread {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -46,13 +46,13 @@ public:
|
|||||||
unsigned int getLog2Interpolation(unsigned int channel) const;
|
unsigned int getLog2Interpolation(unsigned int channel) const;
|
||||||
void setSampleRate(unsigned int sampleRate) { m_sampleRate = sampleRate; }
|
void setSampleRate(unsigned int sampleRate) { m_sampleRate = sampleRate; }
|
||||||
unsigned int getSampleRate() const { return m_sampleRate; }
|
unsigned int getSampleRate() const { return m_sampleRate; }
|
||||||
void setFifo(unsigned int channel, SampleSourceFifo *sampleFifo);
|
void setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo);
|
||||||
SampleSourceFifo *getFifo(unsigned int channel);
|
SampleSourceFifoDB *getFifo(unsigned int channel);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Channel
|
struct Channel
|
||||||
{
|
{
|
||||||
SampleSourceFifo* m_sampleFifo;
|
SampleSourceFifoDB* m_sampleFifo;
|
||||||
unsigned int m_log2Interp;
|
unsigned int m_log2Interp;
|
||||||
Interpolators<qint8, SDR_TX_SAMP_SZ, 8> m_interpolators8;
|
Interpolators<qint8, SDR_TX_SAMP_SZ, 8> m_interpolators8;
|
||||||
Interpolators<qint16, SDR_TX_SAMP_SZ, 12> m_interpolators12;
|
Interpolators<qint16, SDR_TX_SAMP_SZ, 12> m_interpolators12;
|
||||||
|
@ -21,11 +21,11 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
#include "dsp/basebandsamplesink.h"
|
#include "dsp/basebandsamplesink.h"
|
||||||
#include "testsinkthread.h"
|
#include "testsinkthread.h"
|
||||||
|
|
||||||
TestSinkThread::TestSinkThread(SampleSourceFifo* sampleFifo, QObject* parent) :
|
TestSinkThread::TestSinkThread(SampleSourceFifoDB* sampleFifo, QObject* parent) :
|
||||||
QThread(parent),
|
QThread(parent),
|
||||||
m_running(false),
|
m_running(false),
|
||||||
m_bufsize(0),
|
m_bufsize(0),
|
||||||
|
@ -34,14 +34,14 @@
|
|||||||
|
|
||||||
#define TESTSINK_THROTTLE_MS 50
|
#define TESTSINK_THROTTLE_MS 50
|
||||||
|
|
||||||
class SampleSourceFifo;
|
class SampleSourceFifoDB;
|
||||||
class BasebandSampleSink;
|
class BasebandSampleSink;
|
||||||
|
|
||||||
class TestSinkThread : public QThread {
|
class TestSinkThread : public QThread {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestSinkThread(SampleSourceFifo* sampleFifo, QObject* parent = nullptr);
|
TestSinkThread(SampleSourceFifoDB* sampleFifo, QObject* parent = nullptr);
|
||||||
~TestSinkThread();
|
~TestSinkThread();
|
||||||
|
|
||||||
void startWork();
|
void startWork();
|
||||||
@ -70,7 +70,7 @@ private:
|
|||||||
|
|
||||||
std::size_t m_bufsize;
|
std::size_t m_bufsize;
|
||||||
unsigned int m_samplesChunkSize;
|
unsigned int m_samplesChunkSize;
|
||||||
SampleSourceFifo* m_sampleFifo;
|
SampleSourceFifoDB* m_sampleFifo;
|
||||||
std::size_t m_samplesCount;
|
std::size_t m_samplesCount;
|
||||||
|
|
||||||
int m_samplerate;
|
int m_samplerate;
|
||||||
|
@ -278,7 +278,7 @@ bool XTRXOutput::start()
|
|||||||
{
|
{
|
||||||
qDebug("XTRXOutput::start: expand channels. Re-allocate thread and take ownership");
|
qDebug("XTRXOutput::start: expand channels. Re-allocate thread and take ownership");
|
||||||
|
|
||||||
SampleSourceFifo **fifos = new SampleSourceFifo*[2];
|
SampleSourceFifoDB **fifos = new SampleSourceFifoDB*[2];
|
||||||
unsigned int *log2Interps = new unsigned int[2];
|
unsigned int *log2Interps = new unsigned int[2];
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) // save original FIFO references and data
|
for (int i = 0; i < 2; i++) // save original FIFO references and data
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include "xtrx/devicextrx.h"
|
#include "xtrx/devicextrx.h"
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
#include "xtrxoutputthread.h"
|
#include "xtrxoutputthread.h"
|
||||||
|
|
||||||
|
|
||||||
@ -94,14 +94,14 @@ unsigned int XTRXOutputThread::getLog2Interpolation(unsigned int channel) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XTRXOutputThread::setFifo(unsigned int channel, SampleSourceFifo *sampleFifo)
|
void XTRXOutputThread::setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo)
|
||||||
{
|
{
|
||||||
if (channel < 2) {
|
if (channel < 2) {
|
||||||
m_channels[channel].m_sampleFifo = sampleFifo;
|
m_channels[channel].m_sampleFifo = sampleFifo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SampleSourceFifo *XTRXOutputThread::getFifo(unsigned int channel)
|
SampleSourceFifoDB *XTRXOutputThread::getFifo(unsigned int channel)
|
||||||
{
|
{
|
||||||
if (channel < 2) {
|
if (channel < 2) {
|
||||||
return m_channels[channel].m_sampleFifo;
|
return m_channels[channel].m_sampleFifo;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "xtrx_api.h"
|
#include "xtrx_api.h"
|
||||||
|
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
#include "dsp/interpolators.h"
|
#include "dsp/interpolators.h"
|
||||||
#include "xtrx/devicextrxshared.h"
|
#include "xtrx/devicextrxshared.h"
|
||||||
|
|
||||||
@ -44,13 +44,13 @@ public:
|
|||||||
unsigned int getNbChannels() const { return m_nbChannels; }
|
unsigned int getNbChannels() const { return m_nbChannels; }
|
||||||
void setLog2Interpolation(unsigned int channel, unsigned int log2_interp);
|
void setLog2Interpolation(unsigned int channel, unsigned int log2_interp);
|
||||||
unsigned int getLog2Interpolation(unsigned int channel) const;
|
unsigned int getLog2Interpolation(unsigned int channel) const;
|
||||||
void setFifo(unsigned int channel, SampleSourceFifo *sampleFifo);
|
void setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo);
|
||||||
SampleSourceFifo *getFifo(unsigned int channel);
|
SampleSourceFifoDB *getFifo(unsigned int channel);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Channel
|
struct Channel
|
||||||
{
|
{
|
||||||
SampleSourceFifo* m_sampleFifo;
|
SampleSourceFifoDB* m_sampleFifo;
|
||||||
unsigned int m_log2Interp;
|
unsigned int m_log2Interp;
|
||||||
Interpolators<qint16, SDR_TX_SAMP_SZ, 12> m_interpolators;
|
Interpolators<qint16, SDR_TX_SAMP_SZ, 12> m_interpolators;
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ set(sdrbase_SOURCES
|
|||||||
dsp/samplemififo.cpp
|
dsp/samplemififo.cpp
|
||||||
dsp/samplemofifo.cpp
|
dsp/samplemofifo.cpp
|
||||||
dsp/samplesinkfifo.cpp
|
dsp/samplesinkfifo.cpp
|
||||||
dsp/samplesourcefifo.cpp
|
dsp/samplesourcefifodb.cpp
|
||||||
dsp/basebandsamplesink.cpp
|
dsp/basebandsamplesink.cpp
|
||||||
dsp/basebandsamplesource.cpp
|
dsp/basebandsamplesource.cpp
|
||||||
dsp/nullsink.cpp
|
dsp/nullsink.cpp
|
||||||
@ -241,7 +241,7 @@ set(sdrbase_HEADERS
|
|||||||
dsp/samplemififo.h
|
dsp/samplemififo.h
|
||||||
dsp/samplemofifo.h
|
dsp/samplemofifo.h
|
||||||
dsp/samplesinkfifo.h
|
dsp/samplesinkfifo.h
|
||||||
dsp/samplesourcefifo.h
|
dsp/samplesourcefifodb.h
|
||||||
dsp/basebandsamplesink.h
|
dsp/basebandsamplesink.h
|
||||||
dsp/basebandsamplesource.h
|
dsp/basebandsamplesource.h
|
||||||
dsp/nullsink.h
|
dsp/nullsink.h
|
||||||
|
@ -55,7 +55,7 @@ void BasebandSampleSource::handleWriteToDeviceFifo(int nbSamples)
|
|||||||
handleWriteToFifo(m_deviceSampleFifo, nbSamples);
|
handleWriteToFifo(m_deviceSampleFifo, nbSamples);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasebandSampleSource::handleWriteToFifo(SampleSourceFifo *sampleFifo, int nbSamples)
|
void BasebandSampleSource::handleWriteToFifo(SampleSourceFifoDB *sampleFifo, int nbSamples)
|
||||||
{
|
{
|
||||||
SampleVector::iterator writeAt;
|
SampleVector::iterator writeAt;
|
||||||
sampleFifo->getWriteIterator(writeAt);
|
sampleFifo->getWriteIterator(writeAt);
|
||||||
@ -69,7 +69,7 @@ void BasebandSampleSource::handleWriteToFifo(SampleSourceFifo *sampleFifo, int n
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BasebandSampleSource::setDeviceSampleSourceFifo(SampleSourceFifo *deviceSampleFifo)
|
void BasebandSampleSource::setDeviceSampleSourceFifo(SampleSourceFifoDB *deviceSampleFifo)
|
||||||
{
|
{
|
||||||
if (m_deviceSampleFifo != deviceSampleFifo)
|
if (m_deviceSampleFifo != deviceSampleFifo)
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include "dsp/dsptypes.h"
|
#include "dsp/dsptypes.h"
|
||||||
#include "dsp/samplesourcefifo.h"
|
#include "dsp/samplesourcefifodb.h"
|
||||||
#include "export.h"
|
#include "export.h"
|
||||||
#include "util/messagequeue.h"
|
#include "util/messagequeue.h"
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ public:
|
|||||||
virtual void pullAudio(int nbSamples) { (void) nbSamples; }
|
virtual void pullAudio(int nbSamples) { (void) nbSamples; }
|
||||||
|
|
||||||
/** direct feeding of sample source FIFO */
|
/** direct feeding of sample source FIFO */
|
||||||
void feed(SampleSourceFifo* sampleFifo, int nbSamples)
|
void feed(SampleSourceFifoDB* sampleFifo, int nbSamples)
|
||||||
{
|
{
|
||||||
SampleVector::iterator writeAt;
|
SampleVector::iterator writeAt;
|
||||||
sampleFifo->getWriteIterator(writeAt);
|
sampleFifo->getWriteIterator(writeAt);
|
||||||
@ -52,22 +52,22 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SampleSourceFifo& getSampleSourceFifo() { return m_sampleFifo; }
|
SampleSourceFifoDB& getSampleSourceFifo() { return m_sampleFifo; }
|
||||||
|
|
||||||
virtual bool handleMessage(const Message& cmd) = 0; //!< Processing of a message. Returns true if message has actually been processed
|
virtual bool handleMessage(const Message& cmd) = 0; //!< Processing of a message. Returns true if message has actually been processed
|
||||||
|
|
||||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
|
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
|
||||||
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
|
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
|
||||||
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
||||||
void setDeviceSampleSourceFifo(SampleSourceFifo *deviceSampleFifo);
|
void setDeviceSampleSourceFifo(SampleSourceFifoDB *deviceSampleFifo);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
|
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
|
||||||
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
|
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
|
||||||
SampleSourceFifo m_sampleFifo; //!< Internal FIFO for multi-channel processing
|
SampleSourceFifoDB m_sampleFifo; //!< Internal FIFO for multi-channel processing
|
||||||
SampleSourceFifo *m_deviceSampleFifo; //!< Reference to the device FIFO for single channel processing
|
SampleSourceFifoDB *m_deviceSampleFifo; //!< Reference to the device FIFO for single channel processing
|
||||||
|
|
||||||
void handleWriteToFifo(SampleSourceFifo *sampleFifo, int nbSamples);
|
void handleWriteToFifo(SampleSourceFifoDB *sampleFifo, int nbSamples);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void handleInputMessages();
|
void handleInputMessages();
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "samplesourcefifo.h"
|
#include "samplesourcefifodb.h"
|
||||||
#include "samplemififo.h"
|
#include "samplemififo.h"
|
||||||
#include "samplemofifo.h"
|
#include "samplemofifo.h"
|
||||||
#include "util/message.h"
|
#include "util/message.h"
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
#include "samplesourcefifo.h"
|
#include "samplesourcefifodb.h"
|
||||||
#include "util/message.h"
|
#include "util/message.h"
|
||||||
#include "util/messagequeue.h"
|
#include "util/messagequeue.h"
|
||||||
#include "export.h"
|
#include "export.h"
|
||||||
@ -114,7 +114,7 @@ public:
|
|||||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||||
virtual void setMessageQueueToGUI(MessageQueue *queue) = 0; // pure virtual so that child classes must have to deal with this
|
virtual void setMessageQueueToGUI(MessageQueue *queue) = 0; // pure virtual so that child classes must have to deal with this
|
||||||
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
||||||
SampleSourceFifo* getSampleFifo() { return &m_sampleSourceFifo; }
|
SampleSourceFifoDB* getSampleFifo() { return &m_sampleSourceFifo; }
|
||||||
|
|
||||||
static qint64 calculateDeviceCenterFrequency(
|
static qint64 calculateDeviceCenterFrequency(
|
||||||
quint64 centerFrequency,
|
quint64 centerFrequency,
|
||||||
@ -141,7 +141,7 @@ protected slots:
|
|||||||
void handleInputMessages();
|
void handleInputMessages();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SampleSourceFifo m_sampleSourceFifo;
|
SampleSourceFifoDB m_sampleSourceFifo;
|
||||||
MessageQueue m_inputMessageQueue; //!< Input queue to the sink
|
MessageQueue m_inputMessageQueue; //!< Input queue to the sink
|
||||||
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
|
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
|
||||||
};
|
};
|
||||||
|
@ -1129,7 +1129,7 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages()
|
|||||||
|
|
||||||
// if (!m_spectrumInputSourceElseSink && m_deviceSampleMIMO && (m_spectrumInputIndex < m_deviceSampleMIMO->getNbSinkStreams()))
|
// if (!m_spectrumInputSourceElseSink && m_deviceSampleMIMO && (m_spectrumInputIndex < m_deviceSampleMIMO->getNbSinkStreams()))
|
||||||
// {
|
// {
|
||||||
// SampleSourceFifo *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(m_spectrumInputIndex);
|
// SampleSourceFifoDB *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(m_spectrumInputIndex);
|
||||||
// disconnect(inputFIFO, SIGNAL(dataRead(int)), this, SLOT(handleForwardToSpectrumSink(int)));
|
// disconnect(inputFIFO, SIGNAL(dataRead(int)), this, SLOT(handleForwardToSpectrumSink(int)));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@ -1145,13 +1145,13 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages()
|
|||||||
{
|
{
|
||||||
// if (!m_spectrumInputSourceElseSink) // remove the source listener
|
// if (!m_spectrumInputSourceElseSink) // remove the source listener
|
||||||
// {
|
// {
|
||||||
// SampleSourceFifo *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(m_spectrumInputIndex);
|
// SampleSourceFifoDB *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(m_spectrumInputIndex);
|
||||||
// disconnect(inputFIFO, SIGNAL(dataRead(int)), this, SLOT(handleForwardToSpectrumSink(int)));
|
// disconnect(inputFIFO, SIGNAL(dataRead(int)), this, SLOT(handleForwardToSpectrumSink(int)));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if ((!spectrumInputSourceElseSink) && (spectrumInputIndex < m_deviceSampleMIMO->getNbSinkStreams())) // add the source listener
|
if ((!spectrumInputSourceElseSink) && (spectrumInputIndex < m_deviceSampleMIMO->getNbSinkStreams())) // add the source listener
|
||||||
{
|
{
|
||||||
// SampleSourceFifo *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(spectrumInputIndex);
|
// SampleSourceFifoDB *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(spectrumInputIndex);
|
||||||
// connect(inputFIFO, SIGNAL(dataRead(int)), this, SLOT(handleForwardToSpectrumSink(int)));
|
// connect(inputFIFO, SIGNAL(dataRead(int)), this, SLOT(handleForwardToSpectrumSink(int)));
|
||||||
|
|
||||||
if (m_spectrumSink)
|
if (m_spectrumSink)
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "dsp/basebandsamplesink.h"
|
#include "dsp/basebandsamplesink.h"
|
||||||
#include "dsp/devicesamplesink.h"
|
#include "dsp/devicesamplesink.h"
|
||||||
#include "dsp/dspcommands.h"
|
#include "dsp/dspcommands.h"
|
||||||
#include "samplesourcefifo.h"
|
#include "samplesourcefifodb.h"
|
||||||
#include "threadedbasebandsamplesource.h"
|
#include "threadedbasebandsamplesource.h"
|
||||||
|
|
||||||
DSPDeviceSinkEngine::DSPDeviceSinkEngine(uint32_t uid, QObject* parent) :
|
DSPDeviceSinkEngine::DSPDeviceSinkEngine(uint32_t uid, QObject* parent) :
|
||||||
@ -165,7 +165,7 @@ void DSPDeviceSinkEngine::work(int nbWriteSamples)
|
|||||||
// qDebug("DSPDeviceSinkEngine::work: multiple channel sources handling: %u", m_multipleSourcesDivisionFactor);
|
// qDebug("DSPDeviceSinkEngine::work: multiple channel sources handling: %u", m_multipleSourcesDivisionFactor);
|
||||||
|
|
||||||
SampleVector::iterator writeBegin;
|
SampleVector::iterator writeBegin;
|
||||||
SampleSourceFifo* sampleFifo = m_deviceSampleSink->getSampleFifo();
|
SampleSourceFifoDB* sampleFifo = m_deviceSampleSink->getSampleFifo();
|
||||||
sampleFifo->getWriteIterator(writeBegin);
|
sampleFifo->getWriteIterator(writeBegin);
|
||||||
SampleVector::iterator writeAt = writeBegin;
|
SampleVector::iterator writeAt = writeBegin;
|
||||||
std::vector<SampleVector::iterator> sampleSourceIterators;
|
std::vector<SampleVector::iterator> sampleSourceIterators;
|
||||||
@ -560,7 +560,7 @@ void DSPDeviceSinkEngine::handleForwardToSpectrumSink(int nbSamples)
|
|||||||
{
|
{
|
||||||
if (m_spectrumSink)
|
if (m_spectrumSink)
|
||||||
{
|
{
|
||||||
SampleSourceFifo* sampleFifo = m_deviceSampleSink->getSampleFifo();
|
SampleSourceFifoDB* sampleFifo = m_deviceSampleSink->getSampleFifo();
|
||||||
SampleVector::iterator readUntil;
|
SampleVector::iterator readUntil;
|
||||||
sampleFifo->getReadIterator(readUntil);
|
sampleFifo->getReadIterator(readUntil);
|
||||||
m_spectrumSink->feed(readUntil - nbSamples, readUntil, false);
|
m_spectrumSink->feed(readUntil - nbSamples, readUntil, false);
|
||||||
@ -569,7 +569,7 @@ void DSPDeviceSinkEngine::handleForwardToSpectrumSink(int nbSamples)
|
|||||||
|
|
||||||
void DSPDeviceSinkEngine::checkNumberOfBasebandSources()
|
void DSPDeviceSinkEngine::checkNumberOfBasebandSources()
|
||||||
{
|
{
|
||||||
SampleSourceFifo* sampleFifo = m_deviceSampleSink->getSampleFifo();
|
SampleSourceFifoDB* sampleFifo = m_deviceSampleSink->getSampleFifo();
|
||||||
|
|
||||||
// single channel source handling
|
// single channel source handling
|
||||||
if ((m_threadedBasebandSampleSources.size() + m_basebandSampleSources.size()) == 1)
|
if ((m_threadedBasebandSampleSources.size() + m_basebandSampleSources.size()) == 1)
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "samplesourcefifo.h"
|
#include "samplesourcefifodb.h"
|
||||||
|
|
||||||
SampleSourceFifo::SampleSourceFifo(uint32_t size, QObject* parent) :
|
SampleSourceFifoDB::SampleSourceFifoDB(uint32_t size, QObject* parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
m_size(size),
|
m_size(size),
|
||||||
m_init(false)
|
m_init(false)
|
||||||
@ -28,7 +28,7 @@ SampleSourceFifo::SampleSourceFifo(uint32_t size, QObject* parent) :
|
|||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
SampleSourceFifo::SampleSourceFifo(const SampleSourceFifo& other) :
|
SampleSourceFifoDB::SampleSourceFifoDB(const SampleSourceFifoDB& other) :
|
||||||
QObject(other.parent()),
|
QObject(other.parent()),
|
||||||
m_size(other.m_size),
|
m_size(other.m_size),
|
||||||
m_data(other.m_data)
|
m_data(other.m_data)
|
||||||
@ -36,19 +36,19 @@ SampleSourceFifo::SampleSourceFifo(const SampleSourceFifo& other) :
|
|||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
SampleSourceFifo::~SampleSourceFifo()
|
SampleSourceFifoDB::~SampleSourceFifoDB()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void SampleSourceFifo::resize(uint32_t size)
|
void SampleSourceFifoDB::resize(uint32_t size)
|
||||||
{
|
{
|
||||||
qDebug("SampleSourceFifo::resize: %d", size);
|
qDebug("SampleSourceFifoDB::resize: %d", size);
|
||||||
|
|
||||||
m_size = size;
|
m_size = size;
|
||||||
m_data.resize(2*m_size);
|
m_data.resize(2*m_size);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleSourceFifo::init()
|
void SampleSourceFifoDB::init()
|
||||||
{
|
{
|
||||||
static Sample zero = {0,0};
|
static Sample zero = {0,0};
|
||||||
std::fill(m_data.begin(), m_data.end(), zero);
|
std::fill(m_data.begin(), m_data.end(), zero);
|
||||||
@ -57,7 +57,7 @@ void SampleSourceFifo::init()
|
|||||||
m_init = true;
|
m_init = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleSourceFifo::readAdvance(SampleVector::iterator& readUntil, unsigned int nbSamples)
|
void SampleSourceFifoDB::readAdvance(SampleVector::iterator& readUntil, unsigned int nbSamples)
|
||||||
{
|
{
|
||||||
// QMutexLocker mutexLocker(&m_mutex);
|
// QMutexLocker mutexLocker(&m_mutex);
|
||||||
assert(nbSamples <= m_size/2);
|
assert(nbSamples <= m_size/2);
|
||||||
@ -68,7 +68,7 @@ void SampleSourceFifo::readAdvance(SampleVector::iterator& readUntil, unsigned i
|
|||||||
emit dataRead(nbSamples);
|
emit dataRead(nbSamples);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleSourceFifo::readAdvance(SampleVector::const_iterator& readUntil, unsigned int nbSamples)
|
void SampleSourceFifoDB::readAdvance(SampleVector::const_iterator& readUntil, unsigned int nbSamples)
|
||||||
{
|
{
|
||||||
// QMutexLocker mutexLocker(&m_mutex);
|
// QMutexLocker mutexLocker(&m_mutex);
|
||||||
assert(nbSamples <= m_size/2);
|
assert(nbSamples <= m_size/2);
|
||||||
@ -79,7 +79,7 @@ void SampleSourceFifo::readAdvance(SampleVector::const_iterator& readUntil, unsi
|
|||||||
emit dataRead(nbSamples);
|
emit dataRead(nbSamples);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleSourceFifo::write(const Sample& sample)
|
void SampleSourceFifoDB::write(const Sample& sample)
|
||||||
{
|
{
|
||||||
m_data[m_iw] = sample;
|
m_data[m_iw] = sample;
|
||||||
m_data[m_iw+m_size] = sample;
|
m_data[m_iw+m_size] = sample;
|
||||||
@ -90,17 +90,17 @@ void SampleSourceFifo::write(const Sample& sample)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleSourceFifo::getReadIterator(SampleVector::iterator& readUntil)
|
void SampleSourceFifoDB::getReadIterator(SampleVector::iterator& readUntil)
|
||||||
{
|
{
|
||||||
readUntil = m_data.begin() + m_size + m_ir;
|
readUntil = m_data.begin() + m_size + m_ir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleSourceFifo::getWriteIterator(SampleVector::iterator& writeAt)
|
void SampleSourceFifoDB::getWriteIterator(SampleVector::iterator& writeAt)
|
||||||
{
|
{
|
||||||
writeAt = m_data.begin() + m_iw;
|
writeAt = m_data.begin() + m_iw;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleSourceFifo::bumpIndex(SampleVector::iterator& writeAt)
|
void SampleSourceFifoDB::bumpIndex(SampleVector::iterator& writeAt)
|
||||||
{
|
{
|
||||||
m_data[m_iw+m_size] = m_data[m_iw];
|
m_data[m_iw+m_size] = m_data[m_iw];
|
||||||
|
|
||||||
@ -112,12 +112,12 @@ void SampleSourceFifo::bumpIndex(SampleVector::iterator& writeAt)
|
|||||||
writeAt = m_data.begin() + m_iw;
|
writeAt = m_data.begin() + m_iw;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SampleSourceFifo::getIteratorOffset(const SampleVector::iterator& iterator)
|
int SampleSourceFifoDB::getIteratorOffset(const SampleVector::iterator& iterator)
|
||||||
{
|
{
|
||||||
return iterator - m_data.begin();
|
return iterator - m_data.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleSourceFifo::setIteratorFromOffset(SampleVector::iterator& iterator, int offset)
|
void SampleSourceFifoDB::setIteratorFromOffset(SampleVector::iterator& iterator, int offset)
|
||||||
{
|
{
|
||||||
iterator = m_data.begin() + offset;
|
iterator = m_data.begin() + offset;
|
||||||
}
|
}
|
@ -15,8 +15,8 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef SDRBASE_DSP_SAMPLESOURCEFIFO_H_
|
#ifndef SDRBASE_DSP_SAMPLESOURCEFIFODB_H_
|
||||||
#define SDRBASE_DSP_SAMPLESOURCEFIFO_H_
|
#define SDRBASE_DSP_SAMPLESOURCEFIFODB_H_
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
@ -25,13 +25,13 @@
|
|||||||
#include "export.h"
|
#include "export.h"
|
||||||
#include "dsp/dsptypes.h"
|
#include "dsp/dsptypes.h"
|
||||||
|
|
||||||
class SDRBASE_API SampleSourceFifo : public QObject {
|
class SDRBASE_API SampleSourceFifoDB : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SampleSourceFifo(uint32_t size, QObject* parent = nullptr);
|
SampleSourceFifoDB(uint32_t size, QObject* parent = nullptr);
|
||||||
SampleSourceFifo(const SampleSourceFifo& other);
|
SampleSourceFifoDB(const SampleSourceFifoDB& other);
|
||||||
~SampleSourceFifo();
|
~SampleSourceFifoDB();
|
||||||
|
|
||||||
void resize(uint32_t size);
|
void resize(uint32_t size);
|
||||||
uint32_t size() const { return m_size; }
|
uint32_t size() const { return m_size; }
|
@ -64,7 +64,7 @@ void ThreadedBasebandSampleSource::pull(Sample& sample)
|
|||||||
m_basebandSampleSource->pull(sample);
|
m_basebandSampleSource->pull(sample);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThreadedBasebandSampleSource::feed(SampleSourceFifo* sampleFifo,
|
void ThreadedBasebandSampleSource::feed(SampleSourceFifoDB* sampleFifo,
|
||||||
int nbSamples)
|
int nbSamples)
|
||||||
{
|
{
|
||||||
m_basebandSampleSource->feed(sampleFifo, nbSamples);
|
m_basebandSampleSource->feed(sampleFifo, nbSamples);
|
||||||
|
@ -48,11 +48,11 @@ public:
|
|||||||
void pullAudio(int nbSamples) { if (m_basebandSampleSource) m_basebandSampleSource->pullAudio(nbSamples); }
|
void pullAudio(int nbSamples) { if (m_basebandSampleSource) m_basebandSampleSource->pullAudio(nbSamples); }
|
||||||
|
|
||||||
/** direct feeding of sample source FIFO */
|
/** direct feeding of sample source FIFO */
|
||||||
void feed(SampleSourceFifo* sampleFifo,
|
void feed(SampleSourceFifoDB* sampleFifo,
|
||||||
int nbSamples);
|
int nbSamples);
|
||||||
|
|
||||||
SampleSourceFifo& getSampleSourceFifo() { return m_basebandSampleSource->getSampleSourceFifo(); }
|
SampleSourceFifoDB& getSampleSourceFifo() { return m_basebandSampleSource->getSampleSourceFifo(); }
|
||||||
void setDeviceSampleSourceFifo(SampleSourceFifo *deviceSampleFifo) { m_basebandSampleSource->setDeviceSampleSourceFifo(deviceSampleFifo); }
|
void setDeviceSampleSourceFifo(SampleSourceFifoDB *deviceSampleFifo) { m_basebandSampleSource->setDeviceSampleSourceFifo(deviceSampleFifo); }
|
||||||
|
|
||||||
QString getSampleSourceObjectName() const;
|
QString getSampleSourceObjectName() const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user