Post Go back to editing

Pluto SDR Buffer in GNU Radio

I am using the Pluto SDR in gnu radio running on a raspberry pi 4. I am a little confused how the buffer works in the FMCOMMS-2/3/4 block in gnu radio. In gnu radio, is the Pluto operating in "burst" mode by default? Say i'm using the FMCOMMS-2/3/4 source block with the buffer size set to 32,768. Does this mean that the Pluto captures a full, uninterrupted 32,768 samples at the specified sample rate before before sending any complex samples out of the source block in gnu radio? Does this mean that there is some dead time where the FMCOMMS-2/3/4 source block is not outputting any samples while the Pluto is collecting samples? Likewise for transmit, does the Pluto wait for the entire buffer to be filled before transmitting anything?

I am pretty new to gnu radio.

  • First I would recommend using the Pluto specific blocks and not the FMComms ones. There are more features available in the Pluto specific ones.

    In regards to the buffers, on RX by default when a stream is started 4 buffers will be captured in hardware. Then at each refill request, a single buffer is transferred to the host, which makes room for the hardware to save more data. So there is some elasticity in the system. This introduces latency but generally its not a problem.

    On TX this happens occurs in the same way but in the opposite direction. So when you pass the sink block receive at least a buffer of samples it will transfer them to the hardware. You can queue as many as 4 buffers by default until backpressure is applied by the sink block. If you do not do things at the buffer level and instead transfer 1 sample at a time the overhead would be very high.

    -Travis

  • I did not know that a Pluto specific gnu radio block existed, thanks for pointing that out. As a follow up question, is there a maximum buffer size? I know that the Pluto has 512MBytes of RAM but that probably is not all allocated for storing samples. Also, is there an easy way to change the number of buffers from the default of 4?

  • As a follow up question, is there a maximum buffer size?

    I believe this is 2^23 samples by default.

    Also, is there an easy way to change the number of buffers from the default of 4?

    You need to modify the source. Adding this function to the iio_devices: http://analogdevicesinc.github.io/libiio/master/libiio/group__Device.html#ga8ad2357c4caf7afc778060a08e6e2209

    -Travis

  • Hi Travis,

    I have a follow-up question on this buffer size. How customizable is the buffer size? Can you set the buffer to be the exact size you wish (using the Buffer Size variable in the Pluto Sink block)? 

    I am experiencing issues when decoding packets transmitted from the Pluto. On the transmit side, I am setting the buffer size to be exactly the number of samples in the transmission (making sure it is an integer and lower than the max buffer size). On the receive side, I am decoding well for the first few packets, but then the program stops decoding well and packets are missing bytes.

  • n the transmit side, I am setting the buffer size to be exactly the number of samples in the transmission (making sure it is an integer and lower than the max buffer size).

    The problem with this approach is that you are likely assuming that you are getting exactly the transmitted samples in time. When Pluto captures data is arbitrary in time at the start. Data is contiguous afterward assuming you are not overflowing (dropping data).

    -Travis