Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linux-software:libiio_tips_tricks [20 Aug 2021 10:03] – [IIO context timeout (libiio)] Michael Hennerichresources: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
 +
 +{{ :resources:tools-software:linux-software:libiio:internals:libiio_highspeed_interface.png?400 |}}
  
 <note tip>**Number of discrete buffers are configurable, default is 4.**\\  <note tip>**Number of discrete buffers are configurable, default is 4.**\\ 
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 "Device Drivers" -> "Generic Driver Options"-> "Contiguous Memory Allocator"
 +  * Kernel command line option cma=size_in_bytes
 +  * PlutoSDR default 256M
 +
 +<note tip>Depending on your **IIO buffer DMA max block size** and **number of kernel buffer count** you may need to **CMA size**</note> 
 +
 +===== 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: [[:/resources/fpga/docs/axi_dmac#synthesis_configuration_parameters| Synthesis Configuration Parameters]]
  
resources/tools-software/linux-software/libiio_tips_tricks.1629446625.txt.gz · Last modified: 20 Aug 2021 10:03 by Michael Hennerich