pothosware / SoapySDRPlay3

Soapy SDR plugin for SDRPlay APIv3
https://github.com/pothosware/SoapySDRPlay3/wiki
MIT License
90 stars 15 forks source link

Confusing partial support for rspduo in Dual Tuner mode #77

Open isomer opened 10 months ago

isomer commented 10 months ago

I was confused trying to use Dual Tuner mode for an rspduo, and spent a few evenings trying to get it to work before I read the code and realised that it's not actually supported.

The driver registers a "dual tuner" mode which I had assumed meant that the driver supported this, however the driver rejects all setup requests with multiple channels (since it's not supported).

This confused me for some time.

fventuri commented 10 months ago

First of all my apologies for the confusion and the frustration in using this SoapySDR module with your RSPduo in Dual Tuner - to be honest not many people use SoapySDRPlay3 with an RSPduo in Dual Tuner mode, so there are probably some rough edges.

Anyway tonight I just wrote a simple C++ program based on SoapySDR API C++ example code (https://github.com/pothosware/SoapySDR/wiki/Cpp_API_Example), added some code to handle the dual tuner case (since this was just for a quick test I did a lot of cut&paste, and the code doesn't look very elegant), compiled, ran a quick test with my RSPduo, and I see samples being received from both tuners:

[INFO] devIdx: 0
[INFO] SerNo:
[INFO] hwVer: 3
[INFO] rspDuoMode: 2
[INFO] tuner: 3
[INFO] rspDuoSampleFreq: 6000000.000000
Rx antennas: Tuner 1 50 ohm,
Rx Gains: IFGR, RFGR, 
Rx freq ranges: [1000 Hz -> 2e+09 Hz], 
Num channels: 2
[INFO] Using format CF32.
[INFO] Using format CF32.
elapsed time = 10012307 µs
nSamples0 = 19919104
nSamples1 = 19919104
Done

The code is attached; please take a look and give it a try.

You may want also to take a look at this discussion from 2-3 years ago (https://github.com/pothosware/SoapySDRPlay3/issues/12) about the SDR program SdrGlut, and some considerations when using the SoapySDRPlay3 module in Dual Tuner mode.

Franco

ExampleDualTuner.zip

isomer commented 10 months ago

Oh interesting. I was expecting it to have one stream with two channels, which is what was confusing me. I didn't realise you could open two streams from the same SDR. (although looking at it now it makes sense).

Can I suggest you create an examples/ directory in the repository and put this there so that future explorers can easily find it? It demonstrates a bunch of useful features (not just dual tuner mode).