Angstrom OpenMAX

Enabling TI Hardware Accelerated Codecs
TI OpenMAX IL is released as open source (under LGPLv2) along with some DSP codecs are available under the OpenMax Project. v0.3.5 has support for MPEG-4 AAC and MPEG-4 decoders.

Extract and Install
This wiki assumes that you have unpacked, configured, and compiled the busybox file system, alsa, the kernel, and dspbrige. All of these are available on omappedia.org. You should follow the respective instructions to build each piece. Again, at this point, these pieces should be built and functioning.

Untar the main package & change to tiopenmax directory. You will find "TI-OMX-Sample-Firmware-0.X-Linux-x86-Install" in /lib/dsp. Run that installer by providing the path to the root of this package when asked for the destination directory. After installing, you should see files such as: ./lib/dsp/baseimage.dof ./lib/dsp/mp4vdec_sn.dll64P ..

Building
You need to set the following environment variables in order to succesfully build: PREFIX          - Where the output goes PKGDIR          - same as PREFIX CROSS           - The cross compiler prefix (eg arm-none-linux-gnueabi-) CROSS_COMPILER  - same as above TARGETDIR       - should be $PREFIX/rootfs OMXTESTOUTPUT   - $PREFIX/rootfs/omx BRIDGEINCLUDEDIR - Where your Bridge headers are (eg. dspbridge_mpu_api/mpu_api/inc) BRIDGELIBDIR    - Where you put your DSP libs (e.g. $TARGETDIR/rootfs/lib) Change directory to 'tiopenmax' directory and run the following make commands: make avplay.clobber avplay This builds omx video decoder, display post processor, omx aac decoder & AV Play test application. Similarly: make video_display.clobber video_display make image_display.clobber image_display

Check for the following files in your rootfs. If they are not present, they are included in the package for you.

/dspbridge cexec.out This application will load the DSP base image.

/share Too many files to list. just copy the share tree from the location where you unpacked your tarball.

/lib libasound.so.2.0.0 libasound.so.2 (softlink to the above) libdl-2.5.so libdl.so.2 (soflink to the above)

Testing
To run any test app, this step must be done first:

cd ./dspbridge (This step need not be done if DSPBridge is built in to the kernel) ./uninstall_bridge ./install_bridge mdev -s ./cexec.out /lib/dsp/baseimage.dof ../bin/OMXAudioManager & ../bin/OMXResourceManager & echo -n 0 > /sys/power/enable_mpucoreoff echo 0 > /sys/power/fb_timeout_value

These above OMX components could be used with the GStreamer plug-ins (using this library).

Please note that these steps haven't been validated yet on Zoom2 using L-O kernel as currently Zoom2 support is being added to the L-O sync kernel. 2.6.27 O-Z kernel could not be used successfully on Angstrom due to an Xserver crash that was observed.

TI OMX with Angstrom on Zoom36x
TI OMX source and binaries are available as part of the L23.i3.3 community release that has been made on Poky. The same can be used with Angstrom. The below lists the supported features in the Community Release

MM Use Cases (DSP)and TI OMX Components
MPEG4/H263 Video Dec MPEG4/H263 Video Enc H264 Video Dec JPEG Dec JPEG Enc AAC Dec

The package containing DSP binaries and OMX Components can be obtained from the OpenMax project site for OMAP https://gforge.ti.com/gf/project/openmax/frs/ This package is referenced as RLS23.i3.3.

Angstrom Filesystem with Pre-built binaries
The release package also contains pre-built binaries that can be used directly with Angstrom file system.

Build / Add the various components to use TI OMX/DSP
 * Angstrom filesystem - Build the X11 Gnome Image using Narcissus Image Builder. The machine to be chosen is OMAPZoom2. The same file system also works for Zoom36x. But build the bootloader and kernel for Zoom36x to use on Zooom36x.
 * DSP bridge - Build the DSP bridge and samples following the instructions at http://omappedia.org/wiki/DSPBridge_Project
 * DSP bridge files can be copied from /usr/lib
 * libqos.so.2, libqos.so, libqos.a, libbridge.so.2, libbridge.so
 * DSP bridge samples can be copied from /dspbridge folder
 * TI OMX/DSP components - Untar the L23.i3.3 package
 * DSP Socketnodes - Obtain the DSP binaries from the TI OMX/DSP release package
 * Install "TI_Community_LO/DSPbinaries-3.09-Linux-x86-Install" and accept the license
 * DSP binaries (dll64P) and other files will be in "Binaries" folder in which it was installed
 * Move qosdyn_3430.dll64P to file system location /dspbinaries. The rest of the binary files need to be moved to /lib/dsp directory in the file system.
 * OMX binaries - OMX binaries can be taken from the reference package; OMX binaries can also be built using the recipes available
 * Untar the reference image(Poky file system) - TI_Community_LO/ti_references/binaries/images/omap-image-sato-zoom3-20100219145740.rootfs.tar.gz
 * Copy the OMX binaries (listed below) into the Angstrom file system under /usr/bin
 * AacDecoder_Test, OMXAudioManager, JpegTestCommon, JPEGEncoderTest_multiple, JPEGTestEnc_common, PostProcTest, VPPTest_common, OMXResourceManager, VidDecTest_common, VideoEncTest, OMXPolicyManager, policytable.tbl, armtime, perf, _perf.ini, PREF.awk, PERF_reader, PERF_test
 * Copy the libraries from /usr/lib of the reference image into the Angstrom file system at /usr/lib
 * libOMX.TI.Video.encoder.so, libOMX.TI.Video.Decoder.so, libOMX_ResourceManagerProxy.so, libRAM.so, libOMX.TI.VPP.so, libOMX.TI.PostProc.so, libPERFc.so, libLCML.so, libOMX.TI.JPEG.encoder.so, libOMX.TI.JPEG.decoder.so, libOMX_Core.so, libOMX_Clock.so, libOMX.TI.AAC.decode.so
 * Gstreamer plugins are also available to support the OMX MM use cases. Gstreamer has to be built as part of the Angstrom file system. Other gstreamer components needed can be copied from the reference package
 * Copy libgoo and gst-goo files to enable the TI OMX support

'''Community Contribution: Add a script that would pull the TI references from the release package (detailed above) into the pre-built Angstrom filesystem so that it can be readily used before building the entire file system with TI components

Test TI OMX

 * DSP bridge is built as a kernel module. Copy the .ko file into root
 * insmod bridgedriver.ko


 * Start DSP bridge
 * ./etc/init.d/bridge start


 * Call DSP baseimage.dof
 * ./dspbridge/samples/cexec.out /lib/dsp/baseimage.dof


 * OMX test apps can be used to test the MM use cases
 * e.g. ./AacDecoder_Test / STEREO TC_1 22050 DM PS 8192 EProfileLC SBR NON_RAW 2000 1 1 NON_FRAME
 * Similarly other OMX test apps can be run with the available test apps. The format and parameters needed will be listed in an example when the test app is called


 * The applications can also be tested at Gstreamer level. Make sure Gstreamer is built as part of the Angstrom file system
 * Instructions to test with gstreamer can be obtained from Test Execution User Guide

Building TI OMX within OE/Angstrom

 * Copy TI OMX reciped and source files into OE build env.
 * cp -r ${HOME}/TI_Community_LO/meta-texasinstruments/packages/tiopenmax/ ${OETREE}/openembedded/recipes


 * Copy DSP Bridge
 * cp -r ${HOME}/TI_Community_LO/meta-texasinstruments/packages/tidsbbridge/ ${OETREE}/openembedded/recipes


 * Copy ccasefetch.bbclass - This is a temporary addition, and will go away as soon as the recipes are properly revised
 * cp -r ${HOME}/TI_Community_LO/meta-texasinstruments/classes/ccasefetch.bbclass ${OETREE}/openembedded/classes
 * Copy the Source files
 * mkdir ${OETREE}/sources
 * cp -r ${HOME}/TI_Community_LO/ti_references/sources/tiopenmax-*P1*gz ${OETREE}/sources


 * Build tidspbridge-lib - This may be a dependency for tiopenmax
 * bitbake tidspbridge-lib


 * Build all tiopenmax components - the below commandline script can help gather all the proper names, rather than trying to build each individually
 * ls ../openembedded/recipes/tiopenmax/tiopenmax-*P1*bb|awk -F/ '{print $5}'|awk -F_ '{print $1}'|xargs bitbake


 * The built components can be copied from the /tmp/work/.../image/... location