Commit Graph

420 Commits

Author SHA1 Message Date
Josh Blum cf9549485a soapy - correct constant for frequency correction
This is a typo, some modules use the "CORR" string
in the setFrequency(dir, chan, name, value) API
to perform fine frequency adjustments.
Updated modules will use setFrequencyCorrection(),
this is support for backwards compatible implementations.
2017-04-21 11:29:30 -07:00
Josh Blum 117f648859 soapy: support set/getFrequencyCorrection() API
backwards compatible changes with #ifdef
set/get_freq_corr() call directly into the SoapySDR
equivalent when supported by the API version.
2017-04-18 16:29:02 -07:00
Josh Blum b361fa5a77 soapy: support newer getSampleRateRange() API call
Switch to the newer API call which can provide a list of ranges.
There are feature detection ifdefs provided by the library
so that code will always correctly compile.
2017-04-18 16:29:02 -07:00
Josh Blum a9e536f45b soapy - check for freq corr before invoking
set_freq_corr() is often a NOP for devices.
checking avoids crashes for some applications (ex GQRX)
2017-04-18 16:29:02 -07:00
Lukas Lao Beyer 5ecfa255d2 Add support for FreeSRP
This patch adds support for both receiving and transmitting using
the FreeSRP. More information on the FreeSRP can be found at:

The gr-osmosdr blocks added make use of libfreesrp, the library
required for interfacing with this device. The libfreesrp source
code is freely available at

Usage example:

osmocom_fft -a "freesrp"
2017-04-18 23:48:08 +02:00
Dimitri Stolnikov e9dde9afd7 bladerf: discover and use Volk 2017-02-27 23:23:54 +01:00
Sylvain Munaut 71846180f5 bladeRF: Use VOLK for type conversion
Signed-off-by: Sylvain Munaut <>
2017-02-27 23:03:43 +01:00
Dimitri Stolnikov 43df1c98c4 rfspace: use boost::chrono for sleeping 2017-02-27 23:03:09 +01:00
Dimitri Stolnikov 20a5fd1a68 hackrf: correct gcc6 warnings 2017-02-27 23:01:51 +01:00
Dimitri Stolnikov 6a0cac6609 airspy: correct gcc6 warnings 2017-02-27 23:01:15 +01:00
Alexandru Csete c6ed80aea7 rtl, rtl_tcp: Use std::abs.
Fixes compile error on Mac OS X.
2017-02-27 22:29:18 +01:00
Alexandru Csete 3823c8efce Custom FIR kernels for Airspy. 2017-02-27 22:27:53 +01:00
Alexandru Csete 6ea6c19028 rfspace: Send periodic keep-alive packets.
This patch enables sending keep-alive packets at 1 minute interval to
RFSpace networked radios. Without this the TCP connection to the radio
is closed after about 5 minutes (by the OS?).
2017-02-27 22:26:26 +01:00
Alexandru Csete 0dc8154f08 rfspace: Wait 10 ms before sending queries to device.
This is necessary to esatablish a working connection to the RFSpace
CloudIQ. Without this delay the radio will not be ready and we never
receive any response to the queries and the radio will close the
connection after 5 seconds.
2017-02-27 22:26:09 +01:00
Josh Blum 2a2236cc9e soapy: support step size in gain ranges
* This change is backwards compatible and checks for API support for step size.
* Created to house common gain range functions
* Moved factory mutex declaration to common source files as well
2017-02-02 11:33:34 -08:00
Josh Blum 3511defbf4 soapy: added device::find() support
Was missing from the implementation.
Now devices with a label show up nicely in GQRX
2017-02-02 11:10:08 -08:00
Josh Blum ae686c462d soapy: support newer getBandwidthRange() API call
Switch to the newer API call which can provide a list of ranges.
There are feature detection ifdefs provided by the library
so that code will always correctly compile.
2016-06-22 18:13:11 -07:00
Josh Blum 860e9a1a72 soapy: provide default gain range step
The soapysdr range type does not provide a step size,
however apps like the osmocom siggen use this size for a slider,
and a value of zero will cause a divide by zero error.

Although many ranges are not actually linear,
the idea to provide some default step to avoid crashes.
A future addition to the API may include providing a step.
2016-06-07 13:52:52 -07:00
Josh Blum e3b6560b04 soapy: support automatic bandwidth param
When the special 0.0 bandwidth setting is used, set the filter bandwidth to rate * 0.75.
Passing automatic 0.0 bandwidth for some devices was problematic.
2016-06-07 13:45:25 -07:00
Dimitri Stolnikov 164a09fc11 airspy: Option pack={0,1} to enable USB bit packing
Patch provided by Martin Smith.

