Multiple Airspys Trunk-Recorder

Status
Not open for further replies.

blantonl

Founder and CEO
Staff member
Super Moderator
Joined
Dec 9, 2000
Messages
11,244
Location
San Antonio, Whitefish, New Orleans
Does anyone know how to specify multiple AirSpy receivers with trunk-recorder?

I've tried:

airspy=1
airspy,device_id=1

This doesn't work... they all default to the first instance. Any ideas?
 

mtindor

OH/WV DB Admin
Database Admin
Joined
Dec 5, 2006
Messages
10,863
Location
Carroll Co OH / EN90LN
Good question. Ive been wondering the same thing. I don't have my second one in stalled yet, but trying to config in preparation.

mike
 

10-75

Member
Feed Provider
Joined
Jan 20, 2004
Messages
97
Location
New York
Lindsay, If I remember correctly,

driver=airspy,serial=b5ac67dc:30134a13

I hope you have a beefy PC as they are CPU hungry....
 

mtindor

OH/WV DB Admin
Database Admin
Joined
Dec 5, 2006
Messages
10,863
Location
Carroll Co OH / EN90LN
That doesn't seem to be working either. That looks like a GQRX device string.

Lindsay, did you ever figure out the proper way to set gain on Airspys when running Trunk Recorder? Just curious. I have it working, but it's not by using what one would think is correct (lnaGain, ifGain, and MixGain). Using just "gain" seems pretty damned random, as you have to guess what the gain value might be. And I've seen some using 21, or 45, or 530 for a gain value.

As for specifying which airspy to use, I don't think there is any support for that anywhere in the osmosdr stuff. At least from the documentation that I can see, if using the osmosdr driver, the only things you could set are bias=1|0 (bias tee support) and pack=1|0 (bit packing).

mike
 

mtindor

OH/WV DB Admin
Database Admin
Joined
Dec 5, 2006
Messages
10,863
Location
Carroll Co OH / EN90LN
It's pretty much confirmed I believe that gain=## is the only parameter supported, and that a valid value is between 1-21 I believe.

Ok, thanks. I recognize the "21" value. I'm used to SDR# + Airspy and settings LNA/IF/MIX myself, but I do recall that at some point SDR# added an option to use one option to set the gain with values from 1-21. Must be where that came from. I was using gain=54 (and it worked), but who knows what gain was really set when specified above 21.

Mike
 

10-75

Member
Feed Provider
Joined
Jan 20, 2004
Messages
97
Location
New York
That doesn't seem to be working either. That looks like a GQRX device string.

Sorry, I meant to post this: "device": "airspy", b5ac67dc:30134a13" or possibly "device": "airspy", serialNumber : b5ac67dc:30134a13" one or both of these worked.... I can't find the config json that I used to confirm it....
 

PiccoIntegra

Member
Joined
Dec 19, 2002
Messages
530
Location
North Texas
Try "driver": "osmosdr" and "device": "airspy=yourserialnumber". Both devices will need to run at the same exact sample rate.

It's been a couple of years since I've messed with trunk-recorder. But I do remember it uses the osmosdr front end..
 

lukekb

Member
Joined
Sep 4, 2013
Messages
59
We have been trying to get all of the AirSpy Gain settings to work. I don't have one to test with though. I just accepted a Pull request that might help. There is a thread here talking about, join in after you give the updated code a try.


I am using the gr-osmosdr drivers... and it is not clear if multiple AirSpys can be support. If so, I think it would be in the device string, which gets passed to the gr-osmosdr driver. Checking the code, it does look like passing the Device ID is supported: osmocom/gr-osmosdr
 

gofasters4

Member
Joined
Jul 24, 2018
Messages
66
I only have one Airspy on this system but my sources block contains:

Code:
      "driver": "osmosdr",
      "device": "airspy",
      "serialNumber": "624064EA1459A5E8"
 

lukekb

Member
Joined
Sep 4, 2013
Messages
59
I think if the source block is configured with:
Code:
      "driver": "osmosdr",
      "device": "airspy=624064EA1459A5E8"
I do something similar with the RTL-SDR dongles and it works.
 

blantonl

Founder and CEO
Staff member
Super Moderator
Joined
Dec 9, 2000
Messages
11,244
Location
San Antonio, Whitefish, New Orleans
I'm not sure either of these suggestions are working either, because with just one airspy in the system, it doesn't fail by specifying an invalid serial number.

I'm building a new, more powerful ingest box and will test with multiple airspy's but I might just go the route of an airspy and a HackRF until we can get definitive confirmation of a solution for multiple airspys.
 

mtindor

OH/WV DB Admin
Database Admin
Joined
Dec 5, 2006
Messages
10,863
Location
Carroll Co OH / EN90LN
I'm not sure either of these suggestions are working either, because with just one airspy in the system, it doesn't fail by specifying an invalid serial number.

I'm building a new, more powerful ingest box and will test with multiple airspy's but I might just go the route of an airspy and a HackRF until we can get definitive confirmation of a solution for multiple airspys.

I don't have two Airspys free to test. But the osmocom / gr-osmosdr stuff suggests there is no option


AirSpy Source

ArgumentNotes
airspy Use this argument without a value
bias=1|0 Enable or disable DC bias at the antenna input
pack=1|0 Enable or disable packed USB transmission

