-
Notifications
You must be signed in to change notification settings - Fork 14
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
Are RSP1A parameters for the SoapySDR function calls documented anywhere? #69
Comments
@w0dz - first of all I am really sorry to hear that you are having problems using this SoapySDRPlay3 module with Python. The SoapySDRPlay3 module is an attempt to provide an interface between the SDRplay APIs (whose specification guide you can find here: https://www.sdrplay.com/docs/SDRplay_API_Specification_v3.07.pdf), and the SoapySDR Device API (which is described here: https://github.com/pothosware/SoapySDR/blob/master/include/SoapySDR/Device.hpp). This said, here are a few notes that I hope you'll find useful:
Hope this helps. 73, |
HI Franco, typedef struct |
Since SoapySDR aims to be a general purpose interface for all sorts of SDRs and the designers of the SoapySDR API couldn't foresee all the possible configuration settings, they introduced the Settings API (https://github.com/pothosware/SoapySDR/blob/master/include/SoapySDR/Device.hpp#L1204-L1310), which is the catch-all API for those parameters that do not naturally fit elsewhere, like the specific settings for the SDRplay AGC. For instance the
You can list the available settings using the method What you could do is to follow the code that is already there for the AGC set point (https://github.com/pothosware/SoapySDRPlay3/blob/master/Settings.cpp#L1425-L1432), and add similar blocks for all the other settings you would like to control.
Franco |
I guess what I'm really asking is if the Python API has a hook in it to allow writes to the registers. I would rather not edit your C code and thus have a custom version. Brian |
Brian, my bad, I misunderstood your earlier question about The way SoapySDR provides a Python API is by 'Python bindings', courtesy of SWIG (https://github.com/pothosware/SoapySDR/wiki/PythonSupport). SWIG is used to (almost) automatically generate a Python 'interface' from the C/C++ header files that describe the classes, methods, arguments, etc of SoapySDR. In other words if something exists in SoapySDR C/C++ API, then it exists in Python, but if it is not the C/C++ API, it is not in the Python bindings either. I hope this helps, |
OK, but I can't FIND the Python bindings! I can find a list of functions, none of which have the parameters, and I had to hunt for literally days to find examples that had a hint of what I wanted for the other stuff (such as "IFGR" and "RFGR" for the parameters in the setGain function. Where is such a document? Brian |
To clarify what I wrote above, Python bindings are just a mechanism to translate from the Python function calling convention (for instance almost everything in Python is a PyObject) to the C/C++ calling convention; say for instance a C++ function expects a string as one of its arguments, then the Python bindings take care of extracting the string from the PyObject, and passing it to the C++ function underneath. Similarly they take care of wrapping the return value from the C/C++ function into another PyObject, to make Python happy. Coming to your question about the name of the gains, as I said at the beginning of this discussion, the SoapySDR API (C/C++ or Python; it's the same) provides the method
where they show how to get all the info you need from the device. Regarding how say Franco |
I know all about the gain tables. I cannot find a one-one mapping of SoapySDR calls to those of the RSP1A. For example, please show me how I would use SoapySDR to set the AGC threshold to -60dBm. Or the attack or decay times. Those are settable in C, but I can't find any such reference in Python. Brian |
Brian,
The exact line where that value gets assigned to the structure you mentioned earlier is this one (https://github.com/pothosware/SoapySDRPlay3/blob/master/Settings.cpp#L1427):
For the other parameters, like attack and decay, they are not implemented in Franco |
Thanks Franco! You've been a big help. I really appreciate the fast response and detailed info. One other question - in order to add the attack and decay settings, don't I have to edit and recompile your SoapySDRPlay code? I don't think I have everything I need to do that. Brian |
Brian, glad to help! The steps to build SoapySDRPlay from source and install it are very simple, and you can find them in the Wiki here: https://github.com/pothosware/SoapySDRPlay3/wiki#building-soapy-sdr-play The part that could be a little tricky is to make SoapySDR (and all the applications that use it like One way to validate that is, before you make any other changes to the code, add a statement like this right before line 1799 in the source file
and then after building and installing your own version, run say Once you see that message, then you should have a good grasp of the whole process, and adding that additional code for the other AGC settings should be pretty straightforward. Franco |
Actually, now that I recall, I did compile the code. At least I see it on the machine. I had to build a new OS image from scratch, so I rebuilt pretty much everything. So I will have to experiment. Odd not to have the slow/medium/fast stuff in Python. You might consider adding it at some point. |
If I remember correctly, the fact that only Now that I am starting to become more familiar with the way AGC works in the SDRplay API, I see that they have three predefined settings: 5Hz (slow), 50Hz (medium), and 100Hz (fast), so perhaps it makes more sense to replace that Franco |
Hi Franco,
The 5/50/100 is the loop bandwidth, not the AGC speed, and I doubt if it does all that much. The “decay” parameter is the one that sets the slow/medium/fast setting. The “setpoint” is in that same structure. I wouldn’t change the setpoint var, but I would add the others – attack, decay, delay, etc. See below (AGC Control Parameters Structure).
I do wonder if the AGC True/False setting should handle all the enumerated types in the LoopBW, since the first setting is AGC Disable and all the others are settings within the “enable” function (I think). I don’t understand how those two structures play with each other.
Brian
From: Franco Venturi ***@***.***>
Sent: Monday, May 1, 2023 7:59 PM
To: pothosware/SoapySDRPlay3 ***@***.***>
Cc: w0dz ***@***.***>; Mention ***@***.***>
Subject: Re: [pothosware/SoapySDRPlay3] Are RSP1A parameters for the SoapySDR function calls documented anywhere? (Issue #69)
If I remember correctly, the fact that only agc_setpoint is available in writeSetting() is for historical reasons; this module SoapySDRPlay3 started as just fixes to make the previous version (SDRPlay2 - https://github.com/pothosware/SoapySDRPlay2) work with the new version (3.X) of the SDRplay API.
Since that original version had only the control for agc_setpoint, I just carried that over to the new version without thinking much of it.
Now that I am starting to become more familiar with the way AGC works in the SDRplay API, I see that they have three predefined settings: 5Hz (slow), 50Hz (medium), and 100Hz (fast), so perhaps it makes more sense to replace that agc_setpoint control with another control called say agc_speed (or something like that) that can be either 5Hz (or 200ms), 50Hz (or 20ms), or 100Hz (or 10ms), similar to what I think you were proposing (correct me if I misunderstood you).
Franco
—
Reply to this email directly, <#69 (comment)> view it on GitHub, or <https://github.com/notifications/unsubscribe-auth/AELAMGQMMSA7QWWQMUHLFPDXEBS7ZANCNFSM6AAAAAAXMYA6RU> unsubscribe.
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AELAMGQWGLXYISEUJJYG673XEBS7ZA5CNFSM6AAAAAAXMYA6RWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS3HWPDM.gif> Message ID: < ***@***.***> ***@***.***>
|
Brian, The SDRuno User Manual (https://www.sdrplay.com/docs/SDRplay_SDRuno_User_Manual.pdf) on page 63 has the following section:
I also found this morning this piece of code in the RSPTCPServer in the SDRplay GitHub repository (https://github.com/SDRplay/RSPTCPServer/blob/master/rsp_tcp.c#L908-L912), where they set those parameters to the same time constants shown in the picture in the SDRuno manual. I think you are right that it may make more sense to have instead a setting called say Given that initial sentence in the SDRuno user manual about an "improved IF AGC scheme", it is perhaps possible that they kept the old way of controlling the loop bandwidth just as a legacy, and we are now supposed to use Franco |
Good news Brian! Franco |
Awesome! Thanks!
Brian
From: Franco Venturi ***@***.***>
Sent: Monday, May 8, 2023 7:20 AM
To: pothosware/SoapySDRPlay3 ***@***.***>
Cc: w0dz ***@***.***>; Mention ***@***.***>
Subject: Re: [pothosware/SoapySDRPlay3] Are RSP1A parameters for the SoapySDR function calls documented anywhere? (Issue #69)
Good news Brian!
It looks like the upcoming version of SoapySDR (version 0.9) will have a page with Python documentation and online documentation for all APIs (see announcement here: pothosware/SoapySDR#403 <pothosware/SoapySDR#403> ).
Franco
—
Reply to this email directly, view it on GitHub <#69 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AELAMGWDOK3UXEXRYP4E433XFDXJXANCNFSM6AAAAAAXMYA6RU> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AELAMGQUJQ6KAFFOCWN44MTXFDXJXA5CNFSM6AAAAAAXMYA6RWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS3WFQ5E.gif> Message ID: ***@***.*** ***@***.***> >
|
I have written my own Python code using SoapySDR to talk to an RSP1A, but figuring out what the parameters are has been a real problem. The SoapySDR docs show all the high level function calls, but the specifics are up to the driver. And the SoapySDR docs say "they're the same as the C calls except for the two notations below, so go look at the header file." That's not very helpful, since the actual Python parameters passed into the functions are not described anywhere. I had to guess, for example, that the setGain function wanted "IFGR" or "RFGR" for the two gain reduction parameters. And only by some severe poking around did I learn that that overloaded function works differently if you use the short form without a parameter name. And what about AGC response times for attack and decay, and AGC threshold? Where do they go? And how long do I have to wait for these commands to "take"? Pretty hard to use an API when it's not documented anywhere.
The text was updated successfully, but these errors were encountered: