This change removes all usage of boost::mutex,
boost::mutex::scoped_lock, boost::unique_lock, and
boost::condition_variable. It also removes usage of boost::shared_ptr
and boost::weak_ptr outside of block definitions (which must continue to
use Boost until GNU Radio 3.9).
Signed-off-by: Eric Wild <ewild@sysmocom.de>
On closer inspection, switching AGC off results in samples stalling for
an extended period (hundreds of milliseconds). As such, we hit the
timeout in SoapyAirspyHF::readStream() and return SOAPY_SDR_TIMEOUT
(-1).
Things go wrong at this point. It takes a long time before readStream()
is called again, presumably because we returned 0 from work(). By this
time our buffers have overflown, readStream() returns SOAPY_SDR_OVERFLOW
(-2) and work() returns 0. We loop forever, continually overflowing
buffers.
Fix this by looping in soapy_source_c::work() when ->readStream returns
SOAPY_SDR_OVERFLOW so that we consume the buffers straight away.
Signed-off-by: Anton Blanchard <anton at ozlabs.org>
Signed-off-by: Eric Wild <ewild@sysmocom.de>
Currently, rtl_tcp_source_c repeatedly calls ::connect until it
succeeds. This can result in 100% CPU utilization and/or a lot of
network traffic. In addition, GUI applications like Gqrx freeze up.
To solve these problems, I've changed the code to report an error
if ::connect fails.
Signed-off-by: Eric Wild <ewild@sysmocom.de>
CMake 3.13 is not present in older (~2 years old)
Linux distributions and GNU Radio requires min CMake
version 3.8.
All that is needed in order to avoid bumping CMake version
is to not use 'target_link_libraries' in subdirectories.
Here this is done by creating a list of needed
libraries and adding them for linking at the end (like
it was done in gr-osmosdr before porting to GNU Radio 3.8).
One thing that is lost here is 'PRIVATE' statement in case
of FCD libraries linking.
Signed-off-by: Eric Wild <ewild@sysmocom.de>
This was missed during the initial cleanup but is no longer necessary
gnuradio-uhd module installs its own version and that should be used
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Since GNU Radio is gradually replacing Boost with C++11, it seemed worth
doing that for the HackRF blocks I was working on. This change removes
all usage of boost::assign.
From: Clayton Smith <argilo@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
To allow switching between transmit and receive mode within a single
flow graph, I've followed the model used by the BladeRF: I factored
common code into hackrf_common.cc and hackrf_common.h, and created a
"_devs" map there to keep track of which devices have been previously
opened. Shared pointers are used to track how many source & sink blocks
are using a particular device.
Because some properties (center frequency, sample rate, bandwidth, RF
amplifier state, bias tee) are shared between receive and transmit, the
blocks defer setting these until receiving or transmitting is started.
That way a source and sink can safely use different values for these
properties, and the correct values are set during T/R switching.
Because the HackRF driver and/or hardware does not seem to fully
transmit all samples sent to it, the code adds some silence to the end
of transmissions to ensure all samples are transmitted.
I've also replaced boost with C++11 code where possible.
From: Clayton Smith <argilo@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Squashed commit of rtucker-bladerf-hierarchy branch:
commit 35442da7d390919f6f9cbae3f69d6dc32ca595bb
through
commit 9026136cfdbc7116f55af18cb06d1731330fa13f
By default, the bladeRF source and sink will expose 1 channel, unless
nchan is set, in which case it will expose either that number of
channels, or the number of channels supported by the device if lesser.
If nchan > 1 (after validation), MIMO mode is enabled.
Relies on some new libbladeRF API calls. Has been tested
with gqrx on new bladeRF hardware (as a source) but have
not yet tested sink, or existing bladeRF hardware.
Fix from c98be5dd for MSVC which does not require pthreads for boost threading library.
Under gcc -pthread adds support for multithreading with the pthreads library.