1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-05-30 05:52:24 -04:00

PlutoSDR output: fixed transmission of samples

This commit is contained in:
f4exb 2017-10-29 03:58:51 +01:00
parent 4536680adf
commit 08b3ebd305
4 changed files with 13 additions and 12 deletions

View File

@ -17,10 +17,10 @@ if(LIBUSB_FOUND AND LIMESUITE_FOUND)
add_subdirectory(limesdroutput) add_subdirectory(limesdroutput)
endif(LIBUSB_FOUND AND LIMESUITE_FOUND) endif(LIBUSB_FOUND AND LIMESUITE_FOUND)
#find_package(LibIIO) find_package(LibIIO)
#if(LIBUSB_FOUND AND LIBIIO_FOUND) if(LIBUSB_FOUND AND LIBIIO_FOUND)
# add_subdirectory(plutosdroutput) add_subdirectory(plutosdroutput)
#endif(LIBUSB_FOUND AND LIBIIO_FOUND) endif(LIBUSB_FOUND AND LIBIIO_FOUND)
find_package(CM256cc) find_package(CM256cc)
find_package(LibNANOMSG) find_package(LibNANOMSG)
@ -35,7 +35,7 @@ if (BUILD_DEBIAN)
if (LIBNANOMSG_FOUND) if (LIBNANOMSG_FOUND)
add_subdirectory(sdrdaemonsink) add_subdirectory(sdrdaemonsink)
endif (LIBNANOMSG_FOUND) endif (LIBNANOMSG_FOUND)
# add_subdirectory(plutosdroutput) add_subdirectory(plutosdroutput)
endif (BUILD_DEBIAN) endif (BUILD_DEBIAN)
add_subdirectory(filesink) add_subdirectory(filesink)

View File

@ -187,7 +187,7 @@ bool PlutoSDROutput::openDevice()
// acquire the channel // acquire the channel
DevicePlutoSDRBox *plutoBox = m_deviceShared.m_deviceParams->getBox(); DevicePlutoSDRBox *plutoBox = m_deviceShared.m_deviceParams->getBox();
plutoBox->openTx(); plutoBox->openTx();
m_plutoTxBuffer = plutoBox->createTxBuffer(PLUTOSDR_BLOCKSIZE_SAMPLES*2, false); // PlutoSDR buffer size is counted in number of I or Q samples not the combination m_plutoTxBuffer = plutoBox->createTxBuffer(PLUTOSDR_BLOCKSIZE_SAMPLES, false); // PlutoSDR buffer size is counted in number of (I,Q) samples
return true; return true;
} }

View File

@ -28,7 +28,7 @@ class DeviceSourceAPI;
const PluginDescriptor PlutoSDROutputPlugin::m_pluginDescriptor = { const PluginDescriptor PlutoSDROutputPlugin::m_pluginDescriptor = {
QString("PlutoSDR Output"), QString("PlutoSDR Output"),
QString("3.7.3"), QString("3.7.8"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,

View File

@ -29,7 +29,7 @@ PlutoSDROutputThread::PlutoSDROutputThread(uint32_t blocksizeSamples, DevicePlut
m_sampleFifo(sampleFifo), m_sampleFifo(sampleFifo),
m_log2Interp(0) m_log2Interp(0)
{ {
m_buf = new qint16[blocksizeSamples*(sizeof(Sample)/sizeof(qint16))]; m_buf = new qint16[blocksizeSamples*2];
// m_bufConv = new qint16[blocksizeSamples*(sizeof(Sample)/sizeof(qint16))]; // m_bufConv = new qint16[blocksizeSamples*(sizeof(Sample)/sizeof(qint16))];
} }
@ -86,17 +86,18 @@ void PlutoSDROutputThread::run()
// I and Q samples are processed one after the other // I and Q samples are processed one after the other
// conversion is not needed as samples are little endian // conversion is not needed as samples are little endian
for (p_dat = m_plutoBox->txBufferFirst(), ihs = 0; p_dat < p_end; p_dat += p_inc, ihs++) for (p_dat = m_plutoBox->txBufferFirst(), ihs = 0; p_dat < p_end; p_dat += p_inc, ihs += 2)
{ {
*((int16_t*)p_dat) = m_buf[ihs] << 4; m_plutoBox->txChannelConvert((int16_t*) p_dat, &m_buf[ihs]);
//*((int16_t*)p_dat) = m_buf[ihs] << 4;
} }
// Schedule TX buffer for sending // Schedule TX buffer for sending
nbytes_tx = m_plutoBox->txBufferPush(); nbytes_tx = m_plutoBox->txBufferPush();
if (nbytes_tx < 0) if (nbytes_tx != 4*m_blockSizeSamples)
{ {
qDebug("PlutoSDROutputThread::run: error pushing buf %d\n", (int) nbytes_tx); qDebug("PlutoSDROutputThread::run: error pushing buf %d != %d\n", (int) nbytes_tx, (int) 4*m_blockSizeSamples);
usleep(200000); usleep(200000);
continue; continue;
} }