Sunday, November 28, 2010

gst dsp/omapfb on zoom2

While waiting for the new board to arrive, I started to setup the gst-dsp + omapfb environment for what I currently have available: a zoom2.

After few tips from Axel Castaneda (for fb and v4l2 options) and much of googling, I got the board to show the video on the display using gst dsp/omapfb plugins.

As of today, you can easily use any kernel above 2.6.37-rc2, since it has a usable tidspbridge driver.

Here it's what I did (BTW, you can find a tidspbridge kernel in gitorious and ignore fetch & merge steps):

Clone/fetch latest linux-2.6 from git.kernel.org, took linux-2.6 2.6.37-rc3:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
cd linux-2.6
git checkout -b tidspbridge-2.6.37-rc3 v2.6.37-rc3
Then merge the patches providing display support for zoom2/3 boards from Tomi's DSS2 repo, the easiest thing to do is pulling his entire devel branch.
git pull git://gitorious.org/linux-omap-dss2/linux.git devel
And last, pick a patch to solve a gpio reset problem on zoom2 (zoom3 works fine without this last step).
wget http://patchwork.kernel.org/patch/351421/mbox/ -O display.patch
git am display.patch
Config for omap2+, and in menuconfig select:
CONFIG_TIDSPBRIDGE=m
CONFIG_OMAP2_DSS=y
CONFIG_OMAP2_VRAM_SIZE=4
CONFIG_FB_OMAP2=y
CONFIG_PANEL_NEC_NL8048HL11_01B=y
Build the uImage and copy to the filesystem:
arch/arm/plat-omap/mailbox.ko
arch/arm/mach-omap2/mailbox_mach.ko
drivers/staging/tidspbridge/bridgedriver.ko
Alternatively, you can use modules_install after compiling kernel and modules.

Now, assuming you have a filesystem + gstreamer environment (or you can take my rootfs, which has a uImage + dsp needed modules/binaries, be sure to read and agree to the license under /lib/dsp, just in case).

Boot the uImage and insmod/modprobe the modules.
insmod /dspbridge/mailbox.ko
insmod /dspbridge/mailbox_mach.ko
insmod /dspbridge/bridgedriver.ko base_img=/lib/dsp/baseimage.dof
Generate a test video to play with:
gst-launch videotestsrc num-buffers=200 ! video/x-raw-yuv, framerate=30/1, width=320, height=240 ! dspmp4venc ! avimux ! filesink location=my_avi.avi 
If you noticed, the video generated is encoded using the dsp.

Then send the video to the framebuffer, with:
gst-launch filesrc location=my_avi.avi ! avidemux ! dspvdec ! omapfbsink 
And that's it.

No comments:

Post a Comment