# LimeSuite: Specify 3 gains

**URL:** <https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269>\
**Category:** Lime Suite\
**Created:** [8 July 2026 12:37 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269 "2026-07-08T12:37:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![zvivered](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@zvivered](https://discourse.myriadrf.org/u/zvivered)\
**Post date:** [8 July 2026 12:37 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269/1 "2026-07-08T12:37:11Z")

</div>

Hello,

According to AI chat, there is an old version in which I can specify 3 different gains:

SetRFELNA\_dB ()

SetRFETIA\_dB ()

SetRBBPGA\_dB ()

The prototypes are in LMS7002M.h

How can I get this old version ?

Thank you,

Zvi

---

<div class="post-metadata">

**Author:** ![Arnius](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@Arnius](https://discourse.myriadrf.org/u/Arnius)\
**Post date:** [8 July 2026 12:54 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269/2 "2026-07-08T12:54:21Z")

</div>

Hi,

We recommend to avoid using the old LimeSuite API or mixing it with LimeSuiteNG API.

Instead use the new API gain setter as shown in here - [Common control and configuration options — Lime Suite NG latest documentation](https://myriadrf.org/projects/limesuiteng/developer/limesuiteng_api/related_pages/library_guide_book/device_config/common_config_options.html#generic_config_1dev_gain)

Also here is a full reference to LimeSuiteNG library and API - [Lime Suite NG library reference — Lime Suite NG latest documentation](https://myriadrf.org/projects/limesuiteng/developer/limesuiteng_api/index.html)

---

<div class="post-metadata">

**Author:** ![zvivered](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@zvivered](https://discourse.myriadrf.org/u/zvivered)\
**Post date:** [9 July 2026 04:03 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269/3 "2026-07-09T04:03:30Z")

</div>

Hello,

I wrote my application with the newest API:

```auto
 
lime::SDRDevice* device;

static void LogCallback(LogLevel lvl, const std::string& msg)
{
    if (lvl > logVerbosity)
        return;
    std::cout << msg << std::endl;
}

int main (void)
{
lime::registerLogHandler(LogCallback);

 std::vector<lime::DeviceHandle> listOfDevices = lime::DeviceRegistry::enumerate();

 std::cout << "Found " << listOfDevices.size() << " devices\n";
 for (const auto& item : listOfDevices)
     std::cout << item.Serialize() << std::endl;

 lime::SDRDevice* device = lime::DeviceRegistry::makeDevice(listOfDevices.at(0));
 if (device == nullptr)
 {
     std::cout << "Failed to connect to SDR device\n";
     return SDR_OPEN_FAILED;
 }

 rc=device->Init();
 if (rc != OpStatus::Success)
 {
     printf("Init failed.\n");
     return SDR_OPEN_FAILED;
 }

// RF parameters
SDRConfig config;
config.channel[0].rx.enabled = true;
config.channel[0].rx.centerFrequency = CenterFreq; //800e6
config.channel[0].rx.sampleRate = SampFreq; //8e6
config.channel[0].rx.oversample = 2;
config.channel[0].rx.lpf = BandWidth; //8e6
config.channel[0].rx.path = Antenna; //3
config.channel[0].rx.calibrate = CalibrationFlag::FILTER;  
config.channel[0].rx.testSignal.enabled = false;

config.channel[0].tx.enabled = false;
config.channel[0].tx.sampleRate = 0;
config.channel[0].tx.oversample = 0;
config.channel[0].tx.path = 0;
config.channel[0].tx.centerFrequency = 0;
config.channel[0].tx.testSignal.enabled = false;

std::cout << "Configuring device ...\n"sv;

rc=device->Configure(config, 0);
if (rc != OpStatus::Success)
{
    printf("Configure failed.\n");
    return SDR_START_FAILED;
}

printf("Starting stream...\n");

// Samples data streaming configuration
StreamConfig streamCfg;
streamCfg.channels[TRXDir::Rx] = { 0 };
streamCfg.format = DataFormat::I16;
streamCfg.linkFormat = DataFormat::I16;

std::unique_ptr<lime::RFStream> stream = device->StreamCreate(streamCfg, 0);
rc=stream->Start();
if (rc != OpStatus::Success)
{
    printf("StreamCreate failed.\n");
    return SDR_START_FAILED;
}

printf("Stream started\n");

```

According to the flow, after “Configuring device…” I should get “Starting stream…”

But I’m not getting this. Instead the application breaks with no error. Just quitting.

Can you please advise what is wrong in my code ?

Thank you,

Zvi

---

<div class="post-metadata">

**Author:** ![Arnius](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@Arnius](https://discourse.myriadrf.org/u/Arnius)\
**Post date:** [9 July 2026 12:37 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269/4 "2026-07-09T12:37:28Z")

</div>

From the code you provided, it seems like you start the stream, but never read any samples (stream-\>Receive(…)). Please provide more code.

Generic streaming example - [Streaming with SDR device — Lime Suite NG latest documentation](https://myriadrf.org/projects/limesuiteng/developer/limesuiteng_api/related_pages/library_guide_book/device_stream/device_streaming.html)

---

<div class="post-metadata">

**Author:** ![zvivered](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@zvivered](https://discourse.myriadrf.org/u/zvivered)\
**Post date:** [9 July 2026 13:20 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269/5 "2026-07-09T13:20:01Z")

</div>

Hi,

Thank you for your response.  
I did not try to read samples yet.  
Can this cause a problem?

Best regards,  
Zvi

---

<div class="post-metadata">

**Author:** ![Arnius](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@Arnius](https://discourse.myriadrf.org/u/Arnius)\
**Post date:** [9 July 2026 14:52 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269/6 "2026-07-09T14:52:49Z")

</div>

Sorry, I misread your original post.

First off, could you update your logcallback function to ignore log verbosity to print all messages.

> [@zvivered](#):
>
> ```auto
> static void LogCallback(LogLevel lvl, const std::string& msg)
> {
> std::cout << msg << std::endl;
> }
> 
> ```

Secondly, could you try to configure your device without the calibration flag enabled (remove the line entirely) and see if that changes anything?

---

<div class="post-metadata">

**Author:** ![zvivered](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@zvivered](https://discourse.myriadrf.org/u/zvivered)\
**Post date:** [11 July 2026 16:54 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269/7 "2026-07-11T16:54:37Z")

</div>

Hi Arnius,

The code now is:

```auto
using namespace lime;
using namespace std::literals::string_view_literals;
std::unique_ptr<lime::RFStream> stream;
SDRConfig config;
StreamConfig streamCfg;

```

```auto
/ ****************************************************************************** /
static void LogCallback(LogLevel lvl, const std::string& msg)
{
    printf("LogCallback[%d]: %s\n", lvl,msg.c_str());
}

int main (void)
{
   lime::registerLogHandler(LogCallback);

   std::vector<lime::DeviceHandle> listOfDevices = lime::DeviceRegistry::enumerate();

   std::cout << "Found " << listOfDevices.size() << " devices\n";
for (const auto& item : listOfDevices)
    std::cout << item.Serialize() << std::endl;

   lime::SDRDevice* device = lime::DeviceRegistry::makeDevice(listOfDevices.at(0));
if (device == nullptr)
{
    std::cout << "Failed to connect to SDR device\n";
    return SDR_OPEN_FAILED;
}

   rc=device->Init();
   if (rc != OpStatus::Success)
   {
      printf("Init failed.\n");
      return SDR_OPEN_FAILED;
   }
   config.channel[0].rx.enabled = true;
   config.channel[0].rx.centerFrequency = CenterFreq;
   config.channel[0].rx.sampleRate = SampFreq;
   config.channel[0].rx.oversample = 2;
   config.channel[0].rx.lpf = BandWidth;
   config.channel[0].rx.path = Antenna;
   //config.channel[0].rx.calibrate = CalibrationFlag::FILTER;
   config.channel[0].rx.testSignal.enabled = false;

   config.channel[0].tx.enabled = false;
   config.channel[0].tx.sampleRate = 0;
   config.channel[0].tx.oversample = 0;
   config.channel[0].tx.path = 0;
   config.channel[0].tx.centerFrequency = 0;
   config.channel[0].tx.testSignal.enabled = false;

   std::cout << "Configuring device ...\n"sv;

   rc=device->Configure(config, 0);
  if (rc != OpStatus::Success)
  {
    printf("Configure failed.\n");
    return SDR_START_FAILED;
  }

```

I blocked the calibration line.

Following are the messages I’m getting from the callback:

```auto
LogCallback[5]: DeviceRegistry Added: FX3
LogCallback[5]: DeviceRegistry Added: FTDI
Found 1 devices
LimeSDR Mini, addr=0403:601f, serial=1DBB43DFE73B2D
LogCallback[5]: FPGA::DetectRefClk fx3Clk:1e+08
LogCallback[5]: Estimated reference clock 40.0013 MHz
LogCallback[3]: Reference clock 40.00 MHz
LogCallback[5]: FPGA: StopStreaming
LogCallback[5]: lms7002m_set_tx_lpf: bandwidth(20000000): LAD=140, H=0

LogCallback[5]: INT 57, FRAC 385875, DIV_OUTCH_CGEN 18
LogCallback[5]: CGEN_VCO 14720000 Hz, RefClk 0 Hz
LogCallback[5]: Calibrating CG_IAMP_TBB:
LogCallback[5]: CG_IAMP_TBB(1) RSSI:0x00001ED4 approx. -18.60 dBFS
LogCallback[5]: CG_IAMP_TBB(2) RSSI:0x000025E1 approx. -16.81 dBFS
LogCallback[5]: CG_IAMP_TBB(3) RSSI:0x000034B2 approx. -13.94 dBFS
LogCallback[5]: CG_IAMP_TBB(4) RSSI:0x00003D71 approx. -12.61 dBFS
LogCallback[5]: CG_IAMP_TBB(5) RSSI:0x00004EE4 approx. -10.44 dBFS
LogCallback[5]: CG_IAMP_TBB(6) RSSI:0x00005B52 approx. -9.17 dBFS
LogCallback[5]: CG_IAMP_TBB(7) RSSI:0x00006CB3 approx. -7.66 dBFS
LogCallback[5]: CG_IAMP_TBB(8) RSSI:0x00007930 approx. -6.71 dBFS
LogCallback[5]: CG_IAMP_TBB(9) RSSI:0x00008A50 approx. -5.56 dBFS
LogCallback[5]: CG_IAMP_TBB(10) RSSI:0x000096CB approx. -4.81 dBFS
LogCallback[5]: CG_IAMP_TBB(11) RSSI:0x0000A7E9 approx. -3.88 dBFS
LogCallback[5]: CG_IAMP_TBB(12) RSSI:0x0000B585 approx. -3.20 dBFS
LogCallback[5]: lms7002m_set_rx_lpf: bandwidth(20000000): TIA_C=242, TIA_RCOMP=11, TIA_CCOMP=2, RX_L_C=59, RX_H_C=255

Configuring device ...

```

After ~3seconds from printing “Configuring device” the application breaks.

If I block the line:

```auto
rc=device->Configure(config, 0);

```

The application does not quit.

Can you please advise ?

Thank you very much,

Zvi

---

<div class="post-metadata">

**Author:** ![zvivered](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@zvivered](https://discourse.myriadrf.org/u/zvivered)\
**Post date:** [12 July 2026 08:20 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269/8 "2026-07-12T08:20:21Z")

</div>

Hello,

It seems the cause to the crash is in my code.

Please inspect the following code from basicRX:

```auto
complex32f_t** rxSamples = new complex32f_t*[2]; // allocate two channels for simplicity
for (int i = 0; i < 2; ++i)
    rxSamples[i] = new complex32f_t[fftSize];

```

rxSamples[0], rxSampls[1] are 2 vectors.

```auto
uint32_t samplesRead = stream->StreamRx(rxSamples, fftSize, &rxMeta);

```

In StreamRX, into what vector the data is written ?

Why there are 2 vectors ? I need only one.

Thank you,

Zvi

---

<div class="post-metadata">

**Author:** ![Arnius](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@Arnius](https://discourse.myriadrf.org/u/Arnius)\
**Post date:** [13 July 2026 07:35 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269/9 "2026-07-13T07:35:05Z")

</div>

Hi,

Two vectors can be used to receive data from two different channels at the same time. This is done to enable 2x2 MIMO mode. Same is true for the transmit direction.

To simplify the example above:

```cpp
complex32f_t* rxChA_buff = new complex32f_t[fftSize];
complex32f_t* rxChB_buff = new complex32f_t[fftSize];
complex32f_t* rxBuffers[2] = {rxChA_buff, rxChB_buff};

// Some other program code

do
{
  // Here both buffers will fill up with fftSize samples 
  // (if there are enough samples received in hardware)
  auto samplesRead = stream->Receive(rxBuffers, fftSize, &rxMeta);
}
while(/*Some stop condition*/);

```

or (if you only need one channel [Channel A is always preferred]):

`complex32f_t* rxBuffers[2] = {rxChA_buff, nullptr}; // Channel B is not used`

---

<div class="post-metadata">

**Author:** ![zvivered](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@zvivered](https://discourse.myriadrf.org/u/zvivered)\
**Post date:** [13 July 2026 07:47 UTC](https://discourse.myriadrf.org/t/limesuite-specify-3-gains/13269/10 "2026-07-13T07:47:16Z")

</div>

Hi Arnius,

Thank you very much !

Best regards,  
Zvi
