编译和运行Codec Engine examples介绍【转】

本文档详细介绍了如何使用CodecEngine构建示例项目的过程,包括复制示例树、编辑构建文件、定义环境变量、构建不同组件及将文件复制到目标设备上运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. [Optional] Copy the entire "examples" tree out of the product

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:(一定要注意这几个环境变量,变量定义在下面提到的.mak中):

  • <CE_EXAMPLES_INSTALL_DIR> - absolute path of the examples directory or the copy you made, e.g. /usr/work/examples
  • <CE_INSTALL_DIR> - root directory of your Codec Engine installation. The original examples are in <CE_INSTALL_DIR>/examples.
  • <BIOS_INSTALL_DIR> - root directory of your DSP/BIOS installation.
  • <XDC_INSTALL_DIR> - root directory of your xdctools installation.
  • directory/file - position of the file relative to the examples directory; for examples, ti/sdo/ce/examples/codecs/makefile refers to <CE_EXAMPLES_INSTALL_DIR>ti/sdo/ce/examples/codecs/makefile.
2. Edit top-level build files to customize the build for your software installation and your hardware

At the root of the Examples directory are two build-related files that all Codec Engine examples include. We edit both of these files to specify where various software components needed by Codec Engine are on our system, and to narrow the list of hardware targets we want to build for (thereby reducing the build time and possibly the scope of external components needed).

2.1 Edit XDC user build configuration file, user.bld

File user.bld at the root of the Examples directory informs the XDC tools (tooling which the Codec Engine uses to build itself, codecs, servers, etc) where to find compilers and other tools on the user's system, and also what platforms to build for. Open this file in a text editor.

Locate in the file a build table that lists whether to build the examples for the ARM, for the DSP, and for native Linux. Each of those three has a list of supported "targets", i.e. runtime environments, for example the TI C64+ compiler for the DSP, the Montavista Arm9 and the ucLinux ARM 9 for the ARM. Those "targets" support several platforms, for example the Montavista ARM 9 target supports "evmDM6446", "evmDM355", and other platforms.

Following the simple instructions in the file's comments, disable builds that you are not interested in, in order to save time. For example, you may not be interested in building anything for the DSP; or, for the ARM, you may be interested in building only for target, "Montavista ARM 9", and for that target, you will likely be interested in only one platform, for example "evmDM6446", or "evmDM355".

For the targets that you do want to build for, you will specify the base directories of their respective tool chains, as explained and exemplified in the comments in the file.

2.2 Edit xdcpaths.mak to define the necessary variables

编译和运行Codec Engine examples介绍【转】 - chenaini119 - 我的博客我的生活
就是根据你的文件目录所在修改这几个环境变量。

The xdcpaths.mak file, also located at the root of the examples/ directory, defines where the Codec Engine is installed, where BIOS is, where the XDC tools are, and where individual Codec Engine packages are. Open this file in a text editor.

Follow the instructions in the file to specify the following:

  • (Optional) List of hardware devices you want to build for (DM6446, DM355, etc.). This list is specified in the DEVICES variable. You will likely be interested in only one or two devices, so reduce this list to your minimum to shorten the build time and to avoid being asked for the location of components you don't need.
  • (Mandatory) Installation directories for the Codec Engine itself, for the XDC tools, and for the DSP/BIOS (if you build for the DSP). Those you specify in CE_INSTALL_DIR, XDC_INSTALL_DIR, and BIOS_INSTALL_DIR variables, as explained in details in the comments in the file you are editing.
  • (Mandatory, depending on your Codec Engine distribution) Installation directories for the "minor" components needed by the Codec Engine, such as XDAIS, Framework Components, DSP/BIOS Link, and CMEM memory manager. If you have a "full" Codec Engine distribution that has a cetools/ directory at its top, all these components will automatically be included. If you don't have this distribution, and instead XDAIS, DSP/BIOS Link and others are installed in other directories, you will have to specify their location.
  • (Mandatory) Location of the compiler tools for architectures you'll be building examples for, specifically Montavista Arm9 and TI C64x

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, that every individual path (segment separated by the semicolon) is correct, character for character, and the build process is very likely to go smoothly.

3. Build example codecs

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

4. Build example extensions

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

5. Build example DSP servers

Note that this is only necessary for dual processor environments, like DM6446.

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/video_copy), and type

    gmake clean
    gmake

Note: when developing your own codecs and applications, you will likely take one of the DSP server sample and modify it to suit your needs. These are the source files for this server application that you need to know about:

  • *.cfg: Configuration script that determines what codecs should be included in the server, and how some of the components (e.g. DSKT2 and DMAN3) will be configured. (server配置文件)
  • *.tcf: TConf file for the app. It is set to allow for a generous heap of 122MB and for 4MB of static code and data. Be very careful with changing the memory map. (DSP/BIOS的配置文件)
  • main.c: generic main()
  • link.cmd: application specific linker command file.
6. Build the GPP applications

Change directory to ti/sdo/ce/examples/apps (where the makefile is) and type

    gmake clean
    gmake

7. Copy files to the target and run

For a given application you want to run, you need to copy that application's executable on the target, and if your application requires a DSP server, you need to copy that DSP server on the target as well. (You can see which DSP server -- a DSP binary with .x64P extension -- is required by the application if you look at the application's .cfg file.) In addition, you should copy the input data file "in.dat" to the target, keeping the relative position between the application executable and the in.dat file.

Also, you must make sure that all the required kernel modules (.ko's) for your target are loaded (tyically via the loadmodules.sh shell script.)

Example 1: Running the audio_copy example on evmDM6446:
The ARM-side of the audio_copy example for evmDM6446 is in directory examples/ti/sdo/ce/examples/apps/audio_copy/dualcpu/evmDM6446. Copy the app.out 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 ceapp.cfg file in that directory lists "all.x64P" as its DSP server image, so you must copy the all.x64P DSP executable for evmDM6446 from examples/ti/sdo/ce/examples/servers (more precisely from examples/ti/sdo/ce/examples/servers/all_codecs/bin/evmDM6446/) to the target, in the same directory where the ARM-side executable is.

Example 2: Running the video1_copy example on evmDM355:
The evmDM355 only has the ARM, so we don't copy any DSP files on the target. From the build directory ti/sdo/ce/examples/apps/video1_copy/ we copy bin/evmDM355/app_local.xv5T on the target, and the in.dat file as well, making sure in.dat is one level above the ARM executable on the target as it is in the build directory.

4.最后其实还有最重要的Memory map

    由于以上的默认配置都是TI的EVM配置,256MDDR,不一样就需要对内存地址进行下分配,请参照:  

    http://processors.wiki.ti.com/index.phptitle=Changing_the_DVEVM_memory_map

5.从实例中了解下配置文件

编译和运行Codec Engine examples介绍【转】 - chenaini119 - 我的博客我的生活
其中的local.cfg是arm端的配置文件

         remote.cfg是dsp端的配置文件

<think>好的,用户问的是example文件夹应该放在哪里。我需要先看看提供的引用中有没有相关信息。 引用[1]提到,找到正确路径后,把examples文件夹(注意里面要有tutorials文件夹)放入,问题就解决了。还附了一个博客链接。这说明可能需要将examples放在某个特定目录下,比如项目的根目录或者与代码相关的路径。用户需要注意文件夹结构,确保tutorials存在其中。 引用[4]中的codec engine示例提到了buildTable配置,里面指定了编译器的路径。这可能意味着某些项目需要根据配置文件的设置来放置examples,可能需要放在编译工具链指定的目录下,或者与平台相关的路径中。例如,Arm工具的路径设置可能会影响examples的位置。 引用[2][3]关于MATLABPython的文件操作,虽然提到了保存数据复制文件,但可能用户的问题关联不大,但可以补充说明不同环境下的处理方式,比如在Python项目中可能需要将examples放在脚本能访问的路径,或者使用绝对路径引用。 综合来看,主要根据项目或工具的要求来决定。常见的位置可能是项目根目录、特定子目录如src/docs,或者遵循框架的约定。用户需要检查文档或配置文件中的路径设置,确保examples的位置符合这些要求。例如,引用[1]的例子可能需要放在项目根目录,而引用[4]可能需要根据cgtoolsRootDir等配置来调整。 还需要考虑跨平台的情况,路径分隔符可能不同,比如Linux用/,Windows用\。此外,权限问题也可能影响,确保程序有权限访问该目录。如果用户遇到问题,建议参考提供的博客链接或相关文档,并检查路径配置是否正确。 最后,生成相关问题时要覆盖常见的使用场景,比如不同系统下的处理、配置调整、权限问题等,帮助用户全面理解。</think>关于**example文件夹的放置位置**,需根据具体使用场景工具要求决定。以下是常见情况及解决方案: 1. **项目根目录** 若框架或工具链(如引用[1]中的案例)要求`examples`文件夹与主程序同级,则需将其放在**项目根目录**下,例如: ``` project_root/ ├── src/ ├── docs/ └── examples/ <-- 放置在此处 ``` 2. **编译器或工具链指定路径** 如引用[4]中`codec engine`示例所示,若配置文件(如`buildTable`)指定了工具链路径(如`cgtoolsRootDir`),则需将`examples`文件夹放在**工具链相关目录**中,确保编译时能正确调用。 3. **动态配置路径** - **Python脚本**:可通过代码动态设置路径(参考引用[3]),例如: ```python import os example_path = os.path.join(os.getcwd(), "examples") ``` - **MATLAB**:使用`save`命令时指定完整路径(参考引用[2]),例如: ```matlab save('D:/project/examples/data.mat', 'A'); ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值