Contents

Introduction

This whitepaper shows how to configure the SDK to capture the maximum allowed image size on the LeopardBoard DM36x. When this document was wrote the maximum allowed resolution for still images was of 2176x1944 pixels.

The DM36x VPFE IPIPE limits the maximum width for images to be processed to 2176 (See http://www.ti.com/lit/ug/sprufg8c/sprufg8c.pdf section 4.3.3). Images greater than 2176 can be split for processing. However, currently there is not support for split image processing.

Hardware used

LeopardBoard DM36x

5MP sensor MT9P031

Configuring the SDK to capture 2176x1944 still images

Since the goal in this page is to demonstrate the capture capability for the LeopardBoard, the output buffer size will be se to its minimum (480P) at:

-> Architecture configurations
-> Maximum Video Output Buffer Size

Our first goal is to get a simple raw data capture from the sensor with a fixed resolution of 2176x1944 pixels, so we can start with the following pipeline:

This way we have two main memory block named KERNEL and RESERVED. The reserved memory allocates both CMEM and capture/display buffers. So if we increase one memory region all others must change to keep the same memory size.

If we use the default SDK configuration we are using Composite output, this mean a display buffers size of 3145728 as we can see from the bootargs on the variable:

davinci_display.cont2_bufsize=3145728

This way we need around 52M of memory for the CAPTURE_DISPLAY_MEM space since:

CMEMK Error: Failed to find a pool which fits 25380864
CMEM Error: getPool: Failed to get a pool fitting a size 25380864

There is not enough CMEM space for the encoding process, so we need to increase CMEM enough to be more or equal to 25380864 bytes, that is, we need around of 25M = 0x1834800. In order to give CMEM a little bit of memory space we set its size to

CMEM = 0x1900000

on

-> Proprietary software
-> Amount of reserved memory for cmemk

Since we have modified the CMEM amount we need to increase the RESERVED memory the same amount we increased CMEM, this way we got that the required RESERVED memory must be

RESERVED = 0x4D00000

which must be set on

-> Proprietary software
-> Amount of reserved memory from the kernel

After that we can rebuilt our SDK and run the pipeline without problem.

Adding encoding stage for H264

In order to use H264 encoding and due to a limitation in the encoder structure, it is necessary to modify the MT9P031 camera driver to change the image resolution in order to fit a multiple of 16 in the height value as is shown below:

After running the pipeline you should get an error similar to the following:

CMEMK Error: Failed to find a pool which fits 19113984
CMEM Error: getPool: Failed to get a pool fitting a size 19113984

It seems like we will need to increase the CMEM space so we can grab a buffer with the required size. Using REQUIRED_SPACE = 19113984 = 0x123A800 we ensure this requirement will be accomplish so our new CMEM value will be set to

CMEM = 0x2B3A800

We need to increase out reserved space in the same value since we increased the CMEM space so our reserved memory should be set to

RESERVED = 0x5F3A800

After the changes were made and SDK has been built we can test the pipeline again and it should work correctly: