AnsweredAssumed Answered

iio_buffer_step becomes zero if iio context is changed to local

Question asked by vava on Aug 5, 2018
Latest reply on Aug 8, 2018 by vava

Dear Madam / Dear Sir,


I have been running with success a streaming application on a hardware based on FMCOMMS1 (libiio 0.6). The code is essentially based on the example “ad9361-iiostream”. The context is network (iio_create_network_context) and data are processed on the external laptop.


In a new programm and a new application, I have just changed (nothing else) the context to local (iio_create_local_context). The new programm initialisation on the board is identical and successfull but when running the streaming, only the first data buffer (rx) is correct (iio_buffer_refill and iio_channel_read). From the second run and all the next, iio_buffer_refill provides the correct output number but iio_buffer_step is zero (while in the case of the network context iio_buffer_step remains 4); reading data (iio_channel_read) provides a constant value (because of iio_buffer_step as I understand it). iio_device_get_sample_size is always correct with the value 4.


I do not understand well the way the "sample_size" value of the iio_buffer buffer is updated. Why is iio_buffer_step response switching from 4 to 0 when changing the context ? Could you give me any hint on the possible causes ?


The Linux has not been configured by myself. Is there any configuration to update when changing the context ?


Thank you for your help.