Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

Using the community kernel on DM6446 with the DVSDK

From Texas Instruments Wiki
Jump to: navigation, search

Introduction

This wiki topic describes how to upgrade DVSDK 2.00 to use the community kernel. Because later versions of the kernel require new component versions of most of the multimedia stack you will have to upgrade several of the DVSDK components.

Note! You have to follow these instructions to the letter and in the right order to be successful.

Caution! This procedure is not meant for beginners, and may not be suitable even for advanced users. The DM6446 DVSDK components are not fully tested against the community (GIT) kernel and thus this process is not officially supported. Not all of the DVSDK demo functionality works with these components as noted at the bottom of the article in Executing the demos.

All instructions assume you are directly connected to the internet, i.e. not through a firewall. If you are, you will have to set up GIT to work with your firewall, see the git-config manual page.

These instructions are known to work on Ubuntu 10.04 LTS, your mileage may vary on other Linux host distributions.

Installing the DVSDK

The documentation below assumes you have downloaded the DVSDK 2.00 from http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_2_00/latest/index_FDS.html. You will need to download and install the following:

  • Linux DVSDK Installer for DM355 DM6446 and DM6467
  • Linux CODEC Server Installer for DM6446
  • Codegen Tools
  • DSP/BIOS Installer
  • DM6446 A/V Data

Install dvsdk 2.00, codegen tools and dspbios in to the ${HOME} directory. If you do not know which directory this is execute:

$ echo ${HOME}

Accept the default installation path for the codec server installer. Wait with the DM6446 A/V Data for later (data.tar.gz), leave the file in ${HOME}.

Installing the GNU toolchain

Download and install the CodeSourcery GNU toolchain to ${HOME} from http://www.codesourcery.com/sgpp/lite/arm/portal/release858. The IA32 GNU/Linux TAR version can be installed easily in to your home directory using:

$ cd ${HOME}
$ tar xjf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

Set up an environment variable to point to the code sourcery toolchain:

$ export CROSS_COMPILE=${HOME}/arm-2009q1/bin/arm-none-linux-gnueabi-

The documentation also assumes you've set up an environment variable to point to your DVSDK 2.00 installation directory like:

$ export DVSDK=${HOME}/dvsdk_2_00_00_22

Setting up your Ubuntu host

These instructions assume your are on a Ubuntu host, if you are using a different Linux development host distribution you will have to install the equivalent packages.

Execute the following command to install the packages required to develop applications on Ubuntu:

$ sudo apt-get install git-core build-essential libncurses-dev perl subversion wget xinetd tftpd nfs-kernel-server

Updating the DVSDK build system

The top level Rules.make file contains variables which helps the various components find each other while building. Download a new Rules.make file from here: File:Rules.make.community-dm6446 v2.tar.gz and place it in ${HOME}. First make a copy of your old Rules.make:

$ cd ${DVSDK}
$ mv Rules.make Rules.make.old

Now un-tar the new Rules.make you just downloaded in the ${DVSDK} directory:

$ tar -zxvf ${HOME}/Rules.make.community-dm6446_v2.tar.gz

Now copy the new Rules.make file to be the actual Rules.make file:

$ cp ${DVSDK}/Rules.make.community-dm6446 ${DVSDK}/Rules.make

Download the top level Makefile: File:Makefile.community-dm6446.tar.gz and place it in ${HOME}. First make a copy of your old Makefile:

$ cd ${DVSDK}
$ mv Makefile Makefile.old

Now un-tar the new Makefile you just downloaded in the ${DVSDK} directory:

$ tar -zxvf ${HOME}/Makefile.community-dm6446.tar.gz

Now copy the new Makefile file to be the actual Makefile file:

$ cp ${DVSDK}/Makefile.community-dm6446 ${DVSDK}/Makefile

Updating U-Boot

Enter the DVSDK directory using:

$ cd ${DVSDK}

Execute the following:

$ git clone git://arago-project.org/git/projects/u-boot-davinci.git

When the command completes, you will have a new u-boot-davinci directory in your DVSDK directory. Enter the directory using:

$ cd u-boot-davinci

This is the Linux community kernel. GIT downloads the full version history, so you can step up and down between revisions using the git checkout command. When writing this documentation the tag DEV.DaVinciPSP.03.XX.00.37 was used. To change to this version create a new branch using:

$ git checkout DEV.DaVinciPSP.03.XX.00.37 -b DEV.DaVinciPSP.03.XX.00.37

You can follow the development of u-boot from this page: http://arago-project.org/git/projects/?p=u-boot-davinci.git;a=summary. If you would like to performer5 update u-boot use the following commands, note that the below commands are optional, using the tag above is ok:

$ git checkout master
$ git pull

You can now create a new branch from a tag as per above.

Configuring and compiling U-Boot

Assuming you installed the CodeSourcery toolchain as described above, execute:

$ make CROSS_COMPILE=${HOME}/arm-2009q1/bin/arm-none-linux-gnueabi- davinci_dvevm_config

To build u-boot execute:

$ make CROSS_COMPILE=${HOME}/arm-2009q1/bin/arm-none-linux-gnueabi-

The resulting u-boot.bin file in the current directory will need to be flashed on to your board, see the PSP installation guide.

The kernel build will need the mkimage utility to create the kernel image, so you need to add the tools/ directory to the PATH variable:

$ export PATH="$PATH:`pwd`/tools"

Updating the kernel

The community kernel can be downloaded and tracked using the GIT version control tool. You can find a good introduction to GIT at http://linux.yyz.us/git-howto.html.

Enter the DVSDK directory using:

$ cd ${DVSDK}

Execute the following:

$ git clone git://arago-project.org/git/projects/linux-davinci.git

When the command completes, you will have a new linux-davinci directory in your DVSDK directory. Enter the directory using:

$ cd linux-davinci

This is the Linux community kernel. GIT downloads the full version history, so you can step up and down between revisions using the git checkout command. When writing this documentation the tag DEV.DaVinciPSP.03.XX.00.37 was used (note this version has a problem with I2C to the MSP430 on the DM6446 EVM which is fixed in newer kernels). To change to this version create a new branch using:

$ git checkout DEV.DaVinciPSP.03.XX.00.37 -b DEV.DaVinciPSP.03.XX.00.37

You can follow the development of this kernel from this page: http://arago-project.org/git/projects/?p=linux-davinci.git;a=summary. If you would like to update your kernel use the following commands, note that the below commands are optional, using the tag above is ok:

$ git checkout master
$ git pull

You can now create a new branch from a tag as per above.

Configuring and building the Linux kernel

Assuming you installed the CodeSourcery toolchain as described above, execute:

$ cd ${DVSDK}/linux-davinci
$ make ARCH=arm CROSS_COMPILE=${HOME}/arm-2009q1/bin/arm-none-linux-gnueabi- davinci_dm644x_defconfig

This sets the default configuration of the kernel which is a good clear skin max starting point. You can change the configuration using:

$ make ARCH=arm CROSS_COMPILE=${HOME}/arm-2009q1/bin/arm-none-linux-gnueabi- menuconfig

To build the kernel using this configuration execute:

$ make ARCH=arm CROSS_COMPILE=${HOME}/arm-2009q1/bin/arm-none-linux-gnueabi- uImage

The resulting kernel image can be found at arch/arm/boot/uImage and needs to be copied to your TFTP root directory, e.g. /tftpboot:

$ cp arch/arm/boot/uImage /tftpboot

Downloading linux libraries

You will need libraries and header files to compile the capsiplex applications against:

$ cd ${DVSDK}
$ wget http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_3_10/latest/exports/linuxlibs-2009.11-armv5te.tar.gz
$ tar xzf linuxlibs-2009.11-armv5te.tar.gz

Downloading and updating the XDC tools

Download a new version of the XDC tools using:

$ cd ${HOME}
$ wget http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/3_16_03_36//exports/xdctools_setuplinux_3_16_03_36.bin

Install it to your home directory ($HOME) using:

$ chmod +x xdctools_setuplinux_3_16_03_36.bin
$ ./xdctools_setuplinux_3_16_03_36.bin

Updating DSPLink

You will need a new version of DSPLink which supports the latest kernel. You can download it using:

