SoapySDR setGain issue

74 views
Skip to first unread message

SUDHAKAR B

unread,
Jul 1, 2021, 9:20:31 AM7/1/21
to Pothos Users
Dear Community,

I am able to access my sdr via the pointer sdr, pointing to the remote device and successful with sdr->getHardwareInfo()

Able to receive driver key, hardwarekey etc parameters successfully. 

I am trying call the setGain API call from a remote unit and passing the direction, channel and value as follows:

On the host PC my code is as below:
const double gain_val = 2.0000;
sdr->setGain(SOAPY_SDR_RX, 0, gain_val);

On the SDR board side, my code is as follows:
void setGain(const int direction, const size_t channel, const double value){

u32 Type;
printf("My gain value: %f \n", value);
printf("My received direction: %d \n", direction);
printf("My received channel: %d \n", channel);
(direction == SOAPY_SDR_TX) ? (Type = 1) : (Type = 0); //0 = ADC, 1=DAC
//changeGain(value, Type, 1, 1);
}

Before calling the actual hardware function, I want to make sure that I see the value being printed at Soapy level. I am getting the following output (part of log from the sdr terminal):
----------------------------------------------------
SoapyServerListener::accept(192.168.0.109:59540)
metal: info:      Registered shmem provider ion.reserved.
metal: info:      Registered shmem provider ion.ion_system_contig_heap.
metal: info:      Registered shmem provider ion.ion_system_heap.
My gain value: 0.000000
My received direction: 1
My received channel: 0
SoapyServerListener::handlerLoop() FAIL: SoapyRPCUnpacker::recv(header) FAIL:
SoapyServerListener::close()
SoapyServerListener::close()
-----------------------------------------

Values for direction and channel are printing properly and even changing when I send different values from the host side code. How ever, gain value is always shown 0.000000

Tried to change the function signature for setGain, tried different values and types (int, string etc), direct number entry instead of passing using a variable but with no success so far. 

Can you please help me resolve this issue? I am unable to understand where I am going wrong.

Thanks and Regards,
Sudhakar


Message has been deleted
Message has been deleted

righthal...@gmail.com

unread,
Jul 1, 2021, 11:26:28 AM7/1/21
to Pothos Users
What is your setup ? Do you have a SDR board plugged into your computer or is the SDR some stand alone external USB device or What?
It is not clear - what you mean by "SDR board side".
How does the "host PC" communicate with the "SDR board side" ?
Message has been deleted

righthal...@gmail.com

unread,
Jul 1, 2021, 1:49:29 PM7/1/21
to Pothos Users
I have been thinking some more about your problem.

If it were a direct call it could not happen.

That means that somewhere else in your code there is another call to setGain with the gain of zero.

If this a actually the call being processed, then changing the call to setGain(SOAPY_SDR_RX, 1, gain_val), should show the channel changed to 1.

if the channel is changed to 1, then use the debugger and put a break point into the setGain routine and check the traceback.
Reply all
Reply to author
Forward
0 new messages