-
Notifications
You must be signed in to change notification settings - Fork 7
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
Problems when using QT GUI Widgets to adjust RSP gains #43
Comments
@gozillah - thanks for reporting this problem with the RSPduo block for GRC. I'll try a few things here during the weekend when I have some free time, and I'll let you know what I find out. I do know that the RF gain reduction setting takes a string because the user can either set the RF gain reduction as a number of dB, or they can pass the string 'LNA', where they can tell they want to set a specific LNA state (which is how RF gaid reduction is actually controlled in SDRplay RSPs). Franco |
Thanks for your swift reply (as always - amazing!) The first issue (ValueError: could not convert string to float: 'rfatten0') may be the result of QT GUI Range issuing only float or int types, not strings (as expected by your RSPduo implementation). I don't know how to work around this. I discovered the discussion at link. TL;DR. Is there anywhere a full documentation about all options of specifying gains in gr-sdrplay3? It is still essential for me to be able to control gains via QT GUI widgets. |
@gozillah - you probably are already aware that there's a tab called 'Documentation' in each RSP source block that gives you some basic information about the controls available in that block. For instance in the RSPduo block that information page has the following about 'RF Attenuation', where it tells you that it can also be specified as LNA (say 'LNA3'):
On the other hand to take full advantage of your RSPduo, you probably should become familiar with its gain (reduction) system, LNA state, hardware filters and IF filters, etc. Finally for more specialized information, like using both tuners of your RSpduo for diversity reception, since you are on Windows, I suggest experimenting with SDRuno (which is free), reading its excellent Users Guide (https://www.sdrplay.com/docs/SDRplay_SDRuno_User_Manual.pdf) and, last but not least, browsing the many posts related to diversity reception in the SDRPlayUsers group on groups.io: https://groups.io/g/SDRPlayUsers Franco |
Thank you for the links which I have been browsing and will study in-depth later on. For the time being I would like to solve a single problem: How to modify RF and IF attenuation via QT GUI widgets while the flowgraph is running. From your explanations I got the point of RF attenuation to be entered as a string, either a string representing a numerical value (dB) or a string composed of 'LNA' followed by a digit in the range of 0 to 9 (again as a string), e.g. 'LNA5', representing a 'LNA state'. This is not possible with a QT GUI Range (lacking a string type) but with a QT GUI Chooser. So I modified my flowgraph: See my grc in the Zip file file below. However I still get the same error message:
Obviously gr-sdrplay3 is expecting, in the callback routine for RF attenuation, something which it could convert to a float. What I am delivering is a string arriving from my QT GUI Chooser widget. Looking at your code in link I see in the callback section
and in link
When I set RF attenuation manually in your 'SDRplay: RSPduo' block as a constant string, then everything works as expected. However when I inject the RF attenuation (string) value by QT GUI Chooser, then your current code seems to be unable to convert it to float because in this case it is not a constant. The problem with injecting IF attenuation from a QT GUI Chooser may have similar causes. |
@gozillah - I changed the GNU Radio Companion blocks for the SDRplay RSPs to set the RF gain reduction in two separate controls: the first one when the user wants to assign the value in dB, and the second one when the user prefers assigning it as LNA state. This way I can use numeric types ('real' and 'int') in both cases, and there should be no problem using variables as you do in your flowgraph. I just pushed the new GRC block definitions for the SDRplay RSPs in the new branch Franco |
According to some initial (still a bit superficial) tests it is working on my RSPduo, at least with dBs (not tested LNAx yet). And as well with the IF attenuation (no error message there any more). Thank you! I will perform further tests and report. I wonder how it was possible to fixed this in .yml only, i.e. without adapting the .cc callback routine. But my .yml / GRC knowledge is still at some -60 dB (my .yml block files look comparatively basic). |
@gozillah - there are three basic approaches to build and run a GNU Radio flowgraph:
The error you posted in your initial message shows some bad Python syntax in the Python script generated by GRC, so the problem is somewhere in going from 1. to 2. Franco |
I am using the new separate RF attenuation controls frequently. So far no further issues. May I suggest to renounce on the 'Disabled / Enabled' options for the AGC controls in 'sdrplay3_rspXXX.block.yml' and leave this a generic 'bool'. The benefit would be that the AGC could be on/off-controlled from a Qt GUI widget (e.g. QT GUI Checkbox or Chooser) in a GRC dashboard. Or would it be possible to extend the 'Disabled / Enabled' options list by a generic boolean element? I removed (# commented-out) the AGC, AGC0 and AGC1 'options' and 'option_labels' in the yml file and installed a QT GUI Check Box for AGC0 and AGC1 with default value False (AGC off) and the QT GUI Check Box's ID in SRDplay's AGC0 and AGC1 properties fields. Upon transitioning from AGC off to AGC on via the QT GUI Check Box, GRC reported 'rspduo warning: overload detected - please reduce gain' and the Windows 10 SDRplay server crashed. The prevailing (high) attenuation values had been acceptable to the RSPduo both with the modified yml file with AGC off and with the generic yml file. The overload exception was not recoverable by simply transitioning to AGC off in the QT GUI Check Box. |
@gozillah - I'll take a look at your suggestions. Right now I have a couple of 'open' branches ( Franco |
I would like to use QT GUI Range widgets to adjust the RSPduo gains dynamically.
May be there is a reason, but I have no explanation for the RF gains' type to be string. Never mind, as long as I enter numerical gains there the flowgraph is working. However, if I input the ID of a QT GUI Range widget (e.g. 'rfatten0' in the above example) I get the following error message:
Whether the QT GUI Range value in 'rfatten0' is of type float or int does not seem to be relevant.
So for the time being I am remaining with the numerical values in the RF gains:
Starting this flowgraph provides the expected results (with some overload warnings). But as soon as I am interactively lowering the QT GUI Range value of 'ifatten0', the flowgraph stops with the following error message:
test.zip
The text was updated successfully, but these errors were encountered: