DSP Framework for DM8168: Difference between revisions

From RidgeRun Developer Wiki
No edit summary
Line 1: Line 1:
= Overview =
= Overview =
RidgeRun provides the DSP Framework composed by a set of building classes based on Makefiles already integrated in the SDK build system in order to allow the user to overcome easily the process involved on creating and compiling an algorithm to be run on the DSP present on the DM81xx devices, it speeds up the process of allowing the ARM to interact with the DSP architecture, so you can offload processing on the ARM and assist it on data processing. Ridgerun also provides the GStreamer DSP wrapper plugin, which can be integrated in a gstreamer pipeline running in the ARM-side to pass a video buffer to the DSP, currently the DSP makes a memory copy of this buffer on its output buffer and sends it back to the ARM, providing a working example about how to integrate the DSP algorithm on the gstreamer framework.


= 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 algroithms.  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.
 
= Download =


DSP Framework is an add-on to RidgeRun's professional SDK. You can purchase the DSP Framework from the [https://www.ridgerun.com/www/index.php/store.html  RidgeRun Store].
DSP Framework is an add-on to RidgeRun's professional SDK. You can purchase the DSP Framework from the [https://www.ridgerun.com/www/index.php/store.html  RidgeRun Store].


= SDK files and configurations =
= SDK enhancements =


We added to the SDK the following configurations and files to get the DSP Framework run correctly:
The DSP Framework add-on extends the RidgeRun professional SDK by providing:


- Extra kernel configurations
- Extra kernel configuration


- Real time class
- Real time class
Line 18: Line 19:
- Patches
- Patches


Each of these files are explained below.
Each of these extensions is explained below.


== Kernel configuration ==


== 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. 


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 limit Linux partition 2. To do this, we remove the second linux partition from the extra kernel arguments:
As a first step, remove the second partition from Linux control by adjusting the kernel command line arguments:


<pre>
<pre>
Line 36: Line 38:
== Real time class ==
== Real time class ==


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


- rtsc.class
- rtsc.class
Line 45: Line 47:


<pre>
<pre>
$DEVDIR/bsp/classes/
$DEVDIR/bsp/classes
</pre>
</pre>
To see all the features added, refer to the SDK documentation:
<pre>
cd $DEVDIR
make doc
firefox documentation/html/index.html
<pre>
and refer to the RTSC module.


== Real time builder scripts ==
== 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:
xdctools is the DSP's builder package.  The SDK integrates XDC scripts to build the DSP firmware. the releated tools are located in:


<pre>
<pre>
Line 58: Line 70:
== Patches ==
== Patches ==


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


- dsp-xdctools-sections-directive-removal.patch  
- dsp-xdctools-sections-directive-removal.patch  
Line 64: Line 76:
- dsp-codec-engine-support.patch
- dsp-codec-engine-support.patch


You can find them in the following path:
You can find the patches in the following path:


<pre>
<pre>
$DEVDIR/proprietary/ezsdk-5_05_02_00/patches
$DEVDIR/proprietary/ezsdk-*/patches
</pre>
</pre>


= Gstreamer DSP Wrapper demo =
= 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:
DSP GStreamer wrapper is a demo that allows ARM-side GStreamer pipelines to interact with the DSP algorithms. The demo source is located at:


<pre>
<pre>
Line 78: Line 90:
</pre>
</pre>


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


<pre>
<pre>
Line 112: Line 124:
display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink sync=false -v
display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink sync=false -v
</pre>
</pre>
[[Category:DM8168]]
[[Category:DM8168]]

Revision as of 14:18, 10 April 2014

Overview

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 algroithms. 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.

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