Last July there were several changes made to the Airspy firmware and
libairspy that added support for a new bit packing mode where 4 sets of
12 bit samples are packed into 3 sets of 16 bits for the transfer across
the USB bus ( ). 25% less data is
transferred across the bus and this is good for some computers with
cheap USB chipsets. There is an overhead of extra memory bandwidth
required on the host side to unpack the data into a useful format, so
for optimal performance bit packing is disabled by default.

The data is automatically unpacked within libairspy before being passed
along, so no changes are required anywhere else if packing is enabled
(or not enabled). Airspy firmware older than v1.0.0-rc6 does not have
the function, but that is detected and handled by libairspy.

I wrote the attached patch to enable packing in gr-osmosdr, which I
tested and it works. It is basically a clone of the bias=0|1 lines as
pack=0|1 and calls the needed libairspy function.


Do some Baseline test with Airspy command line tools to have something
to compare USB throughput results
$ sudo mount -t debugfs none /sys/kernel/debug
$ sudo modprobe usbmon
$ wireshark -i usbmod3 &
$ airspy_info ; sleep 120 ; \
airspy_rx -t 4 -r /dev/null -n 2400000000 ; sleep 120 ; \
airspy_rx -t 4 -r /dev/null -p 1 -n 2400000000 ; sleep 120 ; \
Wireshark->Statistics->IO Graph
The Bytes/Tick are double the actual data rate because of way wireshark
collects the USB packets, I could have added a filter to fix this. But
the relationship is valid 25% less with packing enabled. The data rate
in the IO Grahp drops from 80MB/sec (in+out) [really 40MB/sec] to
60MB/second (in+out) [really 30MB/sec] from unpacked to packed.
10MSPS no packing, packing
2.5MSPS no packing, packing

Verification test with my patched gr-osmosdr
$ sudo mount -t debugfs none /sys/kernel/debug
$ sudo modprobe usbmon
$ wireshark -i usbmod3 &
$ osmocom_fft -a "airspy=0" -s 10000000 --fft-rate=1
$ osmocom_fft -a "airspy=0,pack=1" -s 10000000 --fft-rate=1
$ osmocom_fft -a "airspy=0" -s 2500000 --fft-rate=1
$ osmocom_fft -a "airspy=0,pack=1" -s 2500000 --fft-rate=1
$ osmocom_fft -a "airspy=0" -s 2500000 --fft-rate=1
$ osmocom_fft -a "airspy=0,pack=0" -s 2500000 --fft-rate=1

I ran all of the above tests and the wireshark USB throughput graphs
showed exactly what was expected.

25% less when packing was enabled and if you did not specify the
"pack=1", then no bit packing is performed by libairspy. All the
magnitudes within the FFT windows looked exactly the same as they do
without bit packing.
2016-02-28 17:52:01 +01:00
Dimitri Stolnikov b206a90f49 apps: implement --peak-hold option for fft 2016-02-28 17:50:54 +01:00
Dimitri Stolnikov e6f46a1c04 apps: added --clock-source option to fft and siggen 2016-02-28 17:46:55 +01:00
Dimitri Stolnikov 2b79811350 bladerf: implement options for clock configuration
Since firmware 2016.01-rc1 bladeRF has the ability to lock to an
external reference as well as produce arbitrary frequency signal
(25 MHz here) on its clock output.

Use gr-osmosdr source with the following arguments to produce 25
MHz on the SMB connector:

osmocom_fft -a bladerf,smb=25e6


To lock the bladeRF itself to an external GPSDO reference, use
additional arguments tamer=external for 10MHz or tamer=external_1pps for
1PPS GPSDO signals.

osmocom_fft -a bladerf,smb=25e6,tamer=external


The described method requires

Carefully *read the instructions for external reference locking*
(especially max allowed voltage levels) on Nuand's blog https://
2016-02-28 17:45:54 +01:00
Jiří Pinkava d230397957 allow both 3.7.* and git version of GnuRadio 2016-02-28 17:27:37 +01:00
Jiří Pinkava ac15e7897b do not check for NULL before calling free 2016-01-10 22:48:31 +01:00
Dimitri Stolnikov e321095445 airspy: implement sensitivity and linerity gain profiles for set_gain()
use them with airspy,linearity (the default) or airspy,sensitivity
device arguments. Range is 0 to 21. Named gains still work as before.

Requires libairspy commit dc5cbca2f6f03458c40eab7c0f88fdfed60a08ff
2016-01-10 22:33:55 +01:00
Dimitri Stolnikov da2cf6a6f2 cmake: update component name & update AUTHORS file 2016-01-10 22:28:15 +01:00
Dimitri Stolnikov 64cfd98c5b grc: update grc generator 2016-01-10 22:27:42 +01:00
Dimitri Stolnikov 11257d0aa6 add Red Pitaya discovery in device find function 2016-01-10 22:19:13 +01:00
Dimitri Stolnikov 3fda9d6be5 cmake: If we are cross compiling, we shouldn't make decisions based on
the build system distribution.

Signed-off-by: Philip Balister <>
2016-01-10 22:17:09 +01:00
Marcus Müller 20a5986ca0 made siggen cooperate with sinks without bw range 2016-01-10 22:12:25 +01:00
Marcus Müller 84249efbea added file_sink_c 2016-01-10 22:12:19 +01:00
Pavel Demin f8cba954f0 redpitaya: fix compilation errors on MS Windows and on Mac OS X 2016-01-10 22:05:53 +01:00
Pavel Demin 810a981d0c redpitaya: change base class to gr::sync_block 2015-12-21 19:27:38 +01:00
Dimitri Stolnikov 55fe961987 update documentation 2015-12-18 22:20:27 +01:00
Pavel Demin 3582ba17e0 redpitaya: add support for Red Pitaya SDR transceiver
This patch adds two gr-osmosdr blocks that can be used with the SDR transceiver
application available from the Red Pitaya application marketplace:

These new source and sink blocks are based on the file block with some pieces
borrowed from the rtl_tcp block.

More details about Red Pitaya SDR transceiver can be found at:

Usage example:

osmocom_fft -a "redpitaya="

Signed-off-by: Pavel Demin <>
2015-12-18 22:02:25 +01:00
Alexandru Csete 7cec4c0f51 rfspace: Add basic Cloud-IQ support.
Cloud-IQ uses essentially the NetSDR protocol with different sample
rates and product ID.
2015-12-10 20:54:26 +01:00
Dimitri Stolnikov 2ca720cfee hackrf: change hackrf i/o from default char to explicit int8_t
original patch provided via github by Dirk Grunwald
2015-12-07 20:37:32 +01:00
Dimitri Stolnikov 69ec75a0b4 hackrf: since devicecount is signed, make comparisons signed as well 2015-12-07 20:27:02 +01:00
Dimitri Stolnikov 3198eb927a Merge remote-tracking branch 'origin/soapy_support' 2015-12-07 20:19:36 +01:00
Josh Blum c804460f5d provide NAN define for MSVC older than VC12
This fixes a minor compile issue on VC11 and below
where and use the float NAN define.
The patch simply defines the NAN macro conditionally,
in a common header (which seemed like the best place).
2015-12-06 17:10:25 -08:00
Josh Blum 9ceadfb645 rtl_tcp: fix ssize_t definition for MSVC
This was actually causing a cryptic compile error because of the define.
The fix was to typedef ssize_t as ptrdiff_t, the same as bladerf_common.h
2015-12-06 15:49:44 -08:00
Josh Blum b3d915f591 soapy: do not throw when IQ bal mode is set to off
The automatic IQ balance mode is not supported,
but we should not throw when it is set to disabled.
Setting to disabled is techinically allowable,
and currently throwing is disruptive for users.
2015-12-06 15:19:26 -08:00
Jon Szymaniak 86ad584204 bladeRF: Support opening via a (subset of a) serial number, using any backend
The bladerf=X,[arguments] string now supports the following, where X is:

    - The "device instance" which represents the Nth bladeRF connected.
      This is 0-indexed, in the order displayed by `bladeRF-cli --probe`.

    - The device's serial number.
        For libbladeRF >= 1.4.1, a subset of the serial number is
        supported. The subset must be at least the first three
        characters of the serial number.

The backend specifier has been changed from "libusb" to the wildcard
("*"), allowing any available backend to be used.
2015-07-17 17:09:30 +02:00
Jon Szymaniak 43a00ae785 bladeRF: Added SOB/EOB stream tag handling support to bladerf_sink
When running with metadata mode enabled, the bladerf_sink supports 'tx_sob' and
'tx_eob' stream tags. Anything not in the burst will be dropped, and a warning
will be printed.

Use of the bladeRF metadata can be enabled via a 'enable_metadata'
device argument. If running full-duplex, this must be provided to both
the source and the sink. This does not currently any additional features
to the sink.
2015-07-17 17:09:23 +02:00
Utomnia ac1d8ec02d bug fixes 2015-07-16 19:35:18 +02:00
Dimitri Stolnikov 46e95395e0 cmake: move check for hackrf_device_list to hackrf subdirectory 2015-06-06 22:01:33 +02:00
Dimitri Stolnikov f33f30815a hackrf: use #ifdef just like in hackrf_sink_c 2015-06-01 22:24:32 +02:00
Heikki Hannikainen 2bcd86e55e Pass LIBHACKRF_HAVE_DEVICE_LIST to a #define
Signed-off-by: Heikki Hannikainen <>
2015-06-01 22:01:02 +02:00
Heikki Hannikainen dd6690b6ca hackrf: Add cmake magic to figure out if multiple devices support is available in libhackrf, so that backwards compatibility with old libhackrf is maintained.
Signed-off-by: Heikki Hannikainen <>
2015-06-01 22:01:02 +02:00