But my guess would be that just like when you configure multiple RTL dongles in the source section with multiple {blah blah} stanzas, perhaps if you do the same with the Airspys, it would likely snatch the first Airspy it sees for the first source and the second AIrspy it sees for the second source.

Mike
 

gofasters4

Member
Joined
Jul 24, 2018
Messages
66
This piqued my curiosity so I turned to Google.
Back in 2016, a patch to gr-osmosdr was submitted to support multiple Airspy devices. Seems that as of gr-osmosdr 0.1.5 (Nov 2019), it has not been accepted.
I applied the patch and rebuilt trunk-recorder against the new library. Now it does error & abort if a non-existent Airspy serial number is defined. Briefly tested with one and two Airspy sources. trunk-recorder opened one, or both simultaneously without error.

trunk-recorder config:
"sources": [ { ... "driver": "osmosdr", "device": "airspy=0x644064DC2369A5CB" },

console output:
[2020-02-02 20:21:21.622142] (info) Source Device: airspy=0x644064DC2369A5CB gr-osmosdr 0.1.5 (0.1.5) gnuradio 3.7.11 built-in source types: file fcd rtl rtl_tcp uhd hackrf rfspace airspy soapy redpitaya Attempting to open airspy by s/n= 0x644064DC2369A5CB Opened Device Serial Number= 0x644064DC2369A5CB Using AirSpy NOS v1.0.0-rc10-0-g946184a 2016-09-19, samplerates: 2.5M 10M [2020-02-02 20:21:21.652242] (info) SOURCE TYPE OSMOSDR (osmosdr) [2020-02-02 20:21:21.652272] (info) Setting sample rate to: 10000000 [2020-02-02 20:21:21.660473] (info) Actual sample rate: 10000000
 

ka3jjz

Wiki Admin Emeritus
Joined
Jul 22, 2002
Messages
25,595
Location
Bowie, Md.
Again, if no one answers here, this is really the best place to go


Mike
 

blantonl

Founder and CEO
Staff member
Super Moderator
Joined
Dec 9, 2000
Messages
11,244
Location
San Antonio, Whitefish, New Orleans
I can confirm that this patch does indeed allow for mutiple airspy support and works great. I've tested on a Mac Mini with 2 Airspy Minis and 1 regular airspy.

I got it working by downloading the source for gr-osmosdr 0.1.5 and patching the airspy_source_c.cc with the following patch

Edit: Note that this also works with the latest master branch of gr-osmosdr.

Code:
diff --git a/lib/airspy/airspy_source_c.cc b/lib/airspy/airspy_source_c.cc
index 25f73d4..52b1d81 100644
--- a/lib/airspy/airspy_source_c.cc
+++ b/lib/airspy/airspy_source_c.cc
@@ -90,12 +90,25 @@ airspy_source_c::airspy_source_c (const std::string &args)
     _vga_gain(0),
     _bandwidth(0)
{
-  int ret;

+  int ret;
+  _dev = NULL;
   dict_t dict = params_to_dict(args);

-  _dev = NULL;
-  ret = airspy_open( &_dev );
+  // the block below allows one to open airspy by serial number
+  // 2016-Apr-5 - by Lawrence Glaister VE7IT  ve7it@shaw.ca
+  // (allowing multiple airspy source blocks to be used) Note: each airspy should be
+  // plugged into its own USB bus controller to support the high data rates involved.
+  // osmocom Source block usage: Device arguments:  airspy=0x644064DC317C1FCD
+  // if no device arguments are given or s/n=0, the first found airspy device will be used
+  // use airspy_info utility to identify device serial number strings
+  uint64_t sn;
+  std::stringstream ss;
+  ss << std::hex << dict["airspy"];
+  ss >> sn;
+  std::cerr << "Attempting to open airspy by s/n= "
+            <<  boost::format("0x%016X") % (sn) << std::endl;
+  ret = airspy_open_sn( &_dev, sn );
   AIRSPY_THROW_ON_ERROR(ret, "Failed to open AirSpy device")

   uint8_t board_id;
@@ -106,11 +119,15 @@ airspy_source_c::airspy_source_c (const std::string &args)
   memset(version, 0, sizeof(version));
   ret = airspy_version_string_read( _dev, version, sizeof(version));
   AIRSPY_THROW_ON_ERROR(ret, "Failed to read version string")
-#if 0
+
   airspy_read_partid_serialno_t part_serial;
   ret = airspy_board_partid_serialno_read( _dev, &part_serial );
   AIRSPY_THROW_ON_ERROR(ret, "Failed to read serial number")
-#endif
+  std::cerr << "Opened Device Serial Number=    "
+    << boost::format("0x%08X") % (part_serial.serial_no[2])
+    << boost::format("%08X")   % (part_serial.serial_no[3])
+    << std::endl;
+
   uint32_t num_rates;
   airspy_get_samplerates(_dev, &num_rates, 0);
   uint32_t *samplerates = (uint32_t *) malloc(num_rates * sizeof(uint32_t));

Download the source for gr-osmosdr 0.1.5 here:


untar and copy the patch file to lib/airspy/airspy_source_c.cc.patch

patch with:

patch -ruN -d . < airspy_source_c.cc.patch

Compile and install the patched gr-osmosdr for your platform
 

Attachments

  • airspy_patch.bin.zip
    1.8 KB · Views: 20
Last edited:
Status
Not open for further replies.
Top