diff --git a/plugins/samplesink/CMakeLists.txt b/plugins/samplesink/CMakeLists.txt index 24e9721a3..2115d24c1 100644 --- a/plugins/samplesink/CMakeLists.txt +++ b/plugins/samplesink/CMakeLists.txt @@ -7,14 +7,14 @@ if(LIBUSB_FOUND AND LIBBLADERF_FOUND) add_subdirectory(bladerfoutput) endif(LIBUSB_FOUND AND LIBBLADERF_FOUND) -find_package(LibHACKRF) -if(LIBUSB_FOUND AND LIBHACKRF_FOUND) - add_subdirectory(hackrfoutput) -endif(LIBUSB_FOUND AND LIBHACKRF_FOUND) +#find_package(LibHACKRF) +#if(LIBUSB_FOUND AND LIBHACKRF_FOUND) +# add_subdirectory(hackrfoutput) +3endif(LIBUSB_FOUND AND LIBHACKRF_FOUND) if (BUILD_DEBIAN) add_subdirectory(bladerfoutput) - add_subdirectory(hackrfoutput) +# add_subdirectory(hackrfoutput) endif (BUILD_DEBIAN) add_subdirectory(filesink) diff --git a/plugins/samplesink/hackrfoutput/hackrfoutput.cpp b/plugins/samplesink/hackrfoutput/hackrfoutput.cpp index de298fc03..0578c1fb0 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutput.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutput.cpp @@ -77,7 +77,6 @@ bool HackRFOutput::start(int device) m_sampleSourceFifo.resize(m_settings.m_devSampleRate); // 1s long - if (m_deviceAPI->getSourceBuddies().size() > 0) { DeviceSourceAPI *buddy = m_deviceAPI->getSourceBuddies()[0]; diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp b/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp index 3686d260f..5e630c4d1 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp @@ -21,8 +21,6 @@ #include "dsp/samplesourcefifo.h" -HackRFOutputThread *HackRFOutputThread::m_this = 0; - HackRFOutputThread::HackRFOutputThread(hackrf_device* dev, SampleSourceFifo* sampleFifo, QObject* parent) : QThread(parent), m_running(false), @@ -32,13 +30,12 @@ HackRFOutputThread::HackRFOutputThread(hackrf_device* dev, SampleSourceFifo* sam m_samplerate(10), m_log2Interp(0) { - m_this = this; + qDebug("HackRFOutputThread::HackRFOutputThread: m_dev: %lx m_sampleFifo: %lx", (uint64_t) m_dev, (uint64_t) m_sampleFifo); } HackRFOutputThread::~HackRFOutputThread() { stopWork(); - m_this = 0; } void HackRFOutputThread::startWork() @@ -76,7 +73,7 @@ void HackRFOutputThread::run() //m_running = true; m_startWaiter.wakeAll(); - rc = (hackrf_error) hackrf_start_tx(m_dev, tx_callback, NULL); + rc = (hackrf_error) hackrf_start_tx(m_dev, tx_callback, this); if (rc != HACKRF_SUCCESS) { @@ -84,6 +81,11 @@ void HackRFOutputThread::run() } else { + qDebug("HackRFOutputThread::run: this: %lx start HackRF Tx: m_dev: %lx m_sampleFifo: %lx", + (uint64_t) this, + (uint64_t) m_dev, + (uint64_t) m_sampleFifo); + while ((m_running) && (hackrf_is_streaming(m_dev) == HACKRF_TRUE)) { sleep(1); @@ -143,10 +145,10 @@ void HackRFOutputThread::callback(qint16* buf, qint32 len) } } - int HackRFOutputThread::tx_callback(hackrf_transfer* transfer) { + HackRFOutputThread *thread = (HackRFOutputThread *) transfer->tx_ctx; qint32 bytes_to_write = transfer->valid_length; - m_this->callback((qint16 *) transfer->buffer, bytes_to_write); + thread->callback((qint16 *) transfer->buffer, bytes_to_write); return 0; } diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputthread.h b/plugins/samplesink/hackrfoutput/hackrfoutputthread.h index ec2451e23..b5752cde6 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputthread.h +++ b/plugins/samplesink/hackrfoutput/hackrfoutputthread.h @@ -51,7 +51,6 @@ private: int m_samplerate; unsigned int m_log2Interp; - static HackRFOutputThread *m_this; Interpolators m_interpolators;