# Soapy\_power not setting gain above 15

**URL:** <https://discourse.myriadrf.org/t/soapy-power-not-setting-gain-above-15/1973>\
**Category:** LimeSDR\
**Created:** [7 November 2017 11:47 UTC](https://discourse.myriadrf.org/t/soapy-power-not-setting-gain-above-15/1973 "2017-11-07T11:47:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fshkie](https://avatars.discourse-cdn.com/v4/letter/f/919ad9/32.png) [@Fshkie](https://discourse.myriadrf.org/u/Fshkie)\
**Post date:** [7 November 2017 11:47 UTC](https://discourse.myriadrf.org/t/soapy-power-not-setting-gain-above-15/1973/1 "2017-11-07T11:47:22Z")

</div>

Hey there. I’m using soapy\_power to change my gains and it goes through the usualy calibration, but there’s one part that sticks out. I’ve set the gains using:

> –specific-gains LNA=30,PGA=30,TIA=2

But when I read through the terminal, it says the following:

> Rx calibration using RSSI INTERNAL ON BOARD loopback  
> Rx ch.A @ 800 MHz, BW: 30 MHz, RF input: LNAL, PGA: 30, **LNA: 15** , TIA: 2  
> Rx calibration: using cached values  
> Rx calibration values found in cache:

Am I reading this right? It’s capping my LNA gain at 15? I’ve tried playing around with the values, and the PGA and TIA seem to work fine, but the LNA does some weird stuff and never goes above 15. The datasheet is pretty clear that 30 is the max.

Not sure if this is relevant, but I commented out 2 lines (111 and 112) in Soapy\_power.py that apply a -g option to the command line if the value is not negative. This was just to get the program to accept the specific gains, as it was telling me:

> soapy\_power: error: argument -G/–specific-gains: not allowed with argument -g/–gain

---

<div class="post-metadata">

**Author:** ![mzs](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/mzs/32/2678_2.png) [@mzs](https://discourse.myriadrf.org/u/mzs)\
**Post date:** [7 November 2017 20:57 UTC](https://discourse.myriadrf.org/t/soapy-power-not-setting-gain-above-15/1973/2 "2017-11-07T20:57:32Z")

</div>

Have you tried setting PGA to a valid value, maybe I’m reading it wrong, but 30 looks like it is outside the range -12.0 to 19.0.

> <https://github.com/myriadrf/LimeSuite/blob/master/SoapyLMS7/Settings.cpp#L517>

I would start at the top layer and work my way down to the hardware. You should open an issue in github about soapy\_power and work with the software developer (who may not have direct access to LimeSDR) to trace back the cause of, and the solution to, the problem. And if the problem is in a lower layer, log a new issue and reference the previous one.

It could be in [https://github.com/xmikos/soapy\_power](https://github.com/xmikos/soapy_power) or  
It could be in [https://github.com/xmikos/simplesoapy](https://github.com/xmikos/simplesoapy) or  
It could be in [https://github.com/pothosware/SoapySDR](https://github.com/pothosware/SoapySDR) or  
It could be in [https://github.com/myriadrf/LimeSuite/tree/master/SoapyLMS7](https://github.com/myriadrf/LimeSuite/tree/master/SoapyLMS7)

---

<div class="post-metadata">

**Author:** ![Fshkie](https://avatars.discourse-cdn.com/v4/letter/f/919ad9/32.png) [@Fshkie](https://discourse.myriadrf.org/u/Fshkie)\
**Post date:** [8 November 2017 10:24 UTC](https://discourse.myriadrf.org/t/soapy-power-not-setting-gain-above-15/1973/3 "2017-11-08T10:24:29Z")

</div>

Ah yes, good catch. I’ve tried setting all the gains to 10dB and I get the following:

> Rx ch.A @ 1904.65 MHz, BW: 30 MHz, RF input: LNAH, PGA: 22, LNA: 4, TIA: 2

So something is definitely wrong here. I’ve opened an issue, but they took ages to respond to my last one, so I figured I’d try here first.

---

<div class="post-metadata">

**Author:** ![IgnasJ](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@IgnasJ](https://discourse.myriadrf.org/u/IgnasJ)\
**Post date:** [9 November 2017 07:40 UTC](https://discourse.myriadrf.org/t/soapy-power-not-setting-gain-above-15/1973/4 "2017-11-09T07:40:54Z")

</div>

> [@Fshkie](#):
>
> Rx ch.A @ 1904.65 MHz, BW: 30 MHz, RF input: LNAH, PGA: 22, LNA: 4, TIA: 2

This line prints LMS chip register values, so PGA 22: 10 dB setting in LimeSuite; LNA 4: Gmax-21 setting in LimeSuite; TIA 2: Gmax-3 setting in LimeSuite.

---

<div class="post-metadata">

**Author:** ![Fshkie](https://avatars.discourse-cdn.com/v4/letter/f/919ad9/32.png) [@Fshkie](https://discourse.myriadrf.org/u/Fshkie)\
**Post date:** [10 November 2017 09:48 UTC](https://discourse.myriadrf.org/t/soapy-power-not-setting-gain-above-15/1973/5 "2017-11-10T09:48:28Z")

</div>

Okay, so you’re saying that this isn’t indicitive of the actual gains?

I’m not sure what those Gmax settings actually mean. Is Gmax the largest, or is Gmax-30 the largest? Either way, does LNA: 15 correspond to the max gain?

---

<div class="post-metadata">

**Author:** ![IgnasJ](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@IgnasJ](https://discourse.myriadrf.org/u/IgnasJ)\
**Post date:** [10 November 2017 10:11 UTC](https://discourse.myriadrf.org/t/soapy-power-not-setting-gain-above-15/1973/6 "2017-11-10T10:11:41Z")

</div>

Hi,  
largest is Gmax. Values in LimeSuiteGUI are named based on description in this document (LNA and TIA page 31, register 0x0113):  
[https://github.com/myriadrf/LMS7002M-docs/blob/master/LMS7002M\_Programming\_and\_Calibration\_Guide\_v31r05.pdf](https://github.com/myriadrf/LMS7002M-docs/blob/master/LMS7002M_Programming_and_Calibration_Guide_v31r05.pdf) I thinks it is written like that to reflect that maximum gain also depends on other settings. Register values corresponding to maximum gains are LNA: 15; PGA 31; TIA 3.

---

<div class="post-metadata">

**Author:** ![Fshkie](https://avatars.discourse-cdn.com/v4/letter/f/919ad9/32.png) [@Fshkie](https://discourse.myriadrf.org/u/Fshkie)\
**Post date:** [10 November 2017 10:16 UTC](https://discourse.myriadrf.org/t/soapy-power-not-setting-gain-above-15/1973/7 "2017-11-10T10:16:06Z")

</div>

Awesome. Thanks!
