Dear Alexandru,
Hmm, so the "zerocopy" branch isn't at v0.21.
It's something much older [ ~6 years ? ].
Though the kernel active scan mask is unrelated to libiio, since
iio_readdev is being used in different sessions.
The 4.14 version of the kernel, isn't quite new.
There was some recent fix with regards to active scan-mask computation.
But I am not sure if it's related to this.
Will try to make some time to do some testing on this.
I believe it is a bug which still exists in the adi linux kernel sources.
In industrialio-buffer.c :
static int iio_channel_mask_clear(struct iio_dev *indio_dev,
struct iio_buffer *buffer, int bit)
{
unsigned int ch;
clear_bit(bit, buffer->channel_mask);
memset(buffer->scan_mask, 0,
BITS_TO_LONGS(indio_dev->masklength)); <---------
for_each_set_bit(ch, buffer->channel_mask, indio_dev->num_channels)
set_bit(indio_dev->channels[ch].scan_index, buffer->scan_mask);
return 0;
}
seems so unnecessary complex...
The memset does not clear the scan_mask completely.
Why not simply :
clear_bit(bit, buffer->scan_mask);
Regards
Henk