SoapySDR example full duplex code and generic SDR configuration management

1,955 views
Skip to first unread message

Jason Heym

unread,
Apr 1, 2018, 12:56:49 PM4/1/18
to Pothos Users
Hi,

I'm interested in developing a full-duplex RX + TX capability using SoapySDR, starting with the LimeSDR and hopefully allowing me to migrate to other SDRs.

Is there any example SoapySDR C or C++ code showing how SoapySDR does multi-channel full-duplex RX + TX?

Can one simply create multiple streams and then make SoapySDRDevice_readStream() and SoapySDRDevice_writeStream() calls on separate threads?

If yes, has anyone done this with a LimeSDR and has has gotten a feel for achievable bandwidth?

Regarding configuration management... I have noted Myriad's use of the LimeSuiteGUI and .ini file to help manage the LimeSDR's large number of hardware configuration parameters. Their example code for full duplex RX + TX leverages this .ini file to possibly ensure complete hardware configuration. https://github.com/myriadrf/LimeSuite/blob/master/src/examples/dualRXTX.cpp 

Unfortunately this can't support other SDRs, the .ini is not human readable and one needs the LimeSuiteGUI code to understand parameter types, purpose and permissible values.

Can SoapySDR::Device provide a superior approach to generic hardware configuration management, say via the readSetting() and writeSetting() key,value methods? So instead of using various SoapySDR::Device get() and set() calls for the many different types of SDR hardware parameters, can I simply iterate through a list of key,value pairs and call readSetting() and writeSetting() methods to fully configure an SDR? Is there any way to query for all permissible keys and perhaps permissible values for each key? Goal would be to verify that a list of key,value pairs is complete and valid for a particular SDR.

Thanks! 
Jason

Josh Blum

unread,
Apr 1, 2018, 6:07:24 PM4/1/18
to pothos...@googlegroups.com



On 04/01/2018 11:56 AM, Jason Heym wrote:
Hi,

I'm interested in developing a full-duplex RX + TX capability using 
SoapySDR, starting with the LimeSDR and hopefully allowing me to migrate to 
other SDRs.

Is there any example SoapySDR C or C++ code showing how SoapySDR does 
multi-channel full-duplex RX + TX?



Can one simply create multiple streams and then make 
SoapySDRDevice_readStream() and SoapySDRDevice_writeStream() calls on 
separate threads?

Yes, and many applications do actually use separate threads for rx and tx FWIW

Some hardware has restrictions on creating multiple streams for the same direction due to hardware sample packing, mimo alignment reasons, etc.



If yes, has anyone done this with a LimeSDR and has has gotten a feel for 
achievable bandwidth?

As far as I know you can max out the sample rate. So its really an more nuanced answer of "it depends on what you do with the samples, what you offload into the fpga, turn around time requirements, etc"



Regarding configuration management... I have noted Myriad's use of the 
LimeSuiteGUI and .ini file to help manage the LimeSDR's large number of 
hardware configuration parameters. Their example code for full duplex RX + 
TX leverages this .ini file to possibly ensure complete hardware 
configuration. 
https://github.com/myriadrf/LimeSuite/blob/master/src/examples/dualRXTX.cpp 

Unfortunately this can't support other SDRs, the .ini is not human readable 
and one needs the LimeSuiteGUI code to understand parameter types, purpose 
and permissible values.

Can SoapySDR::Device provide a superior approach to generic hardware 
configuration management, say via the readSetting() and writeSetting() 
key,value methods? So instead of using various SoapySDR::Device get() and 
set() calls for the many different types of SDR hardware parameters, can I 
simply iterate through a list of key,value pairs and call readSetting() and 
writeSetting() methods to fully configure an SDR? Is there any way to query 
for all permissible keys and perhaps permissible values for each key? Goal 
would be to verify that a list of key,value pairs is complete and valid for 
a particular SDR.

Theres a call "getSettingInfo" specifically for this purpose. For example, cubic sdr uses it for example to populate gui widgets for arbitrary settings.

The LMS7 does have a lot a lot of registers, but in practice outside of low level tuning and tweaking, many are going to want a simplified pool of settings anyway, and most devices tend to have drivers that dont expose these kind of things. You might think of LimeSuiteGUI as something you might get with an evaluation hardware and not quite a device driver. But its nice to have both sometimes.

The getters and setters tend to be for the most general case of commodity sdr hardware, and certainly other hardware that may not even strictly be SDR can make use of the other available interfaces such as low level register access or arbitrary settings like you mentioned.

You may also want to check out the driver guide: https://github.com/pothosware/SoapySDR/wiki/DriverGuide

-josh

Thanks! 
Jason


Jason Heym

unread,
Apr 3, 2018, 2:52:23 PM4/3/18
to Pothos Users
Hi Josh,

Thank you for all the detailed help! It looks like SoapySDR::Device has everything I need.

Jason
Reply all
Reply to author
Forward
0 new messages