# Pothos SoapySDR gain control

**URL:** <https://discourse.myriadrf.org/t/pothos-soapysdr-gain-control/7122>\
**Category:** LimeSDR\
**Created:** [2 May 2021 10:22 UTC](https://discourse.myriadrf.org/t/pothos-soapysdr-gain-control/7122 "2021-05-02T10:22:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LukeLime](https://avatars.discourse-cdn.com/v4/letter/l/c6cbf5/32.png) [@LukeLime](https://discourse.myriadrf.org/u/LukeLime)\
**Post date:** [2 May 2021 10:22 UTC](https://discourse.myriadrf.org/t/pothos-soapysdr-gain-control/7122/1 "2021-05-02T10:22:24Z")

</div>

Hello,  
I experiencing the gain control of my LimeSDR USB3.0 using SopaySDR in Pothos.  
It works in a range from 0 to 60 dB.  
Just one question about the implemenation.  
Lime SDR has a 3 stage amplifiers

 ![LimeSDR-RX_gain_control](https://canada1.discourse-cdn.com/flex034/uploads/myriadrf/original/2X/5/529525671b9b59000af516ad5234f382ddb761ca.jpeg)

with these ranges

 ![LimeSDR-RX_gain_control_table](https://canada1.discourse-cdn.com/flex034/uploads/myriadrf/original/2X/f/fe6dfa1e010c0f79ae756375b17b39948b5d78f8.jpeg)  
Does SoapySDR Source controls automatically the three amplifier’s in a transparent mode for the user?

Thanks

Luca

---

<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:** [2 May 2021 12:18 UTC](https://discourse.myriadrf.org/t/pothos-soapysdr-gain-control/7122/2 "2021-05-02T12:18:13Z")

</div>

Use the source Luke, use the source!

The soapy entry point to modify gains is going to call one of these two functions, depending if you did not specify a [gain string](https://github.com/myriadrf/LimeSuite/blob/master/src/API/lms7_device.cpp#L997) that you want modified or did specify which gain to modify:

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

  

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

Both will end up here:

> <https://github.com/myriadrf/LimeSuite/blob/master/src/API/lms7_device.cpp#L993>

And if you did not specify a gain string these tables would be used to set the gains:

> <https://github.com/myriadrf/LimeSuite/blob/master/src/API/lms7_device.cpp#L1040>

For Pothos specific questions I’d probably ask on the [Pothos mailing lists](https://groups.google.com/g/pothos-users), but it looks like you already have.
