ast / SoapyAirspy

Soapy SDR plugin for the Airspy
https://github.com/pothosware/SoapyAirspy/wiki
MIT License
4 stars 4 forks source link

Information on the Nov 5 release #2

Open janvgils opened 1 year ago

janvgils commented 1 year ago

Build information:

cd source/git/ast/SoapyAirspy/
git pull
cd build
cmake -Wno-dev ../
make
sudo cp libairspySupport.so /usr/lib/x86_64-linux-gnu/SoapySDR/modules0.7/libairspySupport.so
sudo systemctl restart satnogs-client

This release info is shown as:

SoapySDRUtil --info
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

Lib Version: v0.7.2-2
API Version: v0.7.1
ABI Version: v0.7
Install root: /usr
Search path:  /usr/lib/x86_64-linux-gnu/SoapySDR/modules0.7
Module found: /usr/lib/x86_64-linux-gnu/SoapySDR/modules0.7/libairspySupport.so  (0.2.0-3d5e8c5)

Created some SatNOGS observations, and the first that we can see, that there are debug messages available. The serial output doesn't seem to be correct and this can have issues when running multiple Airspy devices connected to the same system.

Nov 05 09:41:37 exomars satnogs-client[154968]: [DEBUG] Found AirSpy device: serial =         306b65c7
Nov 05 09:41:37 exomars satnogs-client[154968]: [DEBUG] SoapyAirspy::SoapyAirspy(biastee) = true
Nov 05 09:41:37 exomars satnogs-client[154968]: [INFO] airspy_set_rf_bias(1)
Nov 05 09:41:37 exomars satnogs-client[154968]: [INFO] airspy_set_rf_bias(1)
Nov 05 09:41:37 exomars satnogs-client[154968]: [INFO] Using format CF32.
Nov 05 09:41:37 exomars satnogs-client[154968]: [DEBUG] sample type: 0, sample size 8
Nov 05 09:41:37 exomars satnogs-client[154968]: [DEBUG] setGainMode(0)
Nov 05 09:41:37 exomars satnogs-client[154968]: [DEBUG] SoapyAirspy::setAntenna(RX)

The observation using the R2 at 2.5e6 sample rate shows similar vertical lines like with the first release https://network.satnogs.org/observations/6701815/

R2: airspy_info output

airspy_info 
airspy_lib_version: 1.0.11

Found AirSpy board 1
Board ID Number: 0 (AIRSPY)
Firmware Version: AirSpy NOS v1.0.0-rc10-6-g4008185 2020-05-08
Part ID Number: 0x6906002B 0x00000030
Serial Number: 0x466C64C8306B65C7
Supported sample rates:
    10.000000 MSPS
    2.500000 MSPS
Close board 1
ast commented 1 year ago

Thanks for the comprehensive testing. Regarding the spectrum peaks "lines", are you able to use this exact R2 device with another driver (for example gr-osmosdr) and then don't have any lines? It looks an awfully lot like a hardware problem.

janvgils commented 1 year ago

If you look at earlier observation that use the PothosWare master branch you don't see these lines, so I don't think this is a hardware issue. Here an example of a earlier observation https://network.satnogs.org/observations/6699198/

janvgils commented 1 year ago

An example of a observation done with a Airspy mini:

https://network.satnogs.org/observations/6701751/

Nov 05 10:26:40 canberra satnogs-client[125933]: [DEBUG] Found AirSpy device: serial =         3670830b
Nov 05 10:26:40 canberra satnogs-client[125933]: [DEBUG] SoapyAirspy::SoapyAirspy(biastee) = true
Nov 05 10:26:40 canberra satnogs-client[125933]: [INFO] airspy_set_rf_bias(1)
Nov 05 10:26:40 canberra satnogs-client[125933]: [INFO] airspy_set_rf_bias(1)
Nov 05 10:26:40 canberra satnogs-client[125933]: [INFO] Using format CF32.
Nov 05 10:26:40 canberra satnogs-client[125933]: [DEBUG] sample type: 0, sample size 8
Nov 05 10:26:40 canberra satnogs-client[125933]: [DEBUG] setGainMode(0)
Nov 05 10:26:40 canberra satnogs-client[125933]: [DEBUG] SoapyAirspy::setAntenna(RX)

I think the gain isn't set by this driver.

Driver settings set:

SATNOGS_SOAPY_RX_DEVICE="driver=airspy,serial=4a464c83670830b,biastee=true"
SATNOGS_RX_SAMP_RATE="3e6"
SATNOGS_GAIN_MODE="Settings Field"
SATNOGS_ANTENNA="RX"
SATNOGS_OTHER_SETTINGS="LNA=12,MIX=8,VGA=11"

Airspy Mini airspy_info:

airspy_info 
airspy_lib_version: 1.0.11

Found AirSpy board 1
Board ID Number: 0 (AIRSPY)
Firmware Version: AirSpy MINI v1.0.0-rc10-6-g4008185 2020-05-08
Part ID Number: 0x6906002B 0x00000030
Serial Number: 0x04A464C83670830B
Supported sample rates:
    6.000000 MSPS
    3.000000 MSPS
Close board 1
ast commented 1 year ago

If possible switch between old and new driver version and make observation at about the same time with exactly the same setup.

Try to create different issues for the R2 and Mini as they are similar but not the same.

It could be something with the default gain settings.

janvgils commented 1 year ago

I need to give this some thought, if it is possible to use the same driver and gnuradio configuration as used by the SatNOGS client.

The SatNOGS fsk flowgraph

image

janvgils commented 1 year ago

For now I have moved back to the PothosWare master branch.

ast commented 1 year ago

And with that branch you don't get any "lines" with the R2 under similar conditions?

janvgils commented 1 year ago

Indeed, with that branch I don't have these lines.

janvgils commented 1 year ago

But there is another development,

I tried another gain settings with the R2 based on this article https://wiki.satnogs.org/Software_Defined_Radio#Airspy_support I replaced:

SATNOGS_GAIN_MODE="Settings Field"
SATNOGS_OTHER_SETTINGS="LNA=12,MIX=8,VGA=11"

With:

SATNOGS_GAIN_MODE="Overall"
SATNOGS_RF_GAIN="24"

And then all libairspySupport.so drivers give vertical lines. These are the main package maintainer driver and the master branch, so this could also be related to how gain variables are passed along to the driver.

What are you currently using to set the gain?

janvgils commented 1 year ago

After modifying the Settings.cpp with MIX instead of LIX I did a new build and installed the library.

This debug output is a bit confusing, setGainMode(1) and almost immediate setGainMode(0)

Nov 06 18:17:35 exomars satnogs-client[22263]: [DEBUG] Found AirSpy device: serial =         306b65c7
Nov 06 18:17:35 exomars satnogs-client[22263]: [DEBUG] SoapyAirspy::SoapyAirspy(biastee) = true
Nov 06 18:17:35 exomars satnogs-client[22263]: [INFO] airspy_set_rf_bias(1)
Nov 06 18:17:35 exomars satnogs-client[22263]: [DEBUG] setGainMode(1)
Nov 06 18:17:35 exomars satnogs-client[22263]: [INFO] airspy_set_rf_bias(1)
Nov 06 18:17:35 exomars satnogs-client[22263]: [INFO] Using format CF32.
Nov 06 18:17:35 exomars satnogs-client[22263]: [DEBUG] sample type: 0, sample size 8
Nov 06 18:17:35 exomars satnogs-client[22263]: [DEBUG] setGainMode(0)
Nov 06 18:17:35 exomars satnogs-client[22263]: [DEBUG] SoapyAirspy::setAntenna(RX)

Is there any additional information on these debug messages?

ast commented 1 year ago

Thanks again for the comprehensive report!

I'm pretty sure now your problems are related to the gains. I have been concentrating on getting handling the samples as fast as possible, as this was the hard part. I'm satisfied with the result, so now is a good time to get the gains right.

The Airspy R2/mini have two ways of setting gains. You can either set them individually or as a linear combination. I guess that's what SatNog calls overall gain. You can check the API here https://github.com/airspy/airspyone_host/blob/master/libairspy/src/airspy.h

I will take a look at this as soon as I'm able. I have a toddler at home, so time is a bit limited.

ast commented 1 year ago

There is now a gainmode=0, 1 or 2 to select the gain mode.

janvgils commented 1 year ago

Can you elaborate a bit more on how this will be configured?

I get the feeling, also looking at the airspy.h file that 0 is off, 1 is automatic and 2 is manual?

But we are now also in the realm where the Airspy gain function have never been fully supported within the Soapy solution, similar to my long awaiting option to support serial number that opens up multi Airspy support. It is only the master branch that has this option.

Will you at the end strife towards all these native gain options?

/* Parameter value shall be between 0 and 15 */
extern ADDAPI int ADDCALL airspy_set_lna_gain(struct airspy_device* device, uint8_t value);

/* Parameter value shall be between 0 and 15 */
extern ADDAPI int ADDCALL airspy_set_mixer_gain(struct airspy_device* device, uint8_t value);

/* Parameter value shall be between 0 and 15 */
extern ADDAPI int ADDCALL airspy_set_vga_gain(struct airspy_device* device, uint8_t value);

/* Parameter value:
    0=Disable LNA Automatic Gain Control
    1=Enable LNA Automatic Gain Control
*/
extern ADDAPI int ADDCALL airspy_set_lna_agc(struct airspy_device* device, uint8_t value);
/* Parameter value:
    0=Disable MIXER Automatic Gain Control
    1=Enable MIXER Automatic Gain Control
*/
extern ADDAPI int ADDCALL airspy_set_mixer_agc(struct airspy_device* device, uint8_t value);

/* Parameter value: 0..21 */
extern ADDAPI int ADDCALL airspy_set_linearity_gain(struct airspy_device* device, uint8_t value);

/* Parameter value: 0..21 */
extern ADDAPI int ADDCALL airspy_set_sensitivity_gain(struct airspy_device* device, uint8_t value);
janvgils commented 1 year ago

Debug information on the Nov 7th release

Configuration options:

SATNOGS_SOAPY_RX_DEVICE="driver=airspy,serial=466c64c8306b1234,gainmode=2,biastee=true"
SATNOGS_RX_SAMP_RATE="2.5e6"
SATNOGS_GAIN_MODE="Settings Field"
SATNOGS_OTHER_SETTINGS="LNA=9,MIX=6,VGA=11"
Nov 07 22:06:22 exomars satnogs-client[41121]: [DEBUG] Found AirSpy device: serial =         306b1234
Nov 07 22:06:22 exomars satnogs-client[41121]: [DEBUG] SoapyAirspy::SoapyAirspy(biastee) = true
Nov 07 22:06:22 exomars satnogs-client[41121]: [INFO] airspy_set_rf_bias(1)
Nov 07 22:06:22 exomars satnogs-client[41121]: [DEBUG] setGainMode(1)
Nov 07 22:06:22 exomars satnogs-client[41121]: [INFO] airspy_set_rf_bias(1)
Nov 07 22:06:22 exomars satnogs-client[41121]: [INFO] Using format CF32.
Nov 07 22:06:22 exomars satnogs-client[41121]: [DEBUG] sample type: 0, sample size 8
Nov 07 22:06:22 exomars satnogs-client[41121]: [DEBUG] setGainMode(0)
Nov 07 22:06:22 exomars satnogs-client[41121]: [DEBUG] SoapyAirspy::setAntenna(RX)

Still some confusion on the serial part and setGainMode (1) and the setGainMode(0)

janvgils commented 1 year ago

Soapy driver information update:

SoapySDRUtil --probe="driver=airspy"
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

Probe device driver=airspy
[DEBUG] Found AirSpy device: serial = 466c64c8306b65c7
[DEBUG] setGainMode(0)

----------------------------------------------------
-- Device identification
----------------------------------------------------
  driver=Airspy
  hardware=Airspy
  serial=466c64c8306b65c7

----------------------------------------------------
-- Peripheral summary
----------------------------------------------------
  Channels: 1 Rx, 0 Tx
  Timestamps: NO
  Other Settings:
     * Bias tee - Enable the 4.5v DC Bias tee to power SpyVerter / LNA / etc. via antenna connection.
       [key=biastee, default=false, type=bool]
     * Bit pack - Enable packing 4 12-bit samples into 3 16-bit words for 25% less USB trafic.
       [key=bitpack, default=false, type=bool]
     * Gain Mode - 0 = linearity, 1 = sensitivity, 2 = manual
       [key=gainmode, default=0, type=int]

----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
  Full-duplex: YES
  Supports AGC: YES
  Stream formats: CS16, CF32
  Native format: CS16 [full-scale=32767]
  Antennas: RX
  Full gain range: [0, 21] dB
    LIN gain range: [0, 21] dB
  Full freq range: [24, 1800] MHz
    RF freq range: [24, 1800] MHz
  Sample rates: 2.5, 10 MSps
  Filter bandwidths: 2.25, 9 MHz

Looking at this output I was looking for the gain options that can be configured: Are the following examples the ones that can be used/configured?

"driver=airspy,serial=466c64c8306b1234,biastee=1,gainmode=0,lin=10"

"driver=airspy,serial=466c64c8306b1234,biastee=1,gainmode=1,sen=10"

"driver=airspy,serial=466c64c8306b1234,biastee=1,gainmode=2,lna=9,mix=6,vga=11"

janvgils commented 1 year ago

Drivers operations.

Both https://network.satnogs.org/observations/?station=1466 R2 and https://network.satnogs.org/observations/?station=2173 Mini have now been running for 24 hours, follow the link and look at the observations and waterfall.

There are some more tests that I want do but then I need some confirmation on my questions regarding the gain options. When these are clear I also want to check gainmode=0 and 1 and maybe also combine Airspy devices and see if the serial functions is working.

Lets keep in contact.