Post Go back to editing

Issues and questions regarding RX-buffer of Pluto SDR

Hi,

I have 2 Plutos (Rev. C) that share the same external clock, I’m working with the Python lib-iio and pyadi-iio libs. I am basically calling the .rx() [or buffer.refill()] function in parallel threads and then executing some quite time-consuming DSP-operations (lasting a few seconds) in my code, everything located inside a loop. However, I notice that after a few iterations with perfectly phase aligned signals (after removing the initial ADC-offset), suddenly the phase-offset between the received samples of the Plutos changes randomly.

I’ve read many posts in this forum to find an answer, I basically understand that the Pluto stops collecting data when the buffers are full (https://ez.analog.com/adieducation/university-program/f/q-a/557389/missing-every-other-transmission-between-two-plutosdrs-using-gnuradio/455544) and the data is discontinuous then. I assume that this is the case, I’m sampling with 3e6 MSps and have a buffer-size of 6M samples.

My questions:

  1. Why does this random sample-offset occur every single iteration after the buffers are full?
  2. I must execute these time-consuming DSP-operations, I can’t optimize them any further. I don’t need all the continuous data, just a few thousand samples every couple of seconds would be enough. How can I do this without overfilling the buffers and inducing the unwanted random phase offsets?
  3. Is there a way to let the Plutos send the data automatically to the host PC just in time when the buffers are full, and how can I do that? Or is requesting the data every time from the host PC the only way to get data?
  4. Is it possible to delete the local buffer in the Pluto via a special command in the libraries mentioned or differently, so that I can clear the old data inside the buffers repeatedly and prevent these buffers from overfilling? Alternatively, is there any function to tell the Pluto to stop filling the buffer?
  5. Is a cyclic RX-buffer possible and would it solve my problem?
  6. What do the buffer.set_blocking_mode and buffer.cancel commands do actually? analogdevicesinc.github.io/.../buffer.html
  7. Is there any documentation (other than wiki.analog.com/.../libiio_internals) about what is going on in detail both within the Pluto and the host-PC when calling the .rx() or buffer.refill() functions?
  8. When I set a big buffer-size (e.g. 10M samples), what is happening during the time in which data is sent to the host PC? Is the process of collecting data to the buffer halted until the transmission has ended?

 Thank you very much for your help, sorry for the many questions, I spent days searching for answers but couldn’t find anything useful. I really like your hardware (the ADALM2000 too), appreciate your support and recommend your products to my engineer colleagues.

  • 1. Since there is nowhere to put data it is simply dropped inside the FPGA. Hence discontinuity. 

    2. Lower the sample rate or split the processing and data collection into different threads so they do not compete for time.

    3. The current version of libiio does not support asynchronous transfers

    4. No

    5. RX cyclic buffers repeat the same buffer (the first one received) back to the host. This would not solve your problem.

    6. These commands work when pulling a buffer. If the buffer is not full it will either block until data is ready or not block and tell you how many samples of actually in the buffer (in non-blocking mode). These are typically for when you are faster than the data generation and want to do other things while data is being collected.

    7. No other doc exists. You would need to read through the source code to understand deeper details.

    8. TX and RX are completely independent. Data can be sent and received simultaneously. However, since USB2.0 is not full-duplex there will be some interleaving done in the USB stack. But that is independent of libiio.

    -Travis

  • Thank you very much Travis, please allow me a few more questions:

    1) So the only way to make sure the data sent to the host PC comes with no sudden phase offset (discontinuity) is to pull the data fast enough from the Plutos? 

    2) What is the command for cyclic RX-Buffers in pyadiio or libiio in Python? I thought only TX-Buffers existed with the command sdr.tx_cyclic_buffer= True

    3) Since I do not need to send data with the Plutos, is there any Python command to disable the TX-LO for better EMI?