Difference between revisions of "How to add new codecs to IGEP GST FRAMEWORK"

From IGEP - ISEE Wiki

Jump to: navigation, search
(Created page with '=  How to add a new codec in IGEP-GST-DSP-FRAMEWORK = <span lang="EN-US" />We will demostrate how to add a new codec inside the IGEP-GST-DSP-FRAMEWORK. Texas instruments D…')
 
m (removed broken link)
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= &nbsp;How to add a new codec in IGEP-GST-DSP-FRAMEWORK =
+
= &nbsp;How to add a new codec in IGEP-GST-DSP-FRAMEWORK =
  
<span lang="EN-US" />We will demostrate how to add a new codec inside the IGEP-GST-DSP-FRAMEWORK.
+
We will demostrate how to add a new codec inside the IGEP-GST-DSP-FRAMEWORK.  
  
Texas instruments DSP Codecs page it's [http://focus.ti.com/dsp/docs/dspfindtoolswbytooltype.tsp?sectionId=3&tabId=1460&toolTypeId=65&familyId=44 here].
+
Texas instruments DSP Codecs page it's [http://focus.ti.com/dsp/docs/dspfindtoolswbytooltype.tsp?sectionId=3&tabId=1460&toolTypeId=65&familyId=44 here].  
  
<span lang="EN-US" />DM3730 or OMAP3530 accept the codecs Omtimized for OMAP3530 &amp; DM3730 or C64+ DSP based devices.
+
DM3730 or OMAP3530 accept the codecs Omtimized for OMAP3530 &amp; DM3730 or C64+ DSP based devices.  
  
We will integrate a acc audio encoder in the codec server.
+
We will integrate a acc audio encoder in the codec server.  
  
== Procedure ==
+
== Procedure ==
  
=== ''<span lang="EN-US">Step 1 - Download the Codec Package.</span>'' ===
+
=== ''<span lang="EN-US">Step 1 - Download the Codec Package.</span>'' ===
  
<span lang="EN-US">Get a codec from TI website [http://software-dl.ti.com/dsps/dsps_public_sw/codecs/C64XPlus_Audio/index_FDS.html <span style="color:windowtext;text-decoration:none;text-underline:none">C64XPlus_Audio_Codecs
+
<span lang="EN-US">Get a codec from TI website [http://software-dl.ti.com/dsps/dsps_public_sw/codecs/C64XPlus_Audio/index_FDS.html C64XPlus_Audio_Codecs Product Download Page].</span>  
Product Download Page</span>].</span>
 
  
 
<span lang="EN-US">As you will observe the package name has
 
<span lang="EN-US">As you will observe the package name has
"c64xplus" embedded inside it i.e. it is a generic MP3 c64+ decoder. '''Hence you can use this link to download
+
"c64xplus" embedded inside it i.e. it is a generic MP3 c64+ decoder. '''Hence you can use this link to download'''
 
&amp; integrate this codec on non-OMAP3 platforms such as DM644x, DM646x,
 
&amp; integrate this codec on non-OMAP3 platforms such as DM644x, DM646x,
OMAPL13x'''. To reiterate, it is the same codec package on both OMAP3 and
+
OMAPL13x'''. To reiterate, it is the same codec package on both OMAP3 and'''
Davinci DVSDK sites.</span>
+
Davinci DVSDK sites.</span><br>  
  
<span lang="EN-US"><o:p>&nbsp;</o:p></span>
+
=== ''<span lang="EN-US">Step 2 - Install the Package.</span>'' ===
 
 
=== ''<span lang="EN-US">Step 2 - Install the Package.</span>'' ===
 
  
 
<span lang="EN-US">Once you have downloaded the codec package
 
<span lang="EN-US">Once you have downloaded the codec package
 
c64xplus_codec_x_xx_xxx_production.bin use the following command to install the
 
c64xplus_codec_x_xx_xxx_production.bin use the following command to install the
package:</span>
+
package:</span>  
  
<span lang="EN-US"><span style="color:green">./c64xplus_codec_x_xx_xxx_production.bin</span></span>
+
<span lang="EN-US"><span style="color:green">./c64xplus_codec_x_xx_xxx_production.bin</span></span>  
  
<span lang="EN-US" style="color:green">This will give a tar file extract that tar file.</span>
+
<span lang="EN-US" style="color:green">This will give a tar file extract that tar file.</span>  
  
=== ''<span lang="EN-US">Step 3 - Copy your desired Codec inside the server.</span>'' ===
+
=== ''<span lang="EN-US">Step 3 - Copy your desired Codec inside the server.</span>'' ===
  
 
<span lang="EN-US">After extracting a tar file you need to copy
 
<span lang="EN-US">After extracting a tar file you need to copy
this package into the Codec Server package.</span><br>
+
this package into the Codec Server package.</span><br>  
 
 
<span lang="EN-US">e.g. in my case</span>
 
  
<span lang="EN-US" /><span lang="EN-US">c64xplus_aacheenc_1_20_005_production/dm6446_aacheenc_1_20_005_production/packages/ti/sdo/codecs/aacheenc&nbsp; </span><br>
+
<span lang="EN-US">e.g. in my case</span>  
  
<span lang="EN-US">to&nbsp; </span><br>
+
<span lang="EN-US">c64xplus_aacheenc_1_20_005_production/dm6446_aacheenc_1_20_005_production/packages/ti/sdo/codecs/aacheenc&nbsp; </span><br>  
  
<span lang="EN-US">igep-dsp-gst-framework-3_20_00/codecs-omap3530_4_02_00_00/packages/ti/sdo/codecs</span>
+
<span lang="EN-US">to&nbsp; </span><br>  
  
=== ''<span lang="EN-US">Step 4 -&nbsp;</span><span lang="EN-US">Modifications inside the
+
<span lang="EN-US">igep-dsp-gst-framework-3_20_00/codecs-omap3530_4_02_00_00/packages/ti/sdo/codecs</span>  
Codec Server</span>'' ===
 
  
<span lang="EN-US"><o:p>&nbsp;</o:p></span>
+
=== ''<span lang="EN-US">Step 4 -&nbsp;</span><span lang="EN-US">Modifications inside the</span>'' Codec Server  ===
  
 
<span lang="EN-US">Once the Codec Package is integrated inside
 
<span lang="EN-US">Once the Codec Package is integrated inside
 
the Codec Server, the server needs to be configured in order to be able to use
 
the Codec Server, the server needs to be configured in order to be able to use
the new codec. </span>
+
the new codec. </span>  
 +
 
 +
<span lang="EN-US">Now open file&nbsp;</span><span lang="EN-US">igep-dsp-gst-framework-3_20_00/codecs-omap3530_4_02_00_00/packages/ti/sdo/server/cs/codec.cfg</span><br>
 +
<pre>/* Declaration of new codec module */
 +
 
 +
var AACHEENC = xdc.useModule('ti.sdo.codecs.aacheenc.ce.AACHEENC');
 +
 
 +
/*
 +
The XDC file in the codec directory (i.e.AACHEENC.xdc) contains the different sections that are defined in the algorithm
 +
that require to be mapped to defined memory sections by the server. Usually
 +
this memory definitions are contained in the TCF file (''server.tcf''). For example to fulfill the requirements for the AACHE
 +
encoder algorithm, and continuing with the variable defined before, the
 +
following entries are added to the configuration file:
 +
*/
 +
 
 +
/* in my case with aacheenc */
 +
AACHEENC.serverFxns = "AUDENC1_SKEL";
 +
 
 +
AACHEENC.stubFxns = "AUDENC1_STUBS";
 +
AACHEENC.useCache = false;
 +
 
 +
AACHEENC.alg.watermark = false;
 +
 
 +
AACHEENC.alg.codeSection = codeSection;
 +
 
 +
AACHEENC.alg.udataSection = udataSection;
 +
 
 +
AACHEENC.alg.dataSection = dataSection;
 +
 
 +
/* Add the Algorithm to the server by adding
 +
a new set to the ''Server.algs'' array.
 +
For example to add the AACHEENCODER algorithm, the following entry needs to be
 +
added */
  
<span lang="EN-US">Now open file&nbsp;</span><span lang="EN-US">igep-dsp-gst-framework-3_20_00/codecs-omap3530_4_02_00_00/packages/ti/sdo/server/cs/codec.cfg</span><br>
+
{
<pre><span lang="EN-US" /><span lang="EN-US">/* Declaration of new codec module */</span> <span lang="EN-US">var AACHEENC = xdc.useModule('ti.sdo.codecs.aacheenc.ce.AACHEENC');</span> <span lang="EN-US">/*</span> <span lang="EN-US">The XDC file in the codec directory (i.e. AACHEENC.xdc) contains the different sections that are defined in the algorithm that require to be mapped to defined memory sections by the server. Usually this memory definitions are contained in the TCF file (''server.tcf''). For example to fulfill the requirements for the AACHE encoder algorithm, and continuing with the variable defined before, the following entries are added to the configuration file: */</span> <span lang="EN-US"><o:p> </o:p></span> <span lang="EN-US">/* in my case with aacheenc */</span> <span lang="EN-US">        AACHEENC.serverFxns = "AUDENC1_SKEL";</span> <span lang="EN-US">        AACHEENC.stubFxns = "AUDENC1_STUBS";</span> <span lang="EN-US">        AACHEENC.useCache = false;</span> <span lang="EN-US">        AACHEENC.alg.watermark = false;</span> <span lang="EN-US">        AACHEENC.alg.codeSection = codeSection;</span> <span lang="EN-US">        AACHEENC.alg.udataSection = udataSection;</span> <span lang="EN-US">        AACHEENC.alg.dataSection = dataSection;</span> <span lang="EN-US">/* Add the Algorithm to the server by adding a new set to the ''Server.algs'' array. For example to add the AACHEENCODER algorithm, the following entry needs to be added */</span> <span lang="EN-US"><o:p> </o:p></span> <span lang="EN-US">{name: "aacheenc", mod: AACHEENC , threadAttrs: {</span> <span lang="EN-US">        stackMemId: 0, priority: Server.MINPRI + 3},</span> <span lang="EN-US">        groupId : 2,</span> <span lang="EN-US">    },</span></pre>  
+
name: "aacheenc", mod: AACHEENC , threadAttrs: {
<span lang="EN-US" />
+
stackMemId: 0, priority: Server.MINPRI + 3},
 +
groupId&nbsp;: 2,
 +
},
 +
</pre>  
 +
<br>  
  
=== ''<span lang="EN-US">Step 5 - Validation</span>'' ===
+
=== ''<span lang="EN-US">Step 5 - Validation</span>'' ===
  
 
<span lang="EN-US">To minimize any errors during the building
 
<span lang="EN-US">To minimize any errors during the building
 
of the Server, add the codec to the validation entries in </span><span class="Teletype"><span lang="EN-US">package.xs</span></span><span lang="EN-US"> file
 
of the Server, add the codec to the validation entries in </span><span class="Teletype"><span lang="EN-US">package.xs</span></span><span lang="EN-US"> file
of the server, which is in same directory as codec.cfg</span>
+
of the server, which is in same directory as codec.cfg</span>  
<pre><span lang="EN-US">/* in my case with aacheenc */</span> <span lang="EN-US">validate_one_codec( "ti.sdo.codecs.aacheenc", "AACHEENC" );</span><br></pre>  
+
<pre>/* in my case with aacheenc */
<span lang="EN-US" />
+
validate_one_codec( "ti.sdo.codecs.aacheenc", "AACHEENC" );</pre>  
 +
<br>  
  
=== <span lang="EN-US">''Step 6 - Add codec in gstreamer''</span> ===
+
=== <span lang="EN-US">''Step 6 - Add codec in gstreamer''</span> ===
  
 
<span lang="EN-US">Open file gstticodecs_dm3730.c located
 
<span lang="EN-US">Open file gstticodecs_dm3730.c located
in&nbsp; igep-dsp-gst-framework-3_20_00/gstreamer-ti_svnr962/src</span>
+
in&nbsp; igep-dsp-gst-framework-3_20_00/gstreamer-ti_svnr962/src</span>  
  
<span lang="EN-US">directory and add following lines.</span>
+
<span lang="EN-US">directory and add following lines.</span>  
<pre><span lang="EN-US"><o:p> </o:p></span><span lang="EN-US">/* in my case with aacheenc */</span> <span lang="EN-US">{
+
<pre>/* in my case with aacheenc */
 +
{
 
"AAC Audio Encoder", /* String name of codec used by plugin*/
 
"AAC Audio Encoder", /* String name of codec used by plugin*/
 
"aacheenc", /* String name of codec used by CE */
 
"aacheenc", /* String name of codec used by CE */
 
codecServer /* Engine that contains this codec */
 
codecServer /* Engine that contains this codec */
 
},
 
},
<!--[if !supportLineBreakNewLine]-->
+
</pre>  
<!--[endif]--></span></pre>  
+
=== <span lang="EN-US">Step 7 - Compile</span> ===
<span lang="EN-US" />
 
 
 
=== <span lang="EN-US">Step 7 - Compile</span> ===
 
  
 
<span lang="EN-US">Compile dmai, codecs and gst_ti in
 
<span lang="EN-US">Compile dmai, codecs and gst_ti in
 
IGEP-GST-DSP framework, copy newly generated files cs.x64P and
 
IGEP-GST-DSP framework, copy newly generated files cs.x64P and
 
ligstticodecplugin.so on board and test with&nbsp;
 
ligstticodecplugin.so on board and test with&nbsp;
gstreamer pipeline.</span>
+
gstreamer pipeline.</span><br>  
 
+
<pre>gst-launch-0.10 alsasrc ! TIAudenc1 codecName=aacheenc engineName=codecServer ! filesink location=test.aac
<span lang="EN-US"><o:p>&nbsp;</o:p></span>
+
</pre>  
 
+
== <span lang="EN-US">References</span> ==
== <span lang="EN-US"><o:p>References</o:p></span> ==
 
  
*<span lang="EN-US"><o:p></o:p></span><span lang="EN-US">[http://processors.wiki.ti.com/index.php/How_do_I_Integrate_new_codecs_into_DVSDK#Modifications_inside_the_Codec_Server <span style="color:windowtext;text-decoration:none;text-underline:none">http://processors.wiki.ti.com/index.php/How_do_I_Integrate_new_codecs_into_DVSDK#Modifications_inside_the_Codec_Server</span>]</span>
+
*<span lang="EN-US">[http://processors.wiki.ti.com/index.php/How_do_I_Integrate_new_codecs_into_DVSDK#Modifications_inside_the_Codec_Server <span style="color:windowtext;text-decoration:none;text-underline:none">http://processors.wiki.ti.com/index.php/How_do_I_Integrate_new_codecs_into_DVSDK#Modifications_inside_the_Codec_Server</span>]</span>
*<span lang="EN-US">[http://www.igep.es/index.php?option=com_kunena&Itemid=97&func=view&catid=80&id=6765&limit=6&limitstart=12#6806 <span style="color:windowtext;text-decoration:none;text-underline:none">http://www.igep.es/index.php?option=com_kunena&amp;Itemid=97&amp;func=view&amp;catid=80&amp;id=6765&amp;limit=6&amp;limitstart=12#6806</span>]</span><br>
 
  
<span lang="EN-US"><span style="color:windowtext;text-decoration:none;text-underline:none" /></span>
+
== Thanks  ==
  
== Thanks ==
+
Many thanks to&nbsp;Pratik G Shinde for this contribution.
  
Many thanks to&nbsp;Pratik G Shinde for this contribution.
+
[[Category:Gstreamer]]

Latest revision as of 13:14, 14 May 2012

 How to add a new codec in IGEP-GST-DSP-FRAMEWORK

We will demostrate how to add a new codec inside the IGEP-GST-DSP-FRAMEWORK.

Texas instruments DSP Codecs page it's here.

DM3730 or OMAP3530 accept the codecs Omtimized for OMAP3530 & DM3730 or C64+ DSP based devices.

We will integrate a acc audio encoder in the codec server.

Procedure

Step 1 - Download the Codec Package.

Get a codec from TI website C64XPlus_Audio_Codecs Product Download Page.

As you will observe the package name has "c64xplus" embedded inside it i.e. it is a generic MP3 c64+ decoder. Hence you can use this link to download & integrate this codec on non-OMAP3 platforms such as DM644x, DM646x, OMAPL13x. To reiterate, it is the same codec package on both OMAP3 and Davinci DVSDK sites.

Step 2 - Install the Package.

Once you have downloaded the codec package c64xplus_codec_x_xx_xxx_production.bin use the following command to install the package:

./c64xplus_codec_x_xx_xxx_production.bin

This will give a tar file extract that tar file.

Step 3 - Copy your desired Codec inside the server.

After extracting a tar file you need to copy this package into the Codec Server package.

e.g. in my case

c64xplus_aacheenc_1_20_005_production/dm6446_aacheenc_1_20_005_production/packages/ti/sdo/codecs/aacheenc 

to 

igep-dsp-gst-framework-3_20_00/codecs-omap3530_4_02_00_00/packages/ti/sdo/codecs

Step 4 - Modifications inside the Codec Server

Once the Codec Package is integrated inside the Codec Server, the server needs to be configured in order to be able to use the new codec.

Now open file igep-dsp-gst-framework-3_20_00/codecs-omap3530_4_02_00_00/packages/ti/sdo/server/cs/codec.cfg

/* Declaration of new codec module */

var AACHEENC = xdc.useModule('ti.sdo.codecs.aacheenc.ce.AACHEENC');

/*
The XDC file in the codec directory (i.e.AACHEENC.xdc) contains the different sections that are defined in the algorithm
that require to be mapped to defined memory sections by the server. Usually
this memory definitions are contained in the TCF file (''server.tcf''). For example to fulfill the requirements for the AACHE
encoder algorithm, and continuing with the variable defined before, the
following entries are added to the configuration file:
*/

/* in my case with aacheenc */
AACHEENC.serverFxns = "AUDENC1_SKEL";

AACHEENC.stubFxns = "AUDENC1_STUBS";
AACHEENC.useCache = false;

AACHEENC.alg.watermark = false;

AACHEENC.alg.codeSection = codeSection;

AACHEENC.alg.udataSection = udataSection;

AACHEENC.alg.dataSection = dataSection;

/* Add the Algorithm to the server by adding
a new set to the ''Server.algs'' array.
For example to add the AACHEENCODER algorithm, the following entry needs to be
added */

{
name: "aacheenc", mod: AACHEENC , threadAttrs: {
stackMemId: 0, priority: Server.MINPRI + 3},
groupId : 2,
},


Step 5 - Validation

To minimize any errors during the building of the Server, add the codec to the validation entries in package.xs file of the server, which is in same directory as codec.cfg

/* in my case with aacheenc */
validate_one_codec( "ti.sdo.codecs.aacheenc", "AACHEENC" );


Step 6 - Add codec in gstreamer

Open file gstticodecs_dm3730.c located in  igep-dsp-gst-framework-3_20_00/gstreamer-ti_svnr962/src

directory and add following lines.

/* in my case with aacheenc */
{
"AAC Audio Encoder", /* String name of codec used by plugin*/
"aacheenc", /* String name of codec used by CE */
codecServer /* Engine that contains this codec */
},

Step 7 - Compile

Compile dmai, codecs and gst_ti in IGEP-GST-DSP framework, copy newly generated files cs.x64P and ligstticodecplugin.so on board and test with  gstreamer pipeline.

gst-launch-0.10 alsasrc ! TIAudenc1 codecName=aacheenc engineName=codecServer ! filesink location=test.aac

References

Thanks

Many thanks to Pratik G Shinde for this contribution.