pothosware / SoapyMultiSDR

Multi-device support module for SoapySDR
https://github.com/pothosware/SoapyMultiSDR/wiki
Boost Software License 1.0
13 stars 3 forks source link

Argument naming convention #1

Open guruofquality opened 8 years ago

guruofquality commented 8 years ago

Multi prefix to make it through the inception

Since SoapyMultiSDR is a bit of a meta-wrapper, I was thinking about how the arguments to specify devices could be formatted to make it through the system. For example, the remote module uses remote: prefix to denote args that should only go to the remote system.

This is especially useful for the driver keyword which is used inside the factory lookup itself to filter out support modules. But we can support it in general for other args. The MultiSDR will simply strip the prefix whenever its found.

Index format for specific device indexes

That would specify the "multi" support module and the rtlsdr driver for all internal devices. Now thats not going to be enough for the multi module as it needs specifying arguments for each device. I was imagining a different "indexing-format" for specifying a specific device in the list of devices:

Now the multi driver can see there are two devices because it has two indexed keywords, and it can format the internal device args to find and make each internal device:

One could also imagine skipping the multi prefix and using the index format here. Perhaps redundant this way if you are using homogeneous devices:

Lets use the same index format for named items (example global sensors). Because these don't have a specific channel space which can be segmented for the multi-device, we must modify the names. So if each rtl had a sensor named foo, then the names presented as the multi device would be foo[0] and foo[1].

Inception with SoapyRemote

Although it hurts to think about, we are going to want to make sure the system is complete by supporting a SoapyMultiSDR made up on individual SoapyRemotes or a SoapyRemote that proxies for a local SoapyMultiSDR. Note that many of the arguments don't get prefixed because they don't really need to be mutated between layers since they are ignored in these layers:

Args for MultiSDR of remotes

driver=multi,multi:driver=remote,remote=host,remote:driver=rtlsdr,serial[0]=00000001,serial[1]=00000002

driver=remote,remote:driver=multi,remote=host,multi:driver=rtlsdr,serial[0]=00000001,serial[1]=00000002

cjcliffe commented 8 years ago

This looks interesting; I hadn't considered the SoapyRemote config case and indexing but I think it makes sense and is consistent.

Is there any thought on implementing the indexing scheme optionally for individual settings, bandwidth, gain, etc? -- I'm thinking in particular for PPM which can vary between RTL devices I would like to make sure each one has the appropriate adjustments applied when being used together since they're rarely the same -- for example just listing a few here that I've labelled I've got +77, +40, -2, +4 and +1 PPM.

guruofquality commented 8 years ago

Is there any thought on implementing the indexing scheme optionally for individual settings, bandwidth, gain, etc? -- I'm thinking in particular for PPM which can vary between RTL devices I would like to make sure each one has the appropriate adjustments applied when being used together since they're rarely the same -- for example just listing a few here that I've labelled I've got +77, +40, -2, +4 and +1 PPM.

Any channel-specified setting will continue to work as before. The channels just keep running up linearly and map down to a particular device. So with a multi device using two rtls, you get two channels 0 and 1. Example:

cjcliffe commented 8 years ago

@guruofquality ah yes, I completely forgot about the channel mapping you mentioned in the original issue -- that works just fine and is simple enough to use.