pothosware / SoapySDRPlay2

Soapy SDR plugin for SDRPlay
MIT License
50 stars 11 forks source link

Added RSP1A Support (API 2.11) rebased on origin/master. #35

Closed vsonnier closed 6 years ago

vsonnier commented 6 years ago

Hello @SDRplay, I rebased your changes on origin/master, so please review the changes. I've tested it in Win32/Win64 versions with CubicSDR with a RSP2 on a Windows 10 machine and it works.

SDRplay commented 6 years ago

Thanks for doing this @vsonnier, I don't see the BiasT and notch filter selections in CubicSDR as I do when I run the version I submitted. Is that a switch setting somewhere? It should be enabled by default.

Thanks,

Andy

vsonnier commented 6 years ago

@SDRplay I bet the problem lies in the way determining HW version is done by parsing the label string in Settings.cpp and so is very fragile. So I changed it by using the mir_sdr_GetDevices(&rspDevs[0], &nDevs, MAX_RSP_DEVICES) call as we should I suppose. Works on RSP2. How does it fare with RSP1 / RSP1A ?

SDRplay commented 6 years ago

That's working as long as "hardware" isn't used for anything as it now just contains the serial number. I couldn't see the antenna select for the RSP2 though?

SDRplay commented 6 years ago

I just saw this: RSP2_AM_PORT_ANT_SEL_AS_ANTENNAS - I'm not sure why this is defined? If an RSP2 is detected then the antenna options should always be there. Unless I misunderstand what it's used for?

vsonnier commented 6 years ago

RSP2_AM_PORT_ANT_SEL_AS_ANTENNAS is the default now for SoapySDR, because it allows both CubicSDR and GQRX to support multiple antennas through the Antenna API. The other way is deprecated and exposed antennas as "settings".

The related flags are set in CMakeLists.txt with the following default values:

Of course, activating both options at the same time has little value. If you agree, we could even remove the "antennas as settings" code and option completely.

SDRplay commented 6 years ago

ok, so must be another reason why antenna selection is not appearing in CubicSDR?

vsonnier commented 6 years ago

Provided you compiled CubicSDR master together with SoapySDRPlay with those proprocessor definitions set/unset as above (use CMake-gui to check, set, and regenerate project files if needed) you should see this. I never use the command line, but maybe the right command is now something like that: cmake .. -DCMAKE_BUILD_TYPE=Release -DRSP2_AM_PORT_ANT_SEL_AS_ANTENNAS=1

Please provide screenshots if you think it is useful.

SDRplay commented 6 years ago

Something I really don't understand here - the version I posted works with the RSP2 fine - antenna selection no problem. The version I got back from you after you reworked it today doesn't have any antenna selection. I'm not doing anything other than "cmake .." in both cases.

vsonnier commented 6 years ago

When you say "antenna selection", is it by using the Antenna entry menu or do you use the old way with 2 settings (AM_port selection + Antenna Select) ?

SDRplay commented 6 years ago

The version I sent you has Antenna Select and AMport Select showing in the Run-time Settings panel. The version I got back today doesn't have either. Does it work for you?

SDRplay commented 6 years ago

So when I was checking through these pull request changes I didn't realise that CMakeLists.txt wasn't in it. Looking on my machine I can see that I have both RSP2_AM_PORT_ANT_SEL_AS_ANTENNAS and RSP2_AM_PORT_ANT_SEL_AS_SETTINGS set to true. In the version I pulled back down from github, RSP2_AM_PORT_ANT_SEL_AS_SETTINGS is set to false.

I'm also noticed that RF_GAIN_IN_MENU defaults to false - I don't understand why the RF gain control isn't available until the IF AGC is disabled.

How did these defaults get decided?

I would have thought that this should work out of the box for CubicSDR

Any thoughts?

Thanks, Andy.

SDRplay commented 6 years ago

Thanks for the changes. I've pulled down both SoapySDRPlay and the latest CubicSDR just to make sure I have the latest of everything and I can see the Antenna select in the General Settings.

I don't understand why the RF gain is hidden by default? That is not controlled by the automatic gain control.

Is there a specific reason for that?

Thanks, Andy.

vsonnier commented 6 years ago

Right, I've removed in the last commit the very confusing options RSP2_AM_PORT_ANT*.

RF_GAIN_IN_MENU is false because now the default is to display RFGR as a gain slider in CubicSDR, which is way more practical. Plus, GQRX can control this option because appearing as Gain, else it has no way of changing it.

The only drawback is indeed that the the RF control is not visible if AGC is on because for now RF_GAIN_IN_MENU is exclusive between "gain" or "setting".

We can change it so that RF gain slider is always on, and if RF_GAIN_IN_MENU is on, it also adds the controls to the menu, so that is still visible even in AGC.

That would be ideal but CubicSDR needs to be patched so that the gain sliders are refreshed when settings menu change, and vice versa. (I can do it)

SDRplay commented 6 years ago

RF gain control should always be on. It has no connection to the IF AGC control. Only the IF gain slider should be able to be shown/hidden.

Can't that be done without patching CubicSDR?

vsonnier commented 6 years ago

CubicSDR is a generic application, and the policy is to "hide" the gain controls when AGC is on. There is no generic way to say hide this one, but not that one.

You are right about the AGC concerning only IF, so RF should be controllable at all times indeed. So lets duplicate the RF control between the gain sliders and the settings, but in this case the settings menu and the gain sliders must be kept in sync in CubicSDR, which is not done today.

vsonnier commented 6 years ago

I grew impatient and modified CubicSDR so that gain sliders are updated on the actual gain read from the device, and the settings menu is properly refreshed on gain slider change. See commit on master: https://github.com/cjcliffe/CubicSDR/commit/e44af72b00938f015670ef364902a47a33ac9e04

It works pretty well with the last SoapySDRPlay commit with RF_GAIN_IN_MENU on, so give it a try.

SDRplay commented 6 years ago

I've just been testing this with the latest CubicSDR and works well with RSP2 antenna switching and supporting the RSP1A - I would say that this can be merged back in with the master now.

vsonnier commented 6 years ago

@SDRplay Thanks for your input! Alea jacta est !