AnsweredAssumed Answered

Sample rate and iio_device_create_buffer size

Question asked by mmilosavljevic on May 16, 2017
Latest reply on May 22, 2017 by mmilosavljevic

Hi All,

I thought I understood this but then on second thought I am not sure anymore.

I am using the iio_device_create_buffer and iio_buffer_refill to create the receiver buffer and to refill it. I am using these to read samples from the AD9364.

All I wanted to achieve works fine but what I am struggling to understand is where is the relationship between sample rate and the buffer size? I want to be able to read samples from the device for a set time and to expect the total number of bytes read to be sample rate x duration. But here the total number of samples read depends on the buffer size created with the iio_device_create_buffer and how many times in the loop I run iio_buffer_refill

The bottom line is that all I want to do is set the duration of samples captured based on the required sample size that I want to have which should be determined by the sample rate. 

Could you please clarify this for me? Any comments will be appreciated.

Many thanks

Milos

Outcomes