This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:tools-software:linux-software:libiio_tips_tricks [20 Aug 2021 10:03] – [IIO context timeout (libiio)] Michael Hennerich | resources:tools-software:linux-software:libiio_tips_tricks [20 Aug 2021 10:49] (current) – [Capturing large contiguous buffers] Michael Hennerich | ||
---|---|---|---|
Line 14: | Line 14: | ||
* Small buffers -> less latency but more overhead | * Small buffers -> less latency but more overhead | ||
* Large buffers -> less overhead but more latency | * Large buffers -> less overhead but more latency | ||
+ | |||
+ | {{ : | ||
<note tip> | <note tip> | ||
Line 47: | Line 49: | ||
* **industrialio_buffer_dma.max_block_size=size_in_bytes** | * **industrialio_buffer_dma.max_block_size=size_in_bytes** | ||
+ | ==== Linux Contiguous Memory Allocator (or CMA) ==== | ||
+ | |||
+ | * Allocation of big, physically-contiguous memory blocks | ||
+ | * Reserve memory early at boot time | ||
+ | * Kconfig menu " | ||
+ | * Kernel command line option cma=size_in_bytes | ||
+ | * PlutoSDR default 256M | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | ===== Capturing large contiguous buffers ===== | ||
+ | |||
+ | |||
+ | - Set kernel buffer count to 1 | ||
+ | - Increase **IIO buffer DMA max block size** parameter to at least the size of your desired contiguous buffer | ||
+ | - Make sure your CMA size is significantly bigger (CMA is used by various other DMA capable devices in your Linux system) | ||
+ | - AXI_DMAC controller limits length of the transfers to 2**DMA_LENGTH_WIDTH. The default is 24 so your max transfer size is 16777216 bytes. You may need to increase that and rebuild your design. Please see here: [[:/ | ||