28 m_nbChannels(nbTxChannels)
30 qDebug(
"BladeRF2OutputThread::BladeRF2OutputThread");
37 qDebug(
"BladeRF2OutputThread::~BladeRF2OutputThread");
79 status = bladerf_sync_config(
m_dev, BLADERF_TX_X2, BLADERF_FORMAT_SC16_Q11, 128, 16384, 32, 1500);
81 status = bladerf_sync_config(
m_dev, BLADERF_TX_X1, BLADERF_FORMAT_SC16_Q11, 64, 8192, 32, 1500);
86 qCritical(
"BladeRF2OutputThread::run: cannot configure streams: %s", bladerf_strerror(status));
90 qDebug(
"BladeRF2OutputThread::run: start running loop");
107 qCritical(
"BladeRF2OutputThread::run sync Rx error: %s", bladerf_strerror(res));
112 qDebug(
"BladeRF2OutputThread::run: stop running loop");
117 qWarning(
"BladeRF2OutputThread::run: no channels or FIFO allocated. Aborting");
126 unsigned int fifoCount = 0;
172 for (
unsigned int channel = 0; channel <
m_nbChannels; channel++)
175 callbackSO(&buf[2*samplesPerChannel*channel], samplesPerChannel, channel);
177 std::fill(&buf[2*samplesPerChannel*channel], &buf[2*samplesPerChannel*channel]+2*samplesPerChannel, 0);
182 int status = bladerf_interleave_stream_buffer(BLADERF_TX_X2, BLADERF_FORMAT_SC16_Q11 , samplesPerChannel*m_nbChannels, (
void *) buf);
186 qCritical(
"BladeRF2OutputThread::callbackMI: cannot interleave buffer: %s", bladerf_strerror(status));
199 qDebug(
"BladeRF2OutputThread::callbackSO: read lags: %f", bal);
200 }
else if (bal > 0.25) {
201 qDebug(
"BladeRF2OutputThread::callbackSO: read leads: %f", bal);
204 SampleVector::iterator beginRead;
241 std::fill(buf, buf+2*len, 0);
void callbackSO(qint16 *buf, qint32 len, unsigned int channel=0)
void callbackMO(qint16 *buf, qint32 samplesPerChannel)
void interpolate64_cen(SampleVector::iterator *it, T *buf, qint32 len, bool invertIQ=false)
SampleSourceFifo * getFifo(unsigned int channel)
float getRWBalance() const
static const unsigned int blockSize
unsigned int getLog2Interpolation(unsigned int channel) const
Channel * m_channels
Array of channels dynamically allocated for the given number of Tx channels.
void interpolate32_cen(SampleVector::iterator *it, T *buf, qint32 len, bool invertIQ=false)
void interpolate8_cen(SampleVector::iterator *it, T *buf, qint32 len, bool invertIQ=false)
void setFifo(unsigned int channel, SampleSourceFifo *sampleFifo)
void interpolate2_cen(SampleVector::iterator *it, T *buf, qint32 len, bool invertIQ=false)
BladeRF2OutputThread(struct bladerf *dev, unsigned int nbTxChannels, QObject *parent=0)
unsigned int getNbFifos()
void setLog2Interpolation(unsigned int channel, unsigned int log2_interp)
QWaitCondition m_startWaiter
void readAdvance(SampleVector::iterator &readUntil, unsigned int nbSamples)
Interpolators< qint16, SDR_TX_SAMP_SZ, 12 > m_interpolators
void interpolate1(SampleVector::iterator *it, T *buf, qint32 len, bool invertIQ=false)
unsigned int m_log2Interp
void interpolate16_cen(SampleVector::iterator *it, T *buf, qint32 len, bool invertIQ=false)
void interpolate4_cen(SampleVector::iterator *it, T *buf, qint32 len, bool invertIQ=false)
SampleSourceFifo * m_sampleFifo
unsigned int m_nbChannels
qint16 * m_buf
Full buffer for SISO or MIMO operation.