AnsweredAssumed Answered

Reading iio data without losing samples

Question asked by milosoftware on Nov 30, 2015
Latest reply on Dec 4, 2015 by larsc
Branched to a new discussion

I'm trying to fetch data from the AD9649 chip through IIO.

 

It was my understanding that the IIO subsystem will create 4 DMA buffers and cycle them while reading data from the node.

 

Apparently, it only grabs a single buffer and loses any data that has been aquired in between calls.

 

I tried various ways of sampling. I set the "length" of the DMA buffer to 32k (samples are 16 bit, so that is 64kB per block).

 

- Using plain "dd bs=64k if=/dev/iio:device2 of=/tmp/cap count=100". The captures data has "gaps" every 64k.

- Using "iio_readdev ... > /tmp/cap" yields the same result.

 

Increasing the buffer size yields more useful data, but the gaps remain.

 

The sample rate is about 7.5MHz, so the data arrives at about 15MB/s, something the board can easily handle. I see CPU usage way below 10% even when directly sending to network (it's something like 2% when reading to memory).

 

I thought that using IIO would get me streaming data, but apparently, it does not? Is there something magic I need to do in the driver or sysfs to get proper streaming performance?

Outcomes