This page explains how to build the examples provided in the Codec Engine (CE) product.
Examples currently contain the simple pass-through (copy) codecs, implemented in the XDM algorithm standard.
See the Codec Engine Examples User's Guide for details on which examples demonstrate particular features.
See the release notes for the specific software and hardware components this release of Codec Engine has been validated against.
This section describes the layout under the examples directory. In most cases, these examples are XDC packages, and there are links to the autogenerated XDC documentation. In some cases, the examples are not proper XDC packages, and documentation is provided in other means (see the specific example's directory).
examples
+---apps
`---ti
`---sdo
`---ce
`---examples Buildable example codecs, servers, and apps
+---codecs
| +---auddec1_copy
| +---auddec1_ires
| +---auddec_copy
| +---audenc1_copy
| +---audenc_copy
| +---g711
| +---imgdec1_copy
| +---imgdec_copy
| +---imgenc1_copy
| +---imgenc_copy
| +---scale
| +---sphdec1_copy
| +---sphdec_copy
| +---sphenc1_copy
| +---sphenc_copy
| +---universalcopy
| +---vidanalytics_copy
| +---viddec1_copy
| +---viddec2_copy
| +---viddec2split_copy
| +---viddec3_copy
| +---viddec_copy
| +---videnc1_copy
| +---videnc2_copy
| +---videnc_copy
| `---vidtranscode_copy
|
+---extensions
| `---scale
|
+---servers
| `---all_codecs
|
`---apps
+---audio1_copy
| +---async
| `---sync
+---audio1_ires
+---audio_copy
+---image1_copy
+---image_copy
+---scale
+---server_api_example
+---server_trace
+---speech
+---speech1_copy
+---speech_copy
+---universal_copy
+---vidanalytics
+---video1_copy
+---video2_copy
+---video2split_copy
+---video3_copy
+---video_copy
`---vidtranscode
This step is optional, but recommended if you plan to modify the samples in any way. It will ensure you have a backup copy of the original examples, as provided by the Codec Engine product.
Important: throughout the rest of this document, we will use the following notation:
At the root of the Examples directory is a build-related file named xdcpaths.mak that all Codec Engine example makefiles include. All users must edit this file to specify where various software components needed by Codec Engine are on their system, and often to narrow the list of hardware platforms to build for (thereby reducing the example build time and possibly the scope of external components).
The variables defined in xdcpaths.mak that most users must assign are: DEVICES, GPPOS, PROGRAMS, and various *_INSTALL_DIR variables. Each are described more below as well as in comments throughout the xdcpaths.mak file.
Advanced users will note that these GNU make-based variables can be overridden on the command line. As a result, it is possible to tailor these makefiles without modifying them - by simply setting the variables on the command line when running "gmake".
The DEVICES variable indicates which hardware platforms should be built for. Most users are only interested in building for a single platform, and the other platforms can be removed from the DEVICES variable.
Note that there is a one-to-one mapping between the "short name" in the DEVICES macro and the "platform package" which is used. For example, the OMAP3530 value in DEVICES maps to the ti.platforms.evmOMAP3530 platform package.
The GPPOS variable indicates which GPP (General Purpose Processor, often an ARM) OS's should be built for. Most users are only interested in building for a single GPP OS (e.g. WinCE or Linux glibc or Linux uClibc), and the other GPP OS's can be removed from the GPPOS variable.
Note that there is a one-to-one mapping between the "short name" in the GPPOS macro and the "target module" which is used. For example, the WINCE value in GPPOS maps to the microsoft.targets.arm.WinCE target Module.
If you are on a single-core or multi-core BIOS-only system, the GPPOS variable is ignored.
The PROGRAMS variable indicates roughly which system architecture the examples should be built for. Generally, Codec Engine supports "local" and "remote" codecs, and as a result there are 3 types of executables that can be built - APP_LOCAL, APP_CLIENT and DSP_SERVER.
APP_LOCAL indicates that all examples that support the apps and algorithms running on the same processor should be built. This is typically set for single core devices (e.g. DM365, DM6437), but can also be set for multi-core devices (e.g. OMAP3530, DM6446, C6472). In heterogenous multi-core systems (e.g. OMAP3530), a 'local' app will be built for each core. In homogeneous multi-core systems (e.g. C6472), a 'local' app will be built for a single core, but often it can be loaded on all cores.
APP_CLIENT and DSP_SERVER typically go together, and indicate that all examples that support remote execution of algorithms should be built. If DSP_SERVER is set in the PROGRAMS variable and an appropriate multi-core platform is set in the DEVICES variable, the examples in examples/ti/sdo/ce/examples/servers may be built. APP_CLIENT indicates the "client" side of a "client/server" system, so 'client' apps (e.g., GPP-side apps for heterogenous systems and 'master' core apps for homogeneous systems) will be built.
Note that you can set all 3 (APP_LOCAL, APP_CLIENT, and DSP_SERVER) or any subset of them. As a further example, if only DSP_SERVER is set, no applications will be built, but all components required to create a server (including algorithms) will be built.
The *_FORMAT variables (e.g. C64P_FORMAT, C674_FORMAT) indicates which file format the binaries should be built for. On some architectures, Codec Engine supports multiple binary file formats (e.g. COFF and ELF) and and this variable describes which file formats should be built. This variable can be set to more than one value (e.g. setting it to "ELF COFF" will build both ELF and COFF if Codec Engine supports it.
If you are on an architecture where only one binary file format is supported, there may not be a variable you need to set. For example, there is no "WINCE_FORMAT" since we only support one type of WinCE binary.
The xdcpaths.mak file also contains variables to indicate where products which Codec Engine may depend on are installed. The list of dependent products is a direct result of what values are assigned in the DEVICES, GPPOS and PROGRAMS variables. For example, if you've set PROGRAMS to only APP_LOCAL, DEVICES to only DM355, and GPP_OS to LINUX_UCLIBC, you aren't required to provide DSPLINK_INSTALL_DIR, BIOS_INSTALL_DIR, CGTOOLS_V5T or CC_V5T
Further, if you're using a "full" installation of Codec Engine (see http://tiexpressdsp.com/index.php?title=Codec_Engine_FAQ#Why_do_some_distributions_have_a_cetools_directory_and_others_don.27t.3F for more details), many of the dependencies will be "auto-assigned" for you to the cetools/packages directory.
Also, if you're building for a heterogenous device, and only want to build for a subset of the cores, you can set the toolchain for the _other_ cores (that you don't want to build for) to empty. Make sure you don't accidentally set the variable to a 'space' character, the value must actually be an empty string - that is, there should be no space after the '=' char.
Please refer to the comments throughout xdcpaths.mak for more details.
Each directory contains a GNU makefile which enables you to build the sample in the current directory. Top-level directories also contain a makefile which steps into subdirectories and builds all the examples under the parent directory.
FYI, the xdcpaths.mak file is included by the individual makefiles for all the example codecs, servers, and applications.
Please keep in mind that MOST BUILD TROUBLES OCCUR WHEN ONE OF THE VARIOUS *_INSTALL_DIR VARIABLES ARE INCORRECT! Make sure there are no extra spaces (check the end of lines!), that every individual path (segment separated by the semicolon) is correct, character for character, and the build process is very likely to go smoothly.
Change directory to ti/sdo/ce/examples/codecs and type
gmake clean
gmake
Alternatively, you can change into a specific codec's directory (e.g. ti/sdo/ce/examples/codecs/viddec_copy), and type
gmake clean
gmake
Change directory to ti/sdo/ce/examples/extensions and type
gmake clean
gmake
Alternatively, you can change into a specific example extension directory (e.g. ti/sdo/ce/examples/extensions/scale), and type
gmake clean
gmake
Note that this is only necessary for multi-core environments, like DM6446, OMAP3, C6472, etc.
Change directory to ti/sdo/ce/examples/servers and type
gmake clean
gmake
Alternatively, you can change into a specific server's directory (e.g. ti/sdo/ce/examples/servers/all_codecs), and type
gmake clean
gmake
Note: when developing your own algorithms and applications, you will likely take one of the server examples and modify it to suit your needs.
Change directory to ti/sdo/ce/examples/apps (where the makefile is) and type
gmake clean
gmake
Most of the Codec Engine examples are designed to support both local and remote application configurations, and are portable to multiple platforms. Linux based systems require the loading of one or more kernel drivers in order to run the examples. This is described in the following section.
We will use the following additional notation:
We assume you have your EVM properly set up, and that you are able to mount an NFS.
You must pass the MEM=120M (or less than 120M) parameter to your Linux kernel from your u-boot prompt, or you must have your Linux kernel configured to use no more than 120MB of physical memory. Read more in the following sections about the memory map.
Copy the following necessary files into a directory visible from the EVM board (e.g. an NFS or hard drive mount, etc):
The following line in loadmodules.sh, specifies the start and end addresses of CMEM memory, and instructs the CMEM module to set aside three pools, one containing 20 4K buffers, one containg 10 128K buffers, and the third containing two 1MB buffers.
CMEM_MODPARAMS="phys_start=0xa0000000 phys_end=0xa07fffff pools=20x4096,10x131072,2x1048576"
This is good enough for the Codec Engine example applications; your application will likely need different settings.When you run the loadmodules.sh script, you should see output similar to the following (if the output does not appear on the console, try running dmesg to see the output):
$ ./loadmodules.sh SysLink version : internal sl tree SysLink module created on Date:Jul 15 2011 Time:15:23:23 Trace disabled Trace entry/leave prints enabled Trace SetFailureReason enabled Trace class 3 CMEMK module: built on Mar 15 2011 at 16:05:39 Reference Linux version 2.6.37 File /db/atree/library/trees/ce/ce-s13x/imports/ti/sdo/linuxutils/cmem/src/module/cmemk.c allocated heap buffer 0xc9000000 of size 0x4ac000 cmemk initialized
app.xv5T [-p proc] [-e engine] [-s serverSuffix] [-m mapFile] input-file output-file
The options are:
./app_local.xv5T -e "speech1_copy"
CE_INSTALL_DIR/examples/ti/sdo/ce/examples/buildutils
They can be modified if needed, and copied to the same direcotory on your EVM's file system where you have copied the remote server and app.Build the examples as described in the previous sections, and copy into
a directory visible from the EVM board. The servers and GPP client executables
must sit in the same directory together). For example,
to run the universal_copy example, you need:
You can also copy the sample input file to the same directory:
Boot the EVM, change to the directory where you have copied cmem.ko,
syslink.ko, and loadmodules.sh, and run
sh ./loadmodules.sh
to install drivers necessary for your device (e.g. CMEM and
SysLink) with appropriate information about the memory map.
Next, change to the directory where you have copied the Codec Engine examples. To run the client application, using the DSP as the remote server, (which will automatically load the DSP server image):
./app_remote.xv5T -p DSP -s xe674
The -p <procId> option is used to specify which slave
processor is to be loaded with the server image.
The -s <suffix> is
the suffix used in the server executable name: xe674 for all_DSP.xe674,
xem3 for all_VIDEO-M3.xem3. The server name for this example
is specified in the configuration file, remote.cfg, located in
<CE_INSTALL_DIR>/examples/ti/sdo/ce/examples/buildutils
Many of the remote examples use this common configuration file.
You will see several output lines:
root@arago:# ./app_remote.xv5T -s xe674 [t=0x000017c7] [tid=0x4007c000] xdc.runtime.Main: main> ti.sdo.ce.examples.apps.universal_copy [t=0x00001f2e] [tid=0x4007c000] xdc.runtime.Main: [+1] App-> Application started, procId DSP engineName remote_copy_DSP input-file ./in.dat output-file ./out.dat. [t=0x000421c5] [tid=0x4007c000] xdc.runtime.Main: [+1] Alg version: 1.00.00.00 [t=0x000435f5] [tid=0x4007c000] xdc.runtime.Main: [+1] App-> Processing frame 0... [t=0x000437bf] [tid=0x4007c000] xdc.runtime.Main: [+2] App-> Alg frame 0 process returned - 0x0 [t=0x000438a5] [tid=0x4007c000] xdc.runtime.Main: [+1] App-> Processing frame 1... [t=0x00043a27] [tid=0x4007c000] xdc.runtime.Main: [+2] App-> Alg frame 1 process returned - 0x0 [t=0x00043aae] [tid=0x4007c000] xdc.runtime.Main: [+1] App-> Processing frame 2... [t=0x00043c39] [tid=0x4007c000] xdc.runtime.Main: [+2] App-> Alg frame 2 process returned - 0x0 [t=0x00043cbd] [tid=0x4007c000] xdc.runtime.Main: [+1] App-> Processing frame 3... [t=0x00043e22] [tid=0x4007c000] xdc.runtime.Main: [+2] App-> Alg frame 3 process returned - 0x0 [t=0x00043e95] [tid=0x4007c000] xdc.runtime.Main: [+1] 4 frames processed [t=0x0004f600] [tid=0x4007c000] xdc.runtime.Main: [+1] app done. root@arago:#
To run the client application, using the VIDEO-M3 or VPSS-M3as the remote serve, run one of the following commands:
./app_remote.xv5T -p VIDEO-M3 -s xem3
./app_remote.xv5T -p VPSS-M3 -s xem3
To verify that the application has executed correctly, check that the newly created out.dat file is identical to the input file, in.dat.
Assuming you included OMAP3530 in DEVICES,
LINUX_GLIBC in GPPOS and APP_CLIENT in
PROGRAMS, the ARM-side of the universal_copy example for evm3530 will
be built into the
examples/ti/sdo/ce/examples/apps/universal_copy/bin/ti_platforms_evm3530
directory.
Copy the app_remote.xv5T file to the target, along with in.dat
-- which is in the same directory, so on the target both files should be in
the same directory, as well.
The configuration file for this example, remote.cfg, is
located in examples/ti/sdo/ce/examples/buildutils, and lists
"all_DSP.x64P" as its DSP server image (indirectly by piecing together,
a serverIds configuration argument passed in from the package.bld
script, and serverSuffix).
So you must copy the all_DSP.x64P DSP
executable for evm3530 from examples/ti/sdo/ce/examples/servers
(more precisely from
examples/ti/sdo/ce/examples/servers/all_codecs/bin/ti_platforms_evm3530/
)
to the target, in the same directory where the ARM-side executable is.
Load the kernel drivers using the loadmodules.sh script, as described
in a previous section. Run the remote example as follows:
./app_remote.xv5T
Load the kernel drivers using the loadmodules.sh script, as described
in a previous section.
The evmDM365 only has the ARM, so we don't copy any DSP files on the target.
From the build directory ti/sdo/ce/examples/apps/universal_copy/ we copy
bin/ti_platforms_evmDM365/app_local.xv5T on the target, and the
in.dat file as well, making sure in.dat is in the same directory on
the target as the ARM executable.
Run the local example as follows:
./app_local.xv5T -e universal_copy
<CE_INSTALL_DIR>/ti/sdo/ce/examples/servers/all_codecs/serverplatforms.xs
In case you need to modify the memory map, you can search for your platform in this file and modify as needed. Note that each platform memory map has a memory segment named either "SYSLINK" or "DDR3_SR0". This is used for SysLink communication between the Host and the remote processor, and the SharedRegion 0 is set to this region (see <platform>.cfg for details).If you do change the memory map, you may also need to change the physical start and end address of CMEM_MODPARAMS in loadmodules.sh, to ensure that CMEM will not overlap with any of the other memory regions you modified. You may also want to change the Linux partion, by modifying the mem= boot argument in your Linux bootloader.
For more information on the default memory maps -- as addressed by the kernel module loading scripts and SYS/BIOS configuration files -- and instructions on how to change this map, please refer to http://tiexpressdsp.com/index.php?title=Changing_the_DVEVM_memory_mapLast updated: August 17, 2011