Hi there,
I’m working with goobenet on this project.
We’ve been working non-stop trying to get to the bottom of it.
We’ve tried using LMS_FMT_I12 rather than LMS_FMT_F32 - it behaved only marginally better (if at all).
Utilizing a divide-and-conquer approach, we tried the following:
We modified singleRX.cpp very slightly, adding display of dropped samples, so the lines following LMS_GetStreamStatus are as follows:
cout << "RX data rate: " << status.linkRate / 1e6 << " MB/s "; //link data rate
cout << "Dropped: " << status.droppedPackets << " ";
cout << "RX fifo: " << 100 * status.fifoFilledCount / status.fifoSize << “%” << endl; //percentage of FIFO filled
Also, we changed the sample rate to 19.2 MSPS. We then compiled it to singleRX.exe.
If we run just singleRX.exe, we see some dropped samples in the beginning, then usually none, but sometimes a few, even with virtually zero CPU load.
RX LPF configured
Normalized RX Gain: 0.739726
RX Gain: 54 dB
Rx calibration finished
RX data rate: 0 MB/s Dropped: 27 RX fifo: 0%
RX data rate: 57.9994 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 1 RX fifo: 0%
30 lines snipped, dropped 0, fifo 0-1%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 1%
RX data rate: 57.8683 MB/s Dropped: 2 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
CPU load did not peak above 5% during this idle load run, nor did RX fifo go above 1%, yet there were drops.
If we run several copies of Prime95 at the same time, pushing the CPU load close to 100%, we see the following:
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 2 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 2 RX fifo: 0%
RX data rate: 57.4095 MB/s Dropped: 101 RX fifo: 0%
RX data rate: 57.8105 MB/s Dropped: 5 RX fifo: 0%
RX data rate: 57.8105 MB/s Dropped: 8 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 4 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 1 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 5 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 7 RX fifo: 0%
RX data rate: 57.8105 MB/s Dropped: 3 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 2 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 7 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 6 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 7 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 14 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 14 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 9 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 5 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 10 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 7 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 6 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 9 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 3 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 12 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 9 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 9 RX fifo: 0%
Lots of drops, yet fifo status remains empty, i.e. we’re dealing with the data as quickly as it comes in, so we were not overloading the CPU. I also made the singleRX.exe thread TIME_CRITICAL, and the entire process REALTIME_PRIORITY. Made no difference, still saw drops.
I then added the following before the while() loop:
int sleep_counter=0;
…and the following inside the while() loop:
sleep_counter++;
if(sleep_counter % 100)
{
Sleep(10);
}
…thus intentionally slowing down the singleRX.cpp main loop just enough that it wasn’t keeping up, so RX fifo started growing, up to 98 or 99 %, where it stayed… yet, it did NOT show any dropped samples. So, “dropped” is not showing anything related to the FIFO – it’s showing something else. WHAT is it showing? Where is the data being dropped? Why is data being dropped when there is a perfectly good fifo to put it into? We need that data, we don’t want it dropped.
Then, for the final test, we made our main program read and act on a file with pre-recorded data, rather than talking directly to the dongle.
That way, we were able to use the singleRX.cpp example to talk to the dongle, while loading the CPU exactly like we normally would.
Our application uses lots of Intel IPP FFT’s to process the data in many threads at once, for a total CPU load of about 50%. Using QueryPerformanceFrequency as the time base for the entire application, and reading a file (rather than receiving samples directly from LimeSDR Mini), our application runs fine, whether we’re running singleRX.exe or not.
singleRX.exe, on the other hand, is NOT happy when our program is running, even though it’s at realtime priority and our program is at user level priority, and neither the CPU load nor the buffer is full… in fact, it’s leaking like a sieve:
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8028 MB/s Dropped: 0 RX fifo: 1%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8105 MB/s Dropped: 0 RX fifo: 1%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 0 RX fifo: 0%
RX data rate: 57.8683 MB/s Dropped: 1819 RX fifo: 0%
RX data rate: 50.2814 MB/s Dropped: 2350 RX fifo: 0%
RX data rate: 48.3 MB/s Dropped: 1440 RX fifo: 0%
RX data rate: 51.97 MB/s Dropped: 158 RX fifo: 0%
RX data rate: 57.2129 MB/s Dropped: 246 RX fifo: 0%
RX data rate: 56.8197 MB/s Dropped: 313 RX fifo: 0%
RX data rate: 56.6231 MB/s Dropped: 265 RX fifo: 0%
RX data rate: 56.7542 MB/s Dropped: 310 RX fifo: 0%
RX data rate: 56.5576 MB/s Dropped: 232 RX fifo: 0%
RX data rate: 56.8284 MB/s Dropped: 170 RX fifo: 0%
RX data rate: 57.2129 MB/s Dropped: 233 RX fifo: 0%
RX data rate: 56.8852 MB/s Dropped: 282 RX fifo: 0%
RX data rate: 56.632 MB/s Dropped: 222 RX fifo: 0%
RX data rate: 56.9508 MB/s Dropped: 143 RX fifo: 0%
You can see quite clearly where our program started.
So… how can we find out where those dropped samples going? Why are they being dropped?
Could anyone tell me what status.droppedPackets is actually measuring?
It seems to be there may be a flaw in the logic of the signal path. Since the path is provably capable of 28 MSPS, I don’t understand why samples need to be dropped when we’re just running at 19.2 MSPS?
Or, is there a flaw in my testing methodology? Please do let me know.
I have lots of computers and a few LimeSDR mini’s to test with, and even a standard LimeSDR, which is much better behaved but does not meet our needs in other ways, namely lack of RF sensitivity in the VHF range, connector type, etc etc.
My main machine is a Core i9-9900K with Windows 10 (1511)
Any ideas would be greatly appreciated.
Thanks in advance!