Commit Graph

360 Commits

Author SHA1 Message Date
Wim Lewis ad72126289 Remove unused imports of endian.hpp.
Signed-off-by: Eric Wild <ewild@sysmocom.de>
2020-08-03 01:20:52 +02:00
Wim Lewis 2e7d343fed HackRF: convert _lut to float[] to reduce size by a factor of 256
Similar to commit 33a8d1c for RTL-SDR, this uses two lookups in a
256-element LUT instead of one lookup in a 65536-element LUT, which
saves a bit of CPU cache. It also eliminates a dependency on the
host's byte ordering.

Signed-off-by: Eric Wild <ewild@sysmocom.de>
2020-08-03 01:20:52 +02:00
Clayton Smith 800d2eaeaf fcd: restore support for FUNcube Dongle and Pro+
Support for the original FUNcube Dongle used to live in GNU Radio's
gr-fcd module, which was removed in version 3.8. As a result, gr-osmosdr
lost support for both FUNcube Dongle and FUNcube Dongle Pro+.

The gr-fcdproplus out-of-tree module subsequently added support for the
original FUNcube Dongle, meaning that it now supports both types. As a
result, FUNcube support can easily be restored in gr-osmosdr. The
now.

Signed-off-by: Eric Wild <ewild@sysmocom.de>

XXX
2020-08-03 01:20:52 +02:00
Clayton Smith 52fcb0935f A lot of Boost functionality is available in C++11. Since GNU Radio is moving away from Boost, it probably makes sense to do so in gr-osmosdr as well.
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>
2020-08-02 23:52:25 +02:00
Anton Blanchard 49f9b2df2a I'm using an Airspy HF+ Discovery with the Soapy driver. Whenever I turn AGC off it stops receiving samples.
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>
2020-08-02 23:50:59 +02:00
Clayton Smith 137c568c60 rtl_tcp: Throw an exception if TCP connection fails
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>
2020-08-02 23:46:14 +02:00
Piotr Krysik 8cf6840da1 cmake: Go back CMake min ver. 3.8 by removing need for CMP0079
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>
2020-08-02 22:17:05 +02:00
Sylvain Munaut f609a44177 lib/{source/sink}: Fix the set_sample_rate value return value if no change
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-02-16 09:52:00 +01:00
Clayton Smith 4d1c05e84b hackrf: replace boost::assign with C++11
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>
2020-02-16 09:52:00 +01:00
Clayton Smith ae2253c516 hackrf: allow transmit/receive switching
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>
2020-02-16 09:52:00 +01:00
Clayton Smith 96dc33adf1 airspy: fix cmake target_link_libraries
From: Clayton Smith <argilo@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-02-16 09:52:00 +01:00
Alexandru Csete 743cac795e airspyhf: Add initial support for Airspy HF+
Info: http://airspy.com/airspy-hf-plus/

From: Alexandru Csete <oz9aec@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-02-16 09:52:00 +01:00
Sylvain Munaut 5d59e56ff9 build: Update build system to GR 3.8 standards
Part of GNURadio 3.8 migration

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-02-16 09:52:00 +01:00
Sylvain Munaut 982945a477 build: Update CMakeLists.txt copyright header
Part of GNURadio 3.8 migration

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-02-16 09:51:37 +01:00
Robert Ghilduta 4d83c6067f bladerf: update bladerf to catch up with libbladeRF 2018-08-15 19:53:26 +02:00
Rey Tucker c06db96489 bladeRF: add support for biastee on bladeRF micro 2018-08-15 19:53:26 +02:00
Rey Tucker 2e2ff98c83 bladerf: remove vestigial map 2018-08-15 19:53:26 +02:00
Rey Tucker b4e69137f3 bladerf: use bladerf_get_channel_count where available 2018-08-15 19:53:26 +02:00
Rey Tucker bee32d9f0d bladerf: compatibility with older libbladeRF
Implement compatibility with older libbladeRF versions
2018-08-15 19:53:26 +02:00
Rey Tucker 8f8b137cee bladerf: add support for MIMO
Squashed commit of rtucker-bladerf-hierarchy branch:

commit 35442da7d390919f6f9cbae3f69d6dc32ca595bb
through
commit 9026136cfdbc7116f55af18cb06d1731330fa13f
2018-08-15 19:53:26 +02:00
Rey Tucker c4a0781367 bladerf_common: tweak buffer/transfer settings
Based on experimentation, a good value for transfers seems to be 16, but
more buffers are definitely warranted for an optimal default experience.
2018-08-15 19:53:26 +02:00
Ryan Tucker c8e69edb7b bladerf: add set_rx_mux_mode functionality
Also plumb through as rxmux= device argument
2018-08-15 19:53:26 +02:00
Ryan Tucker 68ba383fd5 bladerf: add firmware loopback mode 2018-08-15 19:53:26 +02:00
Ryan Tucker ea6cc4beb9 bladerf_common: add agc= option to set gain mode 2018-08-15 19:53:26 +02:00
Ryan Tucker 0132f6c494 bladerf: use nchan option to enable multi-channels
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.
2018-08-15 19:53:26 +02:00
Ryan Tucker 814fe0809c bladerf: fix get_gain_names population
Instead of haphazardly iterating through the gain strings, just use the
count returned.
2018-08-15 19:53:26 +02:00
Ryan Tucker 077697cb2d bladerf: formatting/style fixes on .h files 2018-08-15 19:53:26 +02:00
Ryan Tucker 399db91385 bladerf: formatting/consistency fixes 2018-08-15 19:53:26 +02:00
Ryan Tucker ed4dda192b bladerf_common: formatting/whitespace/consistency 2018-08-15 19:53:26 +02:00
Ryan Tucker cee878536a bladerf: replace bladerf_module with bladerf_direction
More closely matches the handling in the API
2018-08-15 19:53:26 +02:00
Ryan Tucker 07babe997d bladerf_common: cleanup on set_gain_mode
Turns out that source/sink_impl already handle the AGC->MGC gain
preservation, so this was redundant and counterproductive.

Also DRY the code a bit.
2018-08-15 19:53:26 +02:00
Ryan Tucker 3523097e00 bladeRF: fix identification of channels 2018-08-15 19:52:57 +02:00
Ryan Tucker 855ac41c12 bladeRF: remove set_bb_gain
This is not meaningful with bladeRF hardware
2018-08-15 19:52:57 +02:00
Rey Tucker 4ffccd1363 update copyright dates 2018-08-15 19:52:57 +02:00
Rey Tucker a6209e3250 formatting/wording tweaks 2018-08-15 19:52:56 +02:00
Ryan Tucker 107b35bee3 bladerf2: add get_gain_mode and set_gain_mode 2018-08-15 19:52:56 +02:00
Ryan Tucker 708096f6e4 WIP: libbladeRF rev2 refactoring etc 2018-08-15 19:52:56 +02:00
Ryan Tucker 4395c3e6c7 WIP: more port work 2018-08-15 19:52:56 +02:00
Rey Tucker 56da34f7f2 bladerf: initial support for new bladeRF hardware
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.
2018-08-15 19:52:56 +02:00
Josh Blum 0b5c3911f7 link with pthreads only when using gcc
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.
2018-08-15 19:52:23 +02:00
Dimitri Stolnikov ea1fc34766 Merge branch 'master' of git.osmocom.org:gr-osmosdr 2018-08-15 19:47:37 +02:00
Maxime Vincent c98be5dd9d Fix compilation with boost-1.67
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2018-06-17 17:56:50 +02:00
Dimitri Stolnikov ea6b356cfd Remove workaround for gnuradio bug #528 as it has been fixed in 3.7.9.1 2017-06-14 20:42:59 +02:00
Dimitri Stolnikov c653754dde Merge branch 'master' of git.osmocom.org:gr-osmosdr 2017-06-12 00:04:36 +02:00
Dimitri Stolnikov b7aab458ed freesrp: whitespace fixes 2017-06-11 23:55:17 +02:00
Lukas Lao Beyer 1693e4e9d8 FreeSRP: Add support for multiple devices in get_devices 2017-06-11 23:52:12 +02:00
Dimitri Stolnikov 3c7d3f1664 rtl,rtl_tcp: add bias=0|1 parameter to switch off|on bias voltage on
gpio0
2017-06-11 22:04:03 +02:00
Dimitri Stolnikov a3b4e5c815 rtl_tcp: delete LUT table in destructor 2017-06-11 21:42:05 +02:00
Krzysztof Halasa 26f93e4687 RTL-TCP: Convert to single class model
The existing RTL TCP driver is quite different from its brother RTL_SDR.
It's much more complicated, uses gr::blocks::deinterleave and
gr::blocks::float_to_complex, and generally doesn't work correctly
(e.g. https://github.com/csete/gqrx/issues/99
 Spectrum is mirrored when filter or demodulator changes (rtl_tcp) #99)

I've converted the RTL TCP driver to the model used by RTL_SDR,
simplifying it in the process, and fixing the GQRX issue.
2017-06-11 21:30:47 +02:00
Krzysztof Halasa 33a8d1c2ae RTL-SDR: convert _lut to float[] to reduce size by a factor of 256
The _lut is being indexed by I + Q (16 bits = 65536 entries), however
both samples can be processed independently, resulting in 8-bit LUT.
Saves a bit of RAM and CPU cache.
2017-06-11 21:30:38 +02:00