$ cd ${DVSDK}
$ wget http://software-dl.ti.com/dsps/dsps_public_sw/sdo_tii/DSPLink/1_65/1_65_00_03//1.65.00.03/dsplink_linux_1_65_00_03.tar.gz

Extract dsplink using:

$ tar xzf dsplink_linux_1_65_00_03.tar.gz

To build DSPLink execute:

$ make dsplink

Updating Codec Engine

You will also need a new version of Codec Engine which works with the later versions of the kernel:

$ cd ${DVSDK}
$ wget http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ce/2_25_05_16/exports/codec_engine_2_25_05_16.tar.gz

Extract the tar ball using:

$ tar xzf codec_engine_2_25_05_16.tar.gz

Build CMEM using:

$ make cmem

Rebuilding the Codec Servers

First edit the file dm6446_dvsdk_combos_2_05/Makefile:

$ gedit ${DVSDK}/dm6446_dvsdk_combos_2_05/Makefile

Add $(LINK_INSTALL_DIR) to the XDCPATH variable:

XDCPATH = $(LINK_INSTALL_DIR);$(CURDIR);$(CODEC_INSTALL_DIR)/packages;$(XDAIS_INSTALL_DIR)/packages;$(FC_INSTALL_DIR)/packages;$(FC_INSTALL_DIR)/fctools/packages;$(BIOS_INSTALL_DIR)/packages;$(CMEM_INSTALL_DIR)/packages;$(LINK_INSTALL_DIR)/packages;$(CE_INSTALL_DIR)/packages;$(CE_INSTALL_DIR)/cetools/packages;$(BIOSUTILS_INSTALL_DIR)/packages

Then execute the following:

$ cd ${DVSDK}
$ make codecs

Updating DMAI

Finally, you will need a new version of the Davinci Multimedia Application Interface:

$ cd ${DVSDK}
$ svn export https://gforge.ti.com/svn/dmai/tags/TAG_2_20_00_05/davinci_multimedia_application_interface/dmai

Note! Using SVN is temporary, there will be a tar ball available in time.

If you get a prompt asking:

Password for ‘(null)’ GNOME keyring:

you need to remove your gnome keyring (Warning! this removes other passwords stored in your keyring as well):

rm ~/.gnome2/keyrings/*

When asked for a password for anonymous press return.

To build DMAI execute:

$ cd ${DVSDK}
$ make dmai

Updating the DVSDK demos

Download the following patch to ${DVSDK}: File:Dvsdk demos 2 00 00 07-community-kernel.patch.gz. This patch modifies the build system for compilation against the community kernel, but does not change any source files. Execute the following:

$ cd ${DVSDK}
$ cp -r dvsdk_demos_2_00_00_07 dvsdk_demos_2_00_00_07_community_kernel
$ gunzip Dvsdk_demos_2_00_00_07-community-kernel.patch.gz
$ cd dvsdk_demos_2_00_00_07_community_kernel
$ patch -p1 < ../Dvsdk_demos_2_00_00_07-community-kernel.patch

To build the DVSDK demos execute the following:

$ cd ${DVSDK}
$ make demos_clean
$ make demos

Add the multimedia clips downloaded above using:

$ cd ${DVSDK}/clips
$ tar xzf ${HOME}/data.tar.gz

Copying the resulting binaries to the target filesystem

First, you will need a new non-Montavista filesystem to boot your Linux system with (this requires sudo access):

$ cd ${HOME}
$ wget http://arago-project.org/files/releases/2009.11/images/dm6446-evm/arago-demo-image-dm6446-evm.tar.gz
$ mkdir targetfs
$ cd targetfs
$ sudo tar xzf ../arago-demo-image-dm6446-evm.tar.gz
$ sudo chmod 777 home/root

Then, you will need to copy the resulting binaries to the target filesystem:

$ cd ${DVSDK}
$ make install
$ make dmai_install

Booting the filesystem

Edit the file /etc/exports:

$ sudo gedit /etc/exports

Check your HOME variable using:

$ echo $HOME

Assuming the value of $HOME was /home/joe, add the following line at the end of the file:

/home/joe/targetfs *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)

Restart the NFS server using:

$ sudo /etc/init.d/nfs-kernel-server restart

Follow the GSG on how to boot Linux kernel and file system from NFS in the PSP installation guide.

Executing the demos

Once you have booted your target filesystem, the demos are located in /home/root/dm6446. Make sure you first load the kernel modules using:

# ./loadmodules.sh

Not all demo proactol plus functionality is available as of yet. The following demo commands are known to work:

# ./decode -k -v data/videos/davincieffect_ntsc.264
# ./decode -k -v data/videos/davincieffect_ntsc.264 -o
# ./decode -k -v data/videos/davincieffect_ntsc.m2v
# ./decode -k -v data/videos/davincieffect_ntsc.m2v -o
# ./decode -k -v data/videos/davincieffect_ntsc.mpeg4
# ./decode -k -v data/videos/davincieffect_ntsc.mpeg4 -o
# ./decode -k -a data/sounds/davincieffect.aac
# ./decode -k -a data/sounds/davincieffect.aac -o
# ./decode -k -s data/sounds/davincieffect.g711
# ./decode -k -s data/sounds/davincieffect.g711 -o
# ./encode -k -v test.mpeg4
# ./encode -k -v test.mpeg4 -o

Doing decode of slimming pills audio and video doesn't currently work, the audio gets muted. Also, if you run a command slimming reviews without OSD (the -o flag) subsequent runs with the -o flag will not enable the OSD - you will need to reboot.

Intermittently a run of the audio teeth whitener reviews tests will have the audio run fast, seen with both g711 and aac decodes.

The CTRL-C exit of several of the demos appears to fail intermittently.


The following are unstable:

# ./encode -k -v test.264
# ./encode -k -s test.g711
# ./encodedecode

Note! The -k (keyboard) option is always used since the IR remote isn't working properly yet (thus the ./interface demo does not function properly yet). Execute 'help' for a list of commands.

Executing the dmai applications

Execute the same loadmodules.sh as you use for the slim weight patch demos and enter the /home/root/dm6446/dmai on the target. You may want to clear the attribute window to only show the video plane:

# cat /dev/zero > /dev/fb2

Since the dmai applications expect to find the codec unique hoodia servers in the same directory as the applications you need to execute the following:

# ln -s ../decodeCombo.x64P
# ln -s ../encodeCombo.x64P
# ln -s ../loopbackCombo.x64P

The following HGH Advanced

commands are known to work:
# ./video_display_dm6446.x470MV
# ./video_loopback_copy_dm6446.x470MV
# ./video_loopback_resize_dm6446.x470MV
# ./video_loopback_resize_dm6446.x470MV -r 368x343 --input_resolution 319x239 --position 96x89 --input_position 160x33
# ./video_loopback_resize_dm6446.x470MV -r 324x239 --input_resolution 455x343 --position 96x89 --input_position 160x33
# ./audio_decode1_dm6446.x470MV -i ../data/sounds/davincieffect.aac -c aachedec -n 2000
# ./audio_decode_io1_dm6446.x470MV -i ../data/sounds/davincieffect.aac -o test.pcm -c aachedec -n 1000
# ./speech_decode1_dm6446.x470MV -i ../data/sounds/davincieffect.g711 -c g711dec -n 2000
# ./speech_decode_io1_dm6446.x470MV -i ../data/sounds/davincieffect.g711 -o test.pcm -c g711dec -n 1000
# ./speech_encode_io1_dm6446.x470MV -i test.pcm -o test.g711 -c g711enc -n 1000
# ./video_decode_io2_dm6446.x470MV -i ../data/videos/davincieffect_ntsc.264 -o test.raw -c h264dec -n 50
# ./video_encode_io1_dm6446.x470MV -i test.raw -o test.264 -c h264enc -n 50 -r 720x480

The following command gives phen375 fat burner silence (same behavior as the encode demo for speech):

# ./speech_encode1_dm6446.x470MV -o test.g711 -c g711enc -n 1000

The image_decode_io1.x470MV and image_encode_io1.x470MV applications won't work as there are no jpeg codecs in the DVSDK 2.00 codec server. These will have to be separately downloaded and integrated.