pothosware / SoapyFCDPP

Soapy SDR plugin for Funcube Dongle Pro+
https://github.com/pothosware/SoapyFCDPP/wiki
Boost Software License 1.0
2 stars 4 forks source link

CubicSDR 0.2.5: LNA and Mixer Gain can't be changed #2

Closed nmaster2042 closed 5 years ago

nmaster2042 commented 5 years ago

I'm trying the FCDPP Soapy support with CubicSDR 0.2.5.

On the GUI we have 3 gain settings: IF, LNA and Mixer corresponding to what SoapyUtil displays about this SDR.

$ SoapySDRUtil --probe

######################################################

Soapy SDR -- the SDR abstraction library

######################################################

Probe device [INFO] Found device: 0005:0004:02 [DEBUG] getSettingInfo [DEBUG] getFullDuplex [DEBUG] hasGainMode [INFO] listAntennas [DEBUG] getGainRange [DEBUG] getGainRange [DEBUG] getGainRange [DEBUG] getGainRange [DEBUG] getGainRange [DEBUG] getGainRange [INFO] listFrequencies [INFO] getFrequencyRange [INFO] getBandwidth [INFO] listFrequencies [INFO] getFrequencyRange [INFO] getFrequencyArgsInfo [INFO] listSampleRates [INFO] listBandwidths


-- Device identification

driver=FCDPP hardware=FCDPP


-- Peripheral summary

Channels: 1 Rx, 0 Tx Timestamps: NO


-- RX Channel 0

Full-duplex: NO Supports AGC: NO Stream formats: CS16, CF32 Native format: CS32 [full-scale=1.67772e+07] Antennas: RX Full gain range: [0, 61] dB LNA gain range: [0, 1, 1] dB Mixer gain range: [0, 1, 1] dB IF gain range: [0, 59, 1] dB Full freq range: [0.15, 240], [420, 1900] MHz RF freq range: [0.15, 240], [420, 1900] MHz Sample rates: 0.192 MSps

No issue with If Gain,

But the 2 others stays always to 0 even if I move the selector, see screenshot.

cubicsdr fcpp cubicsdr fcpp 2

I don't know if it's a CubicSDR issue or a FCDPP Soapy driver issue.

As LNA and Mixer can only be enabled or disabled, I wonder if it could be implemented as switch options like bias-tee on some other SDRs instead of gain settings.

ast commented 5 years ago

Ok I see what is going on here. Correct me if I'm wrong @guruofquality but it seems SoapyDevice only accepts ranges for gains and I was flooring the input value. Perhaps CubicSDR didn't let the UI control go all the way up to 1, but stopped at 0.999...

I just pushed a fix to check if the value is greater or less than 0.5. Maybe it works now?

nmaster2042 commented 5 years ago

There is no improvement for gain settings in the CubicSDR UI after rebuilding.

And now, in ths SDR Device list, the Funcube hasn't a name any more, I don't know if it's related to your changes or not, see screenshot.

sdr devices

IF gain still ok.

nmaster2042 commented 5 years ago

For device name, I think this can be added in SoapyFCDPP.cpp

soapyInfo["device"] = "Funcube Dongle Pro+";

before

soapyInfo["alsa_device"] = "hw:CARD=V20,DEV=0";

I think CubicSDR is looking for soapyInfo["device"] to display device name on its list.

Yesterday I had hw:CARD=V20,DEV=0 in my device list.

I think it's better to put the actual name of the device if it doesn't break something else.

Thank you for your work, much appreciated.

vsonnier commented 5 years ago

@nmaster2042 @ast Hello ! Please see CubicSDR commit https://github.com/cjcliffe/CubicSDR/commit/e44af72b00938f015670ef364902a47a33ac9e04 and the following ones thay may the origin of the initially reported issue.

Long story short: In Cubic, gains sliders self-adjust by re-reading the current gain values using Soapy API listGains and getGains because some Settings change may have modified their actual value. Practical case : SDRPLay, and also here maybe Mixer and LNA.

Consequently, you have to check that the previous 2 API calls are properly implemented in the module.

It is mentioned that LNA and Mixer are indeed booleans, so it is maybe better to have them as Soapy settings instead. The hack to present some discrete settings as Gains sliders is that it is much user friendly to do so instead of going to the menus. Drawback: if AGC is on, the sliders are not visible. That's why some Cubic Settings on RSPs are also exposed as Gain sliders, hence the Gains <==> Settings mutual update.

ast commented 5 years ago

Thanks for the feedback. I just pushed a commit that should fix the missing device name and maybe also the problems with setGain. It should be well defined at all times now.

Thanks again for providing feedback and sorry about the bugs. This was a small project I hacked up for myself and I didn't really expect anyone else to use it. Hope you find it useful.

nmaster2042 commented 5 years ago

Device name is fixed now: sdr devices 2 LNA and Mix gains can now be changed too whnen moving cursors completely up: cubicsdr fcpp 3 Thank you very much for debug. FCDPP soapy support is now fully usable.