myriadrf / libxtrx

High-level XTRX API library
Apache License 2.0
28 stars 27 forks source link

Setting global gain does not work with SoapySDR API #6

Open pjalocha opened 5 years ago

pjalocha commented 5 years ago

while setting individual element gains does work as expected. Did anybody notice, can confirm and/or correct ?

Pawel.

nunnsy commented 5 years ago

Whenever probing a receive channel's overall gain, I only ever get 12 dB when I set it to all manner of different values. The XTRX logs themselves confirm the requested gain was correctly interpreted.

...
08:34:17.272022 INFO:   [LSM7] USB3_2/1/4: SXR: VCO2 [199;218] -> 208
08:34:17.272669 INFO:   [LMSF] USB3_2/1/4: NCO ch=2 type=3 freq=0
[SDR: XTRX (R)] [CHAN 1] Actual Frequency: 1875000000.000000
[SDR: XTRX (R)] [CHAN 1] Setting Gain Mode (Automatic): 0
[SDR: XTRX (R)] [CHAN 1] Actual Gain Mode (Automatic): 0
[SDR: XTRX (R)] [CHAN 1] Setting Gain: 40.000000
08:34:17.272883 INFO:   [LMSF] USB3_2/1/4: Set gain 40.0 to 0 on 2 channel
08:34:17.273172 INFO:   [LSM7] USB3_2/1/4: RFE: set_lna(0 -> 0) => 15
[SDR: XTRX (R)] [CHAN 1] Actual Gain: 12.000000
08:34:17.274719 INFO:   [CTRL] USB3_2/1/4: RFIC_GPIO 0x000300
08:34:17.276935 INFO:   [USB3] USB3_2/1/4: Device closing
08:34:17.277776 INFO:   [3380] IO thread termitaed with result 0

When I requested LNA only gain, this returned as 0 dB.

I've been looking at the following sections from XTRX and Soapy's libraries...

https://github.com/xtrx-sdr/libxtrx/blob/2443a10621039049c3ced7c295d4959e74a1dcef/soapy/SoapyXTRX.cpp#L298-L324

https://github.com/pothosware/SoapySDR/blob/23e5951d8d2b4f47e235b2f6025743d9b122d55b/lib/Device.cpp#L307-L317

Was wondering what would cause this to occur?