1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-06-26 05:55:35 -04:00

HackRF plugins: correct start/stop sequences

This commit is contained in:
f4exb 2017-01-11 01:21:22 +01:00
parent d1696365d7
commit 201695bb67
4 changed files with 12 additions and 12 deletions

View File

@ -30,7 +30,7 @@ From version 2 SDRangel can integrate more than one hardware device running conc
From version 3 transmission or signal generation is supported for BladeRF and HackRF (since version 3.1) using a sample sink plugin. These plugins are: From version 3 transmission or signal generation is supported for BladeRF and HackRF (since version 3.1) using a sample sink plugin. These plugins are:
- [BladeRF output plugin](https://github.com/f4exb/sdrangel/tree/dev/plugins/samplesink/bladerfoutput) - [BladeRF output plugin](https://github.com/f4exb/sdrangel/tree/dev/plugins/samplesink/bladerfoutput) limited support in Windows
- [HackRF output plugin](https://github.com/f4exb/sdrangel/tree/dev/plugins/samplesink/hackrfoutput) - [HackRF output plugin](https://github.com/f4exb/sdrangel/tree/dev/plugins/samplesink/hackrfoutput)
- [File output or file sink plugin](https://github.com/f4exb/sdrangel/tree/dev/plugins/samplesink/filesink) - [File output or file sink plugin](https://github.com/f4exb/sdrangel/tree/dev/plugins/samplesink/filesink)

View File

@ -4,6 +4,8 @@
This output sample sink plugin sends its samples to a [BladeRF device](https://www.nuand.com/). This output sample sink plugin sends its samples to a [BladeRF device](https://www.nuand.com/).
Warning to Windows users: concurrent use of Rx and Tx does not work correctly hence full duplex is not fully operational. For best results use BladeRF as a half duplex device like HackRF i.e. do not run Tx and Rx concurrently.
<h2>Build</h2> <h2>Build</h2>
The plugin will be built only if the [BladeRF host library](https://github.com/Nuand/bladeRF) is installed in your system. If you build it from source and install it in a custom location say: `/opt/install/libbladeRF` you will have to add `-DLIBBLADERF_INCLUDE_DIR=/opt/install/libbladeRF/include -DLIBBLADERF_LIBRARIES=/opt/install/libbladeRF/lib/libbladeRF.so` to the cmake command line. The plugin will be built only if the [BladeRF host library](https://github.com/Nuand/bladeRF) is installed in your system. If you build it from source and install it in a custom location say: `/opt/install/libbladeRF` you will have to add `-DLIBBLADERF_INCLUDE_DIR=/opt/install/libbladeRF/include -DLIBBLADERF_LIBRARIES=/opt/install/libbladeRF/lib/libbladeRF.so` to the cmake command line.

View File

@ -67,11 +67,11 @@ void HackRFOutputThread::run()
{ {
hackrf_error rc; hackrf_error rc;
m_running = true;
m_startWaiter.wakeAll();
rc = (hackrf_error) hackrf_start_tx(m_dev, tx_callback, this); rc = (hackrf_error) hackrf_start_tx(m_dev, tx_callback, this);
m_running = true;
m_startWaiter.wakeAll();
if (rc != HACKRF_SUCCESS) if (rc != HACKRF_SUCCESS)
{ {
qCritical("HackRFOutputThread::run: failed to start HackRF Tx: %s", hackrf_error_name(rc)); qCritical("HackRFOutputThread::run: failed to start HackRF Tx: %s", hackrf_error_name(rc));

View File

@ -41,13 +41,11 @@ HackRFInputThread::~HackRFInputThread()
void HackRFInputThread::startWork() void HackRFInputThread::startWork()
{ {
//m_startWaitMutex.lock(); m_startWaitMutex.lock();
m_running = true;
start(); start();
/*
while(!m_running) while(!m_running)
m_startWaiter.wait(&m_startWaitMutex, 100); m_startWaiter.wait(&m_startWaitMutex, 100);
m_startWaitMutex.unlock();*/ m_startWaitMutex.unlock();
} }
void HackRFInputThread::stopWork() void HackRFInputThread::stopWork()
@ -76,11 +74,11 @@ void HackRFInputThread::run()
{ {
hackrf_error rc; hackrf_error rc;
//m_running = true;
m_startWaiter.wakeAll();
rc = (hackrf_error) hackrf_start_rx(m_dev, rx_callback, this); rc = (hackrf_error) hackrf_start_rx(m_dev, rx_callback, this);
m_running = true;
m_startWaiter.wakeAll();
if (rc != HACKRF_SUCCESS) if (rc != HACKRF_SUCCESS)
{ {
qCritical("HackRFThread::run: failed to start HackRF Rx: %s", hackrf_error_name(rc)); qCritical("HackRFThread::run: failed to start HackRF Rx: %s", hackrf_error_name(rc));
@ -104,7 +102,7 @@ void HackRFInputThread::run()
qDebug("HackRFThread::run: failed to stop HackRF Rx: %s", hackrf_error_name(rc)); qDebug("HackRFThread::run: failed to stop HackRF Rx: %s", hackrf_error_name(rc));
} }
//m_running = false; m_running = false;
} }
// Decimate according to specified log2 (ex: log2=4 => decim=16) // Decimate according to specified log2 (ex: log2=4 => decim=16)