This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
resources:tools-software:linux-software:libiio_tips_tricks [20 Aug 2021 09:42] – created Michael Hennerich | resources:tools-software:linux-software:libiio_tips_tricks [20 Aug 2021 10:30] – [Linux Contiguous Memory Allocator (or CMA)] Michael Hennerich | ||
---|---|---|---|
Line 9: | Line 9: | ||
<note tip> | <note tip> | ||
+ | ===== Buffer handling, sizes and counts ===== | ||
+ | |||
+ | Typically set to a frame or chunk size suitable for signal processing (e.g. N x FFT_size) | ||
+ | * Small buffers -> less latency but more overhead | ||
+ | * Large buffers -> less overhead but more latency | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | <note tip> | ||
+ | Can change this using // | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | ==== IIO buffer DMA max block size ==== | ||
+ | |||
+ | Max buffer size is limited by the max_block_size parameter | ||
+ | * Default 16M | ||
+ | * Can be adjusted | ||
+ | |||
+ | There are two ways to adjust the max block size | ||
+ | |||
+ | === sysfs === | ||
+ | |||
+ | Set via **/ | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | root@analog: | ||
+ | root@analog: | ||
+ | 67108864 | ||
+ | root@analog: | ||
+ | </ | ||
+ | |||
+ | === Kernel command line === | ||
+ | |||
+ | Append the following to your kernel command line | ||
+ | * **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 | ||