DSP Framework for DM8168

From RidgeRun Developer Wiki

Overview

RidgeRun provides the DSP Framework, that allows the ARM to interact with the DSP architecture, so to offload process and assisted data processing. The SDK has the GStreamer DSP wrapper, with this one an ARM-side GStreamer pipeline gives a buffer video to DSP, then, the DSP makes a memory copy of this buffer in its output buffer and sends it back to the ARM.

Getting the code

DSP Framework is an add-on to RidgeRun's professional SDK. You can purchase the DSP Framework from the RidgeRun Store.

SDK files and configurations

We added to the SDK the following configurations and files to get the DSP Framework run correctly:

Kernel configuration

On the DM81xx SoCs, ARM and DSP can share a portion of SDRAM. When the DSP isn't used, this shared memory is given to Linux to control as memory partition 2. But when the DSP is used, you need to reduce or omit Linux partition 2. To do this, we remove the second linux partition from the extra kernel arguments:

cd $DEVDIR
make config
    -> Kernel configuration
        -> (mem=364M@0x80000000 vmalloc=512M vram=81M) Extra kernel arguments

Once the DSP code is in place and working, you can examine the actual shared memory usage and give unused memory (often as much as 75%) back to Linux as partition 2.

Real time class

This class contains the logic to build real time content for DSP. It is composed of two files:

- rtsc.class

- rtsc.defs

You can find them in the following path:

$DEVDIR/bsp/classes/

Real time builder scripts

Xdctools is the DSP's builder package, the SDK uses xdc scripts to build the DSP firmwares. You can find them in the following path:

$DEVDIR/bsp/arch/rtsc


Patches

There are two patches needed to build and run correctly the DSP code, these patches are:

- dsp-xdctools-sections-directive-removal.patch

- dsp-codec-engine-support.patch

You can find them in the following path:

$DEVDIR/proprietary/ezsdk-5_05_02_00/patches

Gstreamer DSP Wrapper demo

The DSP Gstreamer Wrapper is a demo that allows ARM-side Gstreamer pipelines to interact with the DSP architecture. You can find this demo in the following path:

$DEVDIR/myapps/rr-dsp-gstWrapper

The demo will be built along with the SDK if selected on the configuration menu.

cd $DEVDIR
make config
   -> User Applications
      -> RidgeRun DSP GStreamer Wrapper Plugin

Also, it can be built manually:

cd $DEVDIR/myapps/rr-dsp-gstWrapper
make
make install

To test the demo, you can run the following pipelines:

EVM board

gst-launch videotestsrc ! "video/x-raw-yuv, width=1280, height=720, \
framerate=(fraction)30/1, format=(fourcc)NV12" ! dspwrapper ! omx_scaler \
! omx_tvp ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink sync=false -v

Z3 board

gst-launch videotestsrc num-buffers=90 ! "video/x-raw-yuv, width=1280, height=720, \ 
framerate=(fraction)30/1, format=(fourcc)NV12" ! dspwrapper  ! omx_scaler ! omx_ctrl \
display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink sync=false -v