Commit Graph

405 Commits

Author SHA1 Message Date
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 ( https://i.imgur.com/qXnWoEK.png?1 ). 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.

ref:
https://github.com/airspy/firmware/commit/7e1806b
https://github.com/airspy/firmware/commit/5b7dcab
https://github.com/airspy/host/commit/a51eccb

---
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 ; \
airspy_info
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 https://i.imgur.com/pA9LPdE.png?1
2.5MSPS no packing, packing https://i.imgur.com/lA8q5aq.png?1

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.
40MB/sec(10MSPS+normal),30MB/sec(10MSPS+packing),10MB/sec(2.5MSPS
+normal),7.5MB/sec(2.5MSPS+packing),10MB/sec(2.5MSPS+normal),10MB/
sec(2.5MSPS+normal).

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

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

tamer={internal,external_1pps,external}

The described method requires https://github.com/Nuand/bladeRF/releases/
tag/2016.01-rc1

Carefully *read the instructions for external reference locking*
(especially max allowed voltage levels) on Nuand's blog https://
www.nuand.com/blog/2016-01-rc1-release/
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 <philip@balister.org>
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:

http://bazaar.redpitaya.com

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:

http://pavel-demin.github.io/red-pitaya-notes/sdr-transceiver

Usage example:

osmocom_fft -a "redpitaya=192.168.1.100:1001"

Signed-off-by: Pavel Demin <pavel.demin@uclouvain.be>
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 source_impl.cc and sink_impl.cc 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 <hessu@hes.iki.fi>
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 <hessu@hes.iki.fi>
2015-06-01 22:01:02 +02:00
Heikki Hannikainen 254e1b1981 hackrf_source: adjust error message
Signed-off-by: Heikki Hannikainen <hessu@hes.iki.fi>
2015-06-01 22:01:02 +02:00
Heikki Hannikainen e847176f3e hackrf_source: Support selecting device with index number (hackrf=0)
Signed-off-by: Heikki Hannikainen <hessu@hes.iki.fi>
2015-06-01 22:01:02 +02:00
Heikki Hannikainen dd6536757a hackrf_sink_c: device enumeration
Signed-off-by: Heikki Hannikainen <hessu@hes.iki.fi>
2015-06-01 22:01:02 +02:00
Heikki Hannikainen 485b02e615 hackrf device enumeration: Use only 6 characters of serial (should be unique per user?) and append it in device name
Signed-off-by: Heikki Hannikainen <hessu@hes.iki.fi>
2015-06-01 22:01:02 +02:00
Heikki Hannikainen 592a814bdb hackrf_source: Truncate serial numbers to 16 chars when enumerating, parse USB board IDs correctly
Signed-off-by: Heikki Hannikainen <hessu@hes.iki.fi>
2015-06-01 22:01:01 +02:00
Heikki Hannikainen 8e6ecd0644 hackrf_source: attempt device enumeration with hackrf_device_list
Signed-off-by: Heikki Hannikainen <hessu@hes.iki.fi>
2015-06-01 22:01:01 +02:00
Heikki Hannikainen 69181b0e85 hackrf_sink: support hackrf_open_by_serial
Signed-off-by: Heikki Hannikainen <hessu@hes.iki.fi>
2015-06-01 22:01:01 +02:00
Heikki Hannikainen 5dca656745 style update to match surroundings
Signed-off-by: Heikki Hannikainen <hessu@hes.iki.fi>
2015-06-01 22:01:01 +02:00
Heikki Hannikainen d4387f436d Require hackrf argument to have a non-zero-length value to trigger serial number search
Signed-off-by: Heikki Hannikainen <hessu@hes.iki.fi>
2015-06-01 22:01:01 +02:00
Heikki Hannikainen 9595b044b6 hackrf: support for hackrf_open_by_serial in hackrf source
Signed-off-by: Heikki Hannikainen <hessu@hes.iki.fi>
2015-06-01 22:01:01 +02:00
Marcus Müller b3fdf5b83d Fix config error with CMake version 2.8.7
Replace find_package(SoapySDR CONFIG) with find_package(SoapySDR NO_MODULE),
which has an identical effect but is supported by CMake 2.8.7 on Ubuntu 12.10
2015-05-27 23:56:48 +02:00
Dimitri Stolnikov 5943919828 hackrf: introduce bias=0|1 and bias_tx=0|1 parameters
... to support antenna/phantom power via a new device argument "bias"
(to match Airspy's existing bias power syntax). 0=disable and 1=enable.
I also added a device argument to control bias power at transmit time. I
named this option differently - "bias_tx" - to avoid accidentally
enabling bias power in transmit mode when an LNA may be attached in an
input amplifier configuration.

Original patch provided by Brad Hein
2015-05-27 23:55:00 +02:00
Dimitri Stolnikov 44c223cb5d updated MANIFEST.md 2015-05-14 00:22:39 +02:00
Dimitri Stolnikov 4582df6111 add MANIFST.md for cgran.org 2015-05-14 00:11:01 +02:00
Dimitri Stolnikov 275e6aed19 airspy: comment on used gain values 2015-05-13 00:16:54 +02:00