31 m_nbChannels(nbChannels),
32 m_uniqueChannelIndex(uniqueChannelIndex)
34 qDebug(
"XTRXInputThread::XTRXInputThread: nbChannels: %u uniqueChannelIndex: %u", nbChannels, uniqueChannelIndex);
37 for (
unsigned int i = 0;
i < 2;
i++) {
44 qDebug(
"XTRXInputThread::~XTRXInputThread");
91 xtrx_run_params params;
92 xtrx_run_params_init(¶ms);
95 params.rx.chs = XTRX_CH_AB;
96 params.rx.wfmt = XTRX_WF_16;
97 params.rx.hfmt = XTRX_IQ_INT16;
104 params.rx.flags |= XTRX_RSP_SISO_MODE;
107 params.rx.flags |= XTRX_RSP_SWAP_AB;
111 res = xtrx_run_ex(
m_dev, ¶ms);
115 qCritical(
"XTRXInputThread::run: could not start stream err:%d", res);
120 std::this_thread::sleep_for(std::chrono::milliseconds(50));
121 qDebug(
"XTRXInputThread::run: stream started");
124 const unsigned int elemSize = 4;
129 buffs[
i] = buffMem[
i].data();
132 xtrx_recv_ex_info_t nfo;
135 nfo.buffers = (
void*
const*) buffs.data();
136 nfo.flags = RCVEX_DONT_INSER_ZEROS | RCVEX_DROP_OLD_ON_OVERFLOW;
140 res = xtrx_recv_sync_ex(
m_dev, &nfo);
144 qCritical(
"XTRXInputThread::run read error: %d", res);
145 qDebug(
"XTRXInputThread::run: out_samples: %u out_events: %u", nfo.out_samples, nfo.out_events);
149 if (nfo.out_events & RCVEX_EVENT_OVERFLOW) {
150 qDebug(
"XTRXInputThread::run: overflow");
153 if (m_nbChannels > 1) {
154 callbackMI((
const qint16*) buffs[0], (
const qint16*) buffs[1], 2 * nfo.out_samples);
156 callbackSI((
const qint16*) buffs[0], 2 * nfo.out_samples);
160 res = xtrx_stop(
m_dev, XTRX_RX);
164 qCritical(
"XTRXInputThread::run: could not stop stream");
168 std::this_thread::sleep_for(std::chrono::milliseconds(50));
169 qDebug(
"XTRXInputThread::run: stream stopped");
174 qWarning(
"XTRXInputThread::run: no channels or FIFO allocated. Aborting");
182 unsigned int fifoCount = 0;
184 for (
unsigned int i = 0;
i < 2;
i++)
void decimate64_cen(SampleVector::iterator *it, const T *buf, qint32 len)
void decimate2_cen(SampleVector::iterator *it, const T *buf, qint32 len)
uint write(const quint8 *data, uint count)
void decimate8_cen(SampleVector::iterator *it, const T *buf, qint32 len)
void decimate4_cen(SampleVector::iterator *it, const T *buf, qint32 len)
static const unsigned int blockSize
void decimate16_cen(SampleVector::iterator *it, const T *buf, qint32 len)
void decimate32_cen(SampleVector::iterator *it, const T *buf, qint32 len)
void decimate1(SampleVector::iterator *it, const T *buf, qint32 len)