background image

Codec Engine Server Integrator 

User's Guide

Literature Number: SPRUED5B

September 2007

Summary of Contents for Codec Engine Server

Page 1: ...Codec Engine Server Integrator User s Guide Literature Number SPRUED5B September 2007 ...

Page 2: ...vice and is an unfair and deceptive business practice TI is not responsible or liable for any such statements TI products are not authorized for use in safety critical applications such as life support where a failure of the TI product would reasonably be expected to cause severe personal injury or death unless officers of the parties have executed an agreement specifically governing such use Buye...

Page 3: ...x html Codec Engine SPI Reference Guide CE_INSTALL_DIR docs spi html index html Configuration Reference CE_INSTALL_DIR packages xdoc index html Example Build and Run Instructions CE_INSTALL_DIR examples build_instructions html Codec Engine Application Developer s Guide SPRUE67 Codec Engine Algorithm Creator User s Guide SPRUED6 xDAIS DM Digital Media User Guide SPRUEC8 TMS320 DSP Algorithm Standar...

Page 4: ...fic to a particular type of system For example this icon identifies information that applies if you are using Codec Engine on a dual processor GPP DSP system Trademarks The Texas Instruments logo and Texas Instruments are registered trademarks of Texas Instruments Trademarks of Texas Instruments include TI DaVinci XDS Code Composer Code Composer Studio Probe Point Code Explorer DSP BIOS RTDX Onlin...

Page 5: ...s a Codec Server 2 3 2 1 2 What is the Execution Flow 2 3 2 1 3 What About Single Processor Systems 2 5 2 1 4 What Algorithms Can a Codec Server Integrate 2 6 2 1 5 What Examples Exist 2 6 2 1 6 What is the Config Kit 2 6 2 2 Creating a Codec Server 2 7 2 2 1 Creating a Package 2 7 2 2 2 Editing the Package Definition 2 8 2 2 3 Editing the Codec Server Configuration Script 2 8 2 2 4 Editing the DS...

Page 6: ... vi ...

Page 7: ... chapter introduces the Codec Engine 1 1 What is the Codec Engine 1 2 1 2 Why Should I Use It 1 3 1 3 Where Does the Codec Engine Fit into My Architecture 1 4 1 4 What Are the User Roles 1 6 1 5 Where Can I Get More Information 1 9 Topic Page ...

Page 8: ...ace Standard for Digital Media It is sometimes referred to as xDAIS DM Any xDM algorithm is compliant with the eXpressDSP Algorithm Interface Standard xDAIS Additionally it implements the xDAIS DM xDM interface an extension to the xDAIS standard that provides support for digital media encoders decoders and codecs The xDM specification defines APIs for digital media codecs by class with extensions ...

Page 9: ...w changes over time If changing the location where the algorithm runs were easy you wouldn t have to weigh performance issues against the difficulty of changing the application For market success most applications need to support multiple codecs to handle the same type of media For example an application might need to support three or four audio formats Programmers with a GPP general purpose proce...

Page 10: ...ser Roles for more on user roles The application or middleware it uses calls the core Engine APIs and the VISA APIs The VISA APIs use stubs to access the core engine SPIs System Programming Interfaces and the skeletons The skeletons access the core engine SPIs and the VISA SPIs The VISA SPIs access the underlying algorithms Codec Engine Runtime Video Encode stubs Video Encode stubs Core Engine SPI...

Page 11: ...decs are on the DSP and the application and video encoder stubs are on the GPP Since Codec Engine is flexible alternate diagrams could be shown for GPP only and DSP only systems GPP DSP Codec Engine Runtime Application Video Encode stubs Video Encode stubs Core Engine SPIs Core Engine SPIs VISA SPIs VISA SPIs DSP Server app processor DSP Server app processor Core Engine Runtime VISA APIs Core Engi...

Page 12: ...nd configured by Codec Engine If the codec is xDM compliant Codec Engine s VISA APIs support remote execution without additional support However if the codec is not xDM compliant and the codecs support remote execution the Algorithm Creator should supply Codec Engine skeletons and stubs The Algorithm Creator uses xDAIS and the XDC Tools which includes a configuration kit Using these the Algorithm ...

Page 13: ...thm Creators This person uses Codec Engine and its dependent packages DSP BIOS DSKT2 etc along with the XDC Tools to create the following A server configuration file cfg A server DSP BIOS configuration file tcf A simple main routine to do minimal initialization A DSP executable created by executing the configuration scripts and compiling the output This executable is a Codec Server The Server Inte...

Page 14: ...rver is not used The Engine Integrator hands the Engine configuration file to the Application Author The Engine Integrator uses the following resources Chapter 5 of Codec Engine Application Developer s Guide SPRUE67 Configuration Reference CE_INSTALL_DIR packages xdoc index html Example Build and Run Instructions CE_INSTALL_DIR examples build_instructions html Example configuration scripts cfg 1 4...

Page 15: ...ll If the application runs on Linux the application does not need to configure the operating system The Application Author uses the following resources Codec Engine Application Developer s Guide SPRUE67 Codec Engine API Reference CE_INSTALL_DIR docs html index html Example Build and Run Instructions CE_INSTALL_DIR examples build_instructions html 1 5 Where Can I Get More Information The release_no...

Page 16: ...1 10 ...

Page 17: ...g a Codec Server This chapter describes how the Server Integrator should configure a Codec Server for use by the Engine Integrator 2 1 Overview 2 2 2 2 Creating a Codec Server 2 7 2 3 Delivering a Codec Server 2 16 Topic Page ...

Page 18: ...ponents and Codec Engine The Server Integrator uses Codec Engine and its dependent packages DSP BIOS DSKT2 etc along with the XDC Tools to create the following A server configuration file cfg A server DSP BIOS configuration file tcf A simple main routine to do minimal initialization A DSP executable created by executing the configuration scripts and combining the various packages This executable i...

Page 19: ...r remote on the DSP When remote Codec Engine automatically manages the necessary creation communication invocation and eventual deletion of codecs from the DSP 2 1 2 What is the Execution Flow As an example of the execution flow on a dual CPU system such as the DM644x device the following steps summarize the execution flow when a GPP application uses a remote codec to perform audio encode on the D...

Page 20: ...ges the priority of the node s thread from suspended to its configured execution priority This change in priority causes the node s execute function to run in the newly created node s execution context This function blocks awaiting commands from the GPP 2 The application calls the VISA process API for example AUDENC_process which results in a remote procedure call to the DSP The GPP side algorithm...

Page 21: ...SP with a command to exit On the DSP the remote node wakes upon receipt of the exit message and sends an acknowledgement back to the GPP On the GPP a node delete message is formed and then sent to the dispatcher on the DSP The dispatcher wakes up and deletes the remote node s execution thread The node specific delete function for example AUDENC_delete is invoked to free algorithm resources and to ...

Page 22: ...ring in the create function Everything else should remain the same Note that the application must be aware of the restrictions of the algorithm it is trying to invoke For example TI video decoders expect one frame of data to work properly 2 1 5 What Examples Exist You can use the Codec Servers as examples for creating your own Codec Servers These servers are provided as part of the Codec Engine di...

Page 23: ...n this section use the CE_INSTALL_DIR examples servers video_copy example So long as the algorithms you want to use implement the xDM interface the coding needed is limited to a simple main routine in C code to initialize the Codec Engine The rest of the integration is by providing configuration information to create the Codec Server 2 2 1 Creating a Package Follow these steps to set up environmen...

Page 24: ...kage For example to call your server my_server change the bolded portion as follows package my_companyname my_project my_server The package name must reflect the directory structure under the examples directory For example a package in the example my_company my_project my_server directory must have a name of my_company my_project my_server You should use this companyname convention to ensure that ...

Page 25: ...hat the task threads created by the Codec Server should run at the minimum priority level var Server xdc useModule ti sdo ce Server Server threadAttrs priority Server MINPRI To create your own cfg file for your server follow these steps 1 Rename the cfg file in your server directory to match the name of your server For example your file might be called my_server cfg 2 Edit the servername cfg file ...

Page 26: ...le in this Codec Server by modifying the Server algs array For example statements from the video_copy cfg file have been added and modified bold text to reference the speech encoder decoder and to give audio processing a higher priority than video processing Server algs name viddec_copy mod VIDDEC_COPY threadAttrs stackSize 4096 stackMemId 0 priority Server MINPRI 1 name videnc_copy mod VIDENC_COP...

Page 27: ...play for video decoders Next determine the number of the buffer you want to manage Buffers are numbered 0 to 15 You re typically looking for buffer number 0 or 1 Finally set the buffer s cache management field to false as shown in this example var H264ENC xdc loadModule ti sdo codecs h264enc H264ENC don t cache manage inbuf 0 H264ENC manageInBufsCache 0 false don t cache manage outbuf 1 H264ENC ma...

Page 28: ... DSKT2 but you can affect how it manages the scratch areas by defining the optional groupId field for each algorithm in the array of Server algs configuration If you do not set the groupId field no sharing will take place This is fine if you have enough internal external memory Otherwise you can set it per algorithm as is the case in the video_copy server example The array of algorithms this serve...

Page 29: ...ed algorithms on a DM643x DSP only are configured into an Engine Server algs groupId For each algorithm in the respective algs array if the optional groupId is uninitialized the algorithm will be configured into a group with other algorithms that have their groupId field uninitialized and run at the same priority If no algorithms have both of these attributes it will be in a unique groupId Exactly...

Page 30: ...tcf from CE_INSTALL_DIR examples servers all_codecs to your server directory Rename it to match the name of your server For example your file might be called my_server tcf 2 Edit the servername tcf file with a text editor 3 Make any changes your Codec Server requires and save the file For the Codec Server the task threads used to process algorithms are created dynamically at runtime This configura...

Page 31: ... also provides resource monitoring services to the Codec Engine Runtime For example it reports overall DSP CPU load to the GPP transfers execution trace data from the DSP to the GPP and controls the acquisition of DSP trace information based on GPP commands Although the Codec Engine uses the DSP BIOS CLK services the initial release does not require timer interrupts and configures the DSP BIOS CLK...

Page 32: ... threads after main completes you should only put initialization statements in main and main must run to completion rather than looping 2 2 8 Editing the makefile The makefile should not require changes However you may need to add repositories to the XDC_PATH used in the makefile by modifying the xdcpaths mak file 2 3 Delivering a Codec Server To distribute a Codec Server you should deliver the pa...

Page 33: ... the release Pkg otherFiles package info Also modify the makefile to run the xdc release step as the main goal differences shown in bold EXAMPLES_ROOTDIR CURDIR include EXAMPLES_ROOTDIR xdcpaths mak add the examples directory to the list of paths to packages XDC_PATH EXAMPLES_ROOTDIR XDC_PATH include EXAMPLES_ROOTDIR buildutils xdcrules mak run xdc release to create a tar file with the server s al...

Page 34: ...ory SERVER_PKG ti sdo ce examples servers video_copy evmDM6446 SERVER_PKG_ARCHIVE subst _ SERVER_PKG tar create server release package and archive it the package contains the executable and some meta info files SERVER_PKG_ARCHIVE SERVER_EXE echo Creating server release rm rf package package echo package SERVER_PKG package xdc echo Pkg otherFiles SERVER_EXE package info package bld mkdir package cp...

Page 35: ...r 1 7 Codec Server 2 3 building 2 15 configuring algorithms 2 8 configuring DSP BIOS 2 14 creating 2 7 delivering 2 16 documentation 2 16 Config Kit 2 6 Configuration Reference 1 9 2 8 configuration script cfg 2 7 tcf 2 7 CPU load 2 15 D debug version 2 16 delivering a Codec Server 2 16 directory for package 2 8 DMA 2 11 DMAN3 manager 2 10 documentation to provide 2 16 DSKT2 manager 2 10 2 12 2 13...

Page 36: ...rator 1 7 2 2 RTSC tools 2 6 S scratch memory 2 12 server configuration 2 9 Server Integrator 1 7 2 2 server name 2 16 Server Codec 2 3 Server algs array 2 10 servername cfg file 2 8 single processor systems 2 5 skeletons 1 4 2 6 stubs 1 4 2 6 T task threads 2 3 2 14 2 15 tcf file 2 7 2 14 Tconf 2 8 configuration 2 7 threadAttrs structure 2 9 ti sdo ce package 2 9 ti sdo fc package 2 10 type of bu...

Reviews: