Consistently Overrunning on First Synchronized RX & File System Writes

Discussions related to embedded firmware, driver, and user mode application software development
Post Reply
peepyopee
Posts: 3
Joined: Fri Jul 08, 2022 6:13 pm
Location: Boston, MA

Consistently Overrunning on First Synchronized RX & File System Writes

Post by peepyopee »

I'm attempting to write a relatively simple I/Q recorder application with a bladeRF 2.0 micro xA5 with libbladeRF 2021.10 (the most recently released git tag). It basically works, however I can't seem to figure out why the first two synchronized reads always overrun for the same size. It always overruns at 15,748 samples on the first read and 508 on the second one. This occurs after power cycling the bladeRF, after power cycling the Ubuntu 20.04.5 LTS PC I'm on, after changing buffer sizes in the application, etc.

After these first two reads, it is able to read the full number of samples I requested. After this, it overruns, but I believe this is because I am writing the just received samples to the file system. When I comment out the write to the file system, the legitimate overruns no longer occur.

So I have two questions:

1. What can I do to debug why the first two overruns occur so that they no longer occur?
2. Is there any way for me to disable the stream while I'm writing to the file system so that the subsequent overruns don't occur? I attempted to disable and then re-enable the module, but it doesn't seem like the device likes to be enabled and then disabled repeatedly. I accomplish this similarly with my USRP b200mini by stopping the continuous stream while writing to the file system and then starting the continuous stream right before I start to sample, but it doesn't seem like there is an analogous set of function calls.

Here is the reference output from the application:

xxxxxx:~/workarea/sdr_channelizer/cpp$ ./blade_recorder 2400.0 56 60 55 0.5 3
Negotiated USB 3 link speed
FPGA version: 0.14.0
Firmware version: 2.4.0-git-a3d5c55f
Using bladerf2 serial number 90aa89283cc3495e9aa506b20b0f40a9
Frequency = 2400 MHz
Sample Rate = 60 Msps
Bandwidth = 56 MHz
Disabled automatic gain control
Gain = 55 dB
Configured RX sync interface
Enabled RX
Overrun detected. 15748 valid samples were read.
Overrun detected. 508 valid samples were read.

Received 30000000
Overrun detected. 1195264 valid samples were read.
Received 30000000
Overrun detected. 1211520 valid samples were read.
Received 30000000
Overrun detected. 1211520 valid samples were read.
Received 30000000
Overrun detected. 1211520 valid samples were read.
Received 30000000
Overrun detected. 1211520 valid samples were read.
Disabled RX
There were 7 overruns.

Here is the permalink to the source code:

https://github.com/cwozny/sdr_channeliz ... _blade.cpp

Cheers,
Woz
Post Reply