local: Add support for setting watermark#781
Conversation
|
Hi, Thanks for your PR. I didn't see in kernel's Because the actual value of
It's not sufficient to only write watermark once. For example:
I think you need to reset `watermark to 1 before setting length. |
|
This is incorrect. If the |
Hum... Maybe I've some memory corruption... will try it later. |
|
I've tested creating buffer with size up & down, it's working :) |
|
@HiFiPhile And it also works if the buffer size isn't a multiple of the watermark? |
|
With a size of 110 and watermark of 20 it seems working. I don't have a high speed device to test if last conversion will be cut off, in low speed device since kernel buffer has a 4*length it should be ok. |
|
But 110*4 is divisible by 20 :) |
|
With a length of 123 and watermark of 20 it still works :) |
|
Great, thanks. I sent patches upstream to fix the two drivers that errored with too high watermarks. |
Add support for setting the watermark value, if the driver supports it. The watermark value represents the number of samples that will be read in one burst from the hardware. Since we read data at the granularity of iio_buffer blocks, it makes sense to use the highest watermark value up to the buffer's size. If the value is too high, the driver will automatically adjust it to the maximum watermark value possible. Fixes #780. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
46866e1 to
356a175
Compare
Add support for setting the watermark value, if the driver supports it.
The watermark value represents the number of samples that will be read
in one burst from the hardware. Since we read data at the granularity of
iio_buffer blocks, it makes sense to use the highest watermark value up
to the buffer's size. If the value is too high, the driver will
automatically adjust it to the maximum watermark value possible.
Fixes #780.
Signed-off-by: Paul Cercueil paul@crapouillou.net