-
Notifications
You must be signed in to change notification settings - Fork 259
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
Sampling problems with LimeSDR at sample rates higher than 3Mhz #716
Comments
Hello @Dantali0n, was the problem present if you revert CubicSDR for instance to 792bf20 (a.k.a before my Spin-lock experiments) Otherwise the |
No, I was waiting to see if the problem would persist after your spin-lock refactoring. Regarding the Soapy module I can use almost any Soapy interfacing software such as sdrangel but also the python modules of Soapy at the full 65Mhz rate perfectly. Therefor, I think the problem resides within CubicSDR. |
Right, I've added traces in Other clients may not obey the MTU size and request bigger chunks, resulting less overhead or problems. |
Anything between 100Khz and 3Mhz has the same MTU size of 4080 sdrangel seems to have a very similar approach to getting mtu size expect it uses GetNativeStreamFormat instead of "CF32" |
…some modules effectively use (LimeSDR...) but we don't care
@Dantali0n Hum, 4080 is indeed awfully small. Still, SDRAngel manages it so the problem is not there. The I think I found it: LimeSDR actually manages the Cubic however doesn't care of this parameter at all, so I changed the code to neutralize its effect entirely. Give it a try ! |
Unfortunately, It did not help. The errors about timeouts of course disappear from the console but the waterfall drops flat at 3Mhz sample rate and a attempt to stop the device will freeze CubicSDR. I think we are on the right track though, I managed to setup Clion and probably have time to have a play tomorrow. Surely if other programs such as SDRAngel can do it than we can also make it work with CubicSDR. |
That is actually good news, and it was not that obvious. Good to hear though ! |
Got it! just deactivate and activate stream after adjusting samplerate and fixed. |
Well, that means the Lime module got broken when sample rate changes, which is definitely its fault. |
I'll do that. and in the meantime I am writing a small fix I'll send the pull request soon. Notably, when deactivating and activating device MTU also changes significantly. I have seen MTU sizes of 32640 appear in output of console. |
How high sample rate you could get with your fix ? |
65Mhz but the performance is not great as the audio & waterfall stutter but it works nonetheless. |
@vsonnier Seems MyriadRF is aware of this behavior and does not think it is a bug myriadrf/LimeSuite#177 Looking at the SoapySDR driver guide it never lists a requirement that calls such as Driver guide for reference: https://github.com/pothosware/SoapySDR/wiki/DriverGuide |
This problem could also be present on other devices using the FX3 driver and is perhaps part of a larger general problem in the LMS7 Soapy module.
The way CubicSDR implements the LimeSDR workaround, it looks like a side-effect to properly reset buffers:
What I would rather have as a "safe" sample rate change is this for all devices if possible:
I don't know if the second solution would break other devices, though. I can test on SDRPlay RSP2 and PlutoSDR at home. |
I agree that your proposed safe change is better. I saw that deactivate / activate takes a long time (several seconds) but indeed we need to test this for other devices (I am in Switzerland until August and could only bring the LimeSDR). I do not think that having a few seconds delay when changing the sampling rate is a huge issues because I find it unlikely users will change the sample rate often. If you have the proposed "safe" sample rate changes ready I will be happy to test it on the LimeSDR again. |
Well samples arent well defined while the rates are being changed, and certain things may need resetting after PLLs are re-tuned or filters flushed, hardware depending... So I don't think its a terrible idea to deactivate the stream. But I would really rather the soapysdr support module handled this case in whatever way was best so that re-tuning while streaming would be possible. I think for limesdr, its too confusing to coordinate doing a live sample rate re-tune while streaming. The FPGA support isnt there, and if it was, the software effort might be tedious as well. So they might as well shut off streaming while setting the rate, which is basically what we are discussing. Actually SoapyLMS used to do this, I suppose it was removed to simplify the software.
For LimeSDR, activateStream() will re-run some internal calibrations if its the first call, or if the filter bandwidth or frequency has been changed since the last call to activateStream(). I wonder if thats what you are seeing. Maybe thats ok if its just due to the settings changes since limesdr needs to run internal loopback calibrations. But in general de/activateStream were supposed to be quick calls; where as setupStream() can be somewhat heavy-handed. |
PR #718 is now available for public consumption, implementing the suggestions above. |
PR #718 has been merged! Thanks you all for your feedback. Good to have LimeSDR working at full potential at last ! |
Whenever the sampling rate is increased above around 3Mhz it fails to sample the data. The output can only be recovered by stopping the device and restarting at lower sampling rate. My machine should be capable of handling these data rates having a 7700hq and a 1050 TI.
The outputs shows the following endlessly in a loop:
SoapySDR version: 0.7.1
LMS7Soapy version: 18.10.1
CubicSDR version: c561292
The text was updated successfully, but these errors were encountered: