-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override setGain and getGainRange to avoid changing RFGR. #25
base: master
Are you sure you want to change the base?
Conversation
SDRPlay's "RFGR" is actually a mode selector for the front-end LNA. It does *not* have units of dB. (In fact, it is frequency-dependent.) As a result, the default gain allocation algorithm does not apply and only IFGR should be used for adjusting the overall system gain.
FYI, there is some discussion going on regarding the best path forward for #26, cjcliffe/CubicSDR#825, and the However, I believe that this PR is still appropriate for an immediate merge into |
Would it be possible to get this PR merged now, even as we continue discussion about the best long term solution for gains in the SDRPlay driver? This change does not break any existing use cases, and I think everyone agrees that setting the overall system gain should not treat the LNA state number as a value in dB. |
@dlaw I think that the "generic" I looked at the commit history for that code and I see that that approach was introduced by @SDRplay almost a year ago with this commit (1da639a#diff-d3c542b2c3cb1d01a894f311212c4cf20d0fe52be1ed128b5ff2c475507e834f). Franco |
I think this PR makes sense to merge immediately as a stopgap measure while we continue the discussion about I have some application (in my case, For now -- until we have some smarter way to handle the LNA state as an RF gain in decibels -- I think the correct behavior is for generic setGain to set the IFGR value and getGain to return the IFGR value, leaving LNA state alone. |
@dlaw You are saying that your application Franco |
@fventuri I have this problem with Here is the undesired code which forces LNA state to 9 on Here is an old issue describing the problem: Since it seems like we still have quite some discussion ahead of us on |
SDRPlay's "RFGR" is actually a mode selector for the front-end LNA. It does not have units of dB. (In fact, the resulting gain is frequency-dependent.) As a result, the default gain allocation algorithm does not apply and only IFGR should be used for automatic adjustment of the overall system gain.
(See pothosware/SoapySDRPlay2#60 for previous discussion, https://www.sdrplay.com/docs/SDRplay_SDR_API_Specification.pdf section 5.3 for the definition of RFGR.)