DSP Framework for DM8168

From RidgeRun Developer Connection
Jump to: navigation, search

Getting the code

The DSP Framework is a set of Makefile based classes integrated into the RidgeRun SDK simplifying the process of creating, compiling, and deploying DM8168 and DM8148 DSP algorithms. DSP Framework supports ARM / DSP interaction, simplifying the offload of ARM intensive audio / video algorithms to the DSP. The RidgeRun GStreamer DSP wrapper plugin allows your DSP audio or video processing algorithm to be exposed to ARM side applications as just another GStreamer element, so you can easily deploy your proproitary DSP algorithm in many different product configurations. Purchase of the DSP Framework SDK add-on includes full RidgeRun source code.

Download

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

SDK enhancements

The DSP Framework add-on extends the RidgeRun professional SDK by providing:

  • Extra kernel configuration
  • Real time class
  • Real time builder scripts
  • Patches

Each of these extensions is explained below.

Kernel configuration

On the DM8168 and DM8148 SoCs, ARM and DSP can share a portion of SDRAM memory. When the DSP isn't used, this shared memory is given to Linux to control as memory partition 2. With the DSP in use, memory partition 2 sizing needs to be adjusted to meet the DSP algorithm requirements, leaving the rest of memory parition 2 to Linux.

As a first step, remove the second partition from Linux control by adjusting the kernel command line 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

The real time 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

To see all the features added, refer to the SDK documentation:

cd $DEVDIR
make doc
firefox documentation/html/index.html 
<pre>

and refer to the RTSC module.

== Real time builder scripts ==

xdctools is the DSP's builder package.  The SDK integrates XDC scripts to build the DSP firmware. the releated tools are located in:

<pre>
$DEVDIR/bsp/arch/rtsc

Patches

There are two patches needed to build and run the DSP code. These patches are:

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

- dsp-codec-engine-support.patch

You can find the patches in the following path:

$DEVDIR/proprietary/ezsdk-*/patches

GStreamer DSP wrapper demo

DSP GStreamer wrapper is a demo that allows ARM-side GStreamer pipelines to interact with the DSP algorithms. The demo source is located at:

$DEVDIR/myapps/rr-dsp-gstWrapper

The demo will be built if selected via 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