GST build

= Building GStreamer = There are basically two good ways to build GStreamer (and it's dependencies):
 * 1) poky.. which builds the entire filesystem from src and is well covered elsewhere.  Although since it is building quite a lot of software, it takes a lot of time and disk space.
 * 2) or Scratchbox2

Installing Scratchbox2
This is plagiarized (and tweaked slightly) from here and the sb2 README.

QEMU
sb2 doesn't include QEMU, you must have it already, this is how I compile it: $ git clone git://git.savannah.nongnu.org/qemu.git $ cd qemu $ git checkout 1cd62ae9f8ed624263e4779d2c71908aa41137fb $ ./configure --prefix=$HOME/sb2 --target-list=arm-linux-user $ make install

sbox2
note that if you have 64bit ubuntu, you should first install gcc-multilib (and possible ia32-libs) otherwise you will get an error during linking

Compile and install like this: $ git clone git://gitorious.org/~robclark/scratchbox2/robclarks-scratchbox2.git $ cd scratchbox2 $ ./autogen.sh $ ./configure --prefix=$HOME/sb2 $ make install

Add sb2 to the PATH: $ export PATH=$HOME/sb2/bin:$PATH

target
To use sb2 you need to get a rootfs for your target and put it into some useful directory, alternatively you can copy the necessary files into right places from your toolchain. The essential thing is that sb2 needs FHS compliant target directory structure to work.

From a codesourcery toolchain, you can find the "seed" target rootfs contents from arm-2009q1/arm-none-linux-gnueabi/libc, simply copy that to the buildroot.

To complete sb2 target setup:

$ mkdir $HOME/buildroot $ cd $HOME/buildroot $ cp -a /usr/local/csl/arm-2009q1/arm-none-linux-gnueabi/libc/{lib,etc,usr}. $ sb2-init my_target arm-none-linux-gnueabi-gcc

note that the last command assumes that arm-none-linux-gnueabi-gcc compiler is in your $PATH.. if it is not, give a full path, like:

$ sb2-init my_target /usr/local/csl/arm-2009q1/bin/arm-none-linux-gnueabi-gcc

That will automatically generate a working target config for the compiler given on the command line and run sb2-build-libtool script to get you a nice working libtool for your compiler. If the sb2-build-libtool part fails for some reason (incorrect http proxy or something similar), you can always run it manually later.

Building GStreamer for OMAP4
If you haven't done so already, you'll need to install a few dependencies.

On ubuntu:

$ sudo apt-get install automake autoconf libtool docbook-xml docbook-xsl fop libxml2 gnome-doc-utils

and simply clone omap4-gstreamer.git and run build script. The build script will run 'git submodule update' to pull down all of the individual GStreamer and OMX trees and their dependencies.

$ git clone git://sealion.sc.ti.com/git/omap4-gstreamer.git $ cd omap4-gstreamer $ ./build-it-all.sh

note that as with omap4-omx.git tree, this is fetching both internal and external git trees. If you are having trouble with git proxy settings, check out:
 * git-proxy-env
 * git-proxy-cmd

Building GStreamer for OMAP4 Ubuntu native compilation
Building GStreamer using native compilation is really the same as it is to build GStreamer natively on a desktop. You will need to install at least git and build-essential (use 'sudo apt-get install ...').

note: as of L24.6, there was a kernel bug that was triggured by git-clone in git 1.7.x (which is default in ubuntu 10.04). Here you can find older version of git that you can install using 'sudo dpkg -i ..': http://neuromancer.dal.design.ti.com/~robclark/git-core_1.6.3.3-2_armel.deb

Required packages to build:

 * build-essential
 * libtool
 * automake
 * autoconf
 * git-core (see above note for now..)
 * svn (if you want to build gst-ffmpeg)
 * liboil0.3-dev
 * libxml2-dev
 * libglib2.0-dev
 * gettext
 * corkscrew
 * socket
 * libfaad-dev
 * libfaac-dev

Recommended packages:

 * ntpdate (copy this example ntp.conf to /etc/ntp.conf)
 * vim
 * tig (console based git history viewer)
 * libc6-dbg (in case you need to use gdb.. having debug syms for libc helps)

Building natively a gst package amounts to running:

./autogen.sh --prefix=/usr && make && sudo make install

note: after building gst, you can install v4l2sink as your default sink element, run: gconftool --type string --set /system/gstreamer/0.10/default/videosink v4l2sink

File permissions:
On ubuntu fs, multimedia is running not as 'root' user, but as 'ubuntu'.. as such, some file permissions on various device files need to be adjusted. This can be done with udev. Put the following in /etc/udev/rules.d/omap4.rules:

KERNEL=="notifyducatidrv", GROUP="video", MODE="0660" KERNEL=="syslink*", GROUP="video", MODE="0660" KERNEL=="ipcnotify", GROUP="video", MODE="0660" KERNEL=="tiler", GROUP="video", MODE="0660" KERNEL=="timer32k", GROUP="video", MODE="0660"

Misc Notes:

 * 1) If you use TTIF, you should be sure to start ttifdaemon as the ubuntu user (or same user as the process that you are tracing)
 * 2) ntp doesn't seem to update the time automatically.. run 'sudo /etc/network/if-up.d/ntpdate' after you reboot
 * 3) be careful of time when you build.. if you don't reset the system clock (or use ntp to do it for you) then when you recompile, make might not recompile some .c files if it thinks they are older than the .o file..