-
Notifications
You must be signed in to change notification settings - Fork 17
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
The version from May 6 works terribly #41
Comments
Thanks for reporting this very serious bug @T-Shilov I am not running Debian v. 10 here (I use Linux Fedora 34), but I did take a look at the CPU issue you mention in your comment. In order to be able to easily compare my results with yours, I ran the following command in a terminal (the RSP model I am using here is an RSPdx):
The command above streams samples from the RSPdx at a sample rate of 2Msps using the In another terminal (with the streaming still running), I ran the command The process I would suggest, if you don't mind, to run the same test with Regards, |
Oh, yes, dear friend, I completely agree with you. |
Thanks @T-Shilov - I am interested to see your results. Franco |
So, I installed a new clean Debian version 10.10 with 64 bits on a separate computer. 1.. RTL-SDR v3. The reception band of these receivers is set to be the same: 2 MHz. Very important note: I did not connect the antenna to these receivers. Now take a look at the CPU resource consumption of these receivers:
In addition, I have already said that when using SDRplay, the operating system periodically certainly falls into a coma after a few days and stops working and being managed. When I disconnected SDRplay from the computer, the gluttony disappeared, and the operating system began to work stably again for many days. These are huge software disadvantages for this receiver. Dear friend, It must be improved to reduce its voracity and the stability works of the operating system! |
@T-Shilov Franco |
Another example is on a real server running RTL-SDR = 7 pieces and one Airspy Mini.
Yes, that's right, 2 threads are always started. I don't know why.
No, I haven't written it yet. I do not know how to correctly describe this annoying situation to them. |
@T-Shilov - I would just open a support case with SDRplay reporting exactly what you see, i.e. that the I would then ask them why the CPU is running so high and what can be done to resolve this problem, since they are the ones who wrote I imagine that they would ask you for more information or tests like I did earlier, and hopefully this will help find the root cause and a good solution. I am also mentioning @SDRplay; this way he can reply directly on this thread, if he has time to look into it. Let me know how it goes, |
If you can tell me the precise SoapySDRUtil command you used (as per Franco's suggestion above) to see the high CPU load and what OS/architecture you are using, I can try to reproduce the issue. Best regards, Andy |
Judging by screenshots it appears both radios are configured within Openwebrx and that Openwebrx is being started up and “using” the SDRs at which point the comparison in CPu usage is happening. |
As a quick test, may or may not be helpful, I have an RSP1A plugged in to an x64 laptop w/ DragonOS. I’m running SDRAngel with current native use of the API3 built in. Im seeing no more then 5% CPu usage on the sdrplay_apiServ with about 9% from SDRAngel. Receiver is on. I shut it all down, unplug the rsp1a and plug in an rtlsdr. Start back up SDRAngel and now I have about 20% usage. If I sit and watch long enough the numbers come out about the same. Now if I jump over to Cubic SDR I get about 9%~ CPu usage on sdrplay_apiServ. This using SoapySDRPlay from like June 2020 so I’ll try the latest and do comparisons. Maybe it’s something in the way openwebrx is using Soapy and thus making more work for the api? Dunno, but thought I’d try and help test. |
Did a uninstall of the old sdrplay soapy 7 module, downloaded the latest from here using git. Compiled and installed, restarted cubicsdr and I have about %20~ CPU usage. Edit: I uninstalled the latest, put back the old sdrplay soapy and I get basically the same exact 20ish CPU numbers. I looked too quickly in my comparison and I think the 9% was actually Xorg cpu usage. Anyways, hope that’s helpful. In my quick test with cubic SDR which uses Soapy it seems I get the same CPU usage regardless of SDRSoapy (7) versions I use. |
The service will have a different load depending on what it's being asked to do - LowIF vs ZeroIF for example or whether decimation is used and what sample rate is in use, whether AGC is on/off, etc. So without knowing what the service is being asked to do it's almost impossible for me to comment on the CPU load. If you can get some specifics on the setup or use the SoapySDRUtil method as Franco showed, then I can run some tests with those settings. Best regards, Andy |
To try to rule out as many variables as possible, I compiled the example from the SDRplay API specification guide (https://www.sdrplay.com/docs/SDRplay_API_Specification_v3.07.pdf - chapter 4), ran it on my PC with the RSPdx (without any antenna connected), and the My PC here is an i7-5500U running at 2.4GHz, and the OS is Linux Fedora Core 34. The source code of the example from the API specification guide (which is exactly what I ran) is attached. Franco |
@alphafox02 I think you've misunderstood what I was saying about SoapySDRUtil - I've seen your question to Jakob and I wasn't talking about openwebrx. Near the beginning of this thread, Franco suggested that you run SoapySDRUtil as a way by which to check the CPU load for a given setting of the SoapySDRPlay library... SoapySDRUtil --args="driver=sdrplay" --rate=2e6 --direction=RX If you can run this (making sure that you are using the very latest version of SoapySDRPlay library so that we're all on the same build) and let me know what you see then I can do the same. It's very similar to what Franco has done with the code example, but uses the existing library that you are working with. So either of the two options are fine. Also, @fventuri can you run htop and show what each core is using please? Best regards, Andy |
@SDRplay - here is the screenshot with Franco |
@SDRplay please here is my test:
Operating system: Debian 10.10 / 64 bit |
If I remember right, 2 MHz should be using Low-IF, can you also try 2.1 MHz sample rate - thanks |
Ok, for this I have to specify this option? --rate=21e5 |
That or 2.1e6 |
ok, so this is more along the lines of what I would expect. 2 MHz Low-IF starts off life as a 6 MHz sample rate and then there is a down conversion and de-rotation process with filtering which is what is putting up the CPU load - you can see that 2.1 MHz Zero-IF is a 3rd of the CPU load than 2 MHz Low-IF - 10 MHz Zero-IF appears to be the same load as 2 MHz Low-IF, that is more surprising unless there is something I'm forgetting about. Has anyone compared this to Windows performance? |
@fventuri what would be the command line option to disable the AGC loop? |
@SDRplay - as far as I know the command line utility After dinner I plan to run some tests with the SDRplay API specification guide example code, since it is very straightforward to make changes there (and it can be easily compiled on Windows), and I'll report on my findings later on. Franco |
I just ran a few tests with a slightly modified version of the example from the SDRplay API specification guide, and I noticed that by the default that example sets a sample rate of 8MHz for the RSPdx, which explains the high CPU usage I noticed yesterday - once I lowered the sample rate to 2MHz, the CPU usage went down to about 11% in ZIF mode. Anyhow the quick table below has the results of my tests for several different combinations of sample rate, IF frequency, and IF AGC (notice that the CPU usage according to
The source code for the modified version of the example from the SDRplay API specification guide that I used for these tests is attached. Franco |
After the tests above which show that the sample rate is the variable that mostly affects the CPU usage, I ran a similar set of tests using I suspect the reason for this behavior is based on this comment back in our discussion in January of last year: pothosware/SoapySDRPlay2#62 (comment) (for those unfamiliar with the whole discussion we had, I suggest reading the whole thread). I wonder if, based on these tests and the high CPU usage we are noticing, we should revisit that discussion, or if we should just leave the code unchanged, and suggest @T-Shilov and other OpenWebRX users to select a slightly higher sample rate, for instance 2.048MHz. Franco |
I don't quite understand you... |
yeah I think @T-Shilov has got the wrong end of the stick. @fventuri was just explaining why 2 MHz has been done the way it has. The SoapySDRPlay library can't make assumptions as to what type of signals you are looking for, so for 2MHz sample rate it uses Low-IF which means there is no DC spike and therefore is optimum from a signal analysis perspective. However, there is extra processing required for Low-IF vs Zero-IF and so if you are not worried about the DC spike, then a sample rate > 2 MHz (like 2.001 MHz) will select Zero-IF. He was asking if this should be changed. I think more data is needed before deciding on what needs to happen. If I run @fventuri's code on my Windows machine then it only takes a few % CPU load, so what I really need is a comparative run on similar hardware between Windows and non-Windows - it's something I can do, but not at the moment - I can update the ticket when I've got a chance to collect the data and do some analysis. I've just got a heavy load on, so it might take me a bit of time to get the data. |
@alphafox02 1. CPU What else should I replaced?? |
Good evening, i am try using rsp1a and I also ran into the fact that the process soapy sdrplay_apiService load my CPU from 30-37% I need 0.25 and 1MHz bands (not 2 or 4MHz) |
I need to buy one more receiver. But maybe I should buy Airspy instead of SDRplay, which does not have such problems, and it loads the processor a little? |
@T-Shilov @Excalibur201010 Once you build the SoapySDRPlay driver from the code from this new
I ran a couple of tests here a few minutes ago, and it looks like the CPU usage is significantly reduced; please give it a try on your computers and let me know if you notice any improvement. Franco |
@SDRplay I don't have time to run more more tests tonight since it is getting late here, but perhaps this high CPU usage issue is something specific to Linux. Franco |
That's wonderful, Franco! |
@fventuri can you try bulk mode on both Windows and Linux please? I'm also running some other tests so would be good to compare results after you've been able to do that. |
@SDRplay
The modified example source code I used for these tests is attached below (it should compile and run under both Linux and Windows). Franco |
At this point, since I have been consistently able to reproduce the CPU usage in Linux by just running SDRplay provided example code, I am not sure if this is an issue that belongs specifically to the SoapySDRPlay driver. I think the right place for this work should be under an SDRplay technical support case that @T-Shilov and @Excalibur201010 can open at https://www.sdrplay.com/help/ - in that ticket you can just refer to this discussion thread. Franco |
@alphafox02 Franco |
I just ran the latest version of SDRangel here streaming from the RSPdx with a sample rate of 2Msps and zero IF, and I see that the process Franco |
@fventuri i missed that configuration you mentioned. I was just curious what would happen with the CPU usage if I didn’t use Soapy at al and I stopped at the point where I saw low usage and thought, well that looks good. Now I see where you made changes in SoapySDR and from what I see, you also got low usage using certain configurations which is probably the equivalent of what SDRAngel was doing I assume? |
On Linux, you need to divide the CPU load shown by the number of cores on the machine - are you doing this? 400% on Linux == 100% on Windows for a quad core machine. I tried a LibUSB driver on Windows and saw no difference between the hardware driver version of the API and the LibUSB version. Unless anyone has any different data I think you can close this @fventuri |
@SDRplay |
I'm confused, if you agree that the Windows CPU loading is ok and the Linux numbers reported are n times the Windows number (where n is the number of cores in the machine) then that is the same as Windows, so I guess I don't understand the issue. I can't speak for other SDR libraries and what filtering or conversion processes are being used, so if you are trying to compare our library directly with another SDR library then that's not an apples to apples comparison. |
Ok, let's leave the Windows alone. I deleted it. |
I'm not sure how I would know - I have no idea what those other libraries are doing or not doing. |
I can tell you one thing those libraries are not doing: They're not filtering, shifting or decimating the data, at least not in their most common use cases. Typically, they just pass the IQ data coming from the device without modifying it in any way. |
Thanks @SDRplay, @jketterl, @alphafox02, @T-Shilov, and @Excalibur201010 for your useful comments. At this point I am going to go ahead and close this issue since we found out that:
Finally, if the CPU usage is still a concern, here are a couple of ways to reduce the CPU usage using the SoapySDRPlay module:
Franco |
@franco @jketterl
No one has paid attention to the first problem yet. |
@SDRplay |
I'm not sure what "flaws" you are referring to? If you can provide an example that I can repeat to test point 1 then I can look at that. We addressed the difference between the Linux and Windows CPU load reporting. I also said that I don't know what other SDR libraries are doing or not doing, so comparing the CPU load between different SDR libraries isn't an apples to apples comparison. |
Because of these reasons, I decided to temporarily lock this conversation; this is also a notice that should you create another similar issue with a similar attitude, I will act based on the GitHub Community Guidelines linked above. Franco |
Bug.
I have Debian v. 10 running steadily for a long time.
But when I installed your version of SoapySDRPlay3 from May 6, it regularly causes Debian crashes.
Once every few days, it stops working.
The system stops responding and does not respond to the keyboard.
The network also does not work and does not ping from the outside.
But there is no kernel panic. The OS froze as if rooted to the spot.
Ctrl-Alt-Del and "Magic Button" SysRq/Printscreen don't help. Only Reset helps.
When I stopped using your software, Debian again began to work as before, steadily.
Disadvantage.
The process of your SoapySDRPlay3 from May 6 consumes a very lot of resources - 30% or more.
Other Soapy consumes a units of percent.
The text was updated successfully, but these errors were encountered: