I'm currently working in python on a pluto sdr using the AD9361 chipset. Most of the examples I have seen are using cyclic buffers. Such as the examples here:
https://analogdevicesinc.github.io/pyadi-iio/buffers/index.html#buffer-examples
I have not seen any concrete examples of using a streaming interface that correctly handles flow control or buffer overflow / buffer starvation. In the simplest cyclic case you create an array or list and pass that to the TX function then you are done. There is a call like this:
sdr.tx(iq)
In a streaming example you would want to add to the transmitted samples as they go out in a controlled fashion where you do not under run the TX buffers and you also do not let them grow to the point of overflowing. Typically if the .tx() was called it could return a watermark indicating how many buffers of the set buffer size was left in the dma queue to be transmitted or how many freebuffers are left, or total number of samples outstanding left to be transmitted. Or there would be other methods that would return similar information. These numbers let you know if you need to speed up or slow down the generation of samples that are output to the DAC for streaming data transfer.
The same is true for the input RX.
so x = sdr.rx() would set the array or list to x then the user can process that data but there does not seem to be a way to see if the buffers that the sdr object has control of is about to over flow or under flow. Does the sdr.rx() method block until it has enough data to fill the buffer of the block size? If you perform the read using the ".rx() method does it return everything that it has in increments of the block size?
Are there calls that can tell the user app what the data watermark levels are for both TX and RX methods for iio_buffer?
Here are the links where I am looking at:
https://wiki.analog.com/resources/tools-software/linux-software/pyadi-iio
https://analogdevicesinc.github.io/pyadi-iio/buffers/index.html
http://analogdevicesinc.github.io/libiio/v0.20/libiio/index.html
https://wiki.analog.com/resources/tools-software/linux-software/libiio_internals
https://ez.analog.com/linux-software-drivers/f/q-a/107129/libiio-kernel-buffers
https://ez.analog.com/linux-software-drivers/f/q-a/534095/libiio-refill-push-buffers