ECE497 Lab12 The Display SubSystem (DSS)

This page explains, with examples, how the Display Subsystem (DSS) on the OMAP3530 on the BeagleBoard works. It's based on the materials used in TI's DaVinci System Integration using Linux Workshop. The workshop is based on the DVEVM. I've converted those materials to the BeagleBoard.

Look at ECE597 Installing DSP Development Tools for instructions on installing the development tools.

The Student Materials for the workshop are very complete; however the workshop is based on the DVEVM and not the BeagleBoard. Here I'll walk you through Lab 07 on the Beagle. The Video Driver Details start on page 187 of the Student Materials.

Here are my files for Lab 07. Lab 07 has four parts. I have three working.
 * 1) OSD Setup (Take a bmp file, convert it to r16 format and display it on the GFX frame buffer (/dev/fb0).)
 * 2) Video Record (Read video from a web cam and store it in a file.)
 * 3) Video Playback (Read the file from above and display it on one of the video frame buffers (/dev/fb1).)
 * 4) Video Loopthru (Combine the previous two labs to read the live video and display it.)

I'll update this when I have the Video Loopthru lab working.

Here is a nice set of slides that explain the OMAP3530 DSS. I found a reference to it here. It's worth going through the slides before doing these labs.

Lab 7a OSD Setup
This lab is a straight forward inspection lab that starts on page 200. Look at  and   and see how they work. The lab has your create a 720 by 60 bmp file that is converted to RGB565 format. Instead, create a 640 x 480 file that has a white background. In lab 7c we will use the OMAP DSS to superimpose the video on this image. I've already changed some s to work with the 640 by 480 image.

The Beagle code differs from the original workshop code in the the OMAP3530 doesn't have an attribute frame. All that code has been removed.

Lab 7b Video Record
This is also a straight forward inspection lab. It starts on page 206. I'm using at PS3 EYE eb cam. will appear when you plug the EYE into the USB of the Beagle. Look at  and   and see how they work. I've set them up to capture a 640 by 480 image.

Ditto on the attribute frame. Capture some video here. You will use it in the next lab. The video is stored in /tmp. I suggest you move it to your working directory, otherwise it will disappear when you reboot.

Lab 7c Video Playback
Here we really depart from the workshop code. The lab starts on page 209. writes the the image your created in lab 7a on frame buffer 0 (/dev/fb0). This is called the graphics buffer (FBVID_GFX). reads the video from lab 7b and writes it to frame buffer 1 (/dev/fb1), which is one of the two video buffers. You need to boot with the following arguments for this to work.

set mmcargs 'setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs}' setenv optargs omapfb.vram=0:10M,1:10M vram=20M saveenv This reserves 20M for the video ram and allocate 10M for each for framebuffers 0 and 1.

The following (from [[Media:ShowOSD.txt]]) sets up the DSS so graphics buffer is in front of the video buffer. The graphics are at 50% transparency and while is transparent. This will let the video show through the graphics.

showOSD
ovl0=/sys/devices/platform/omapdss/overlay0 ovl1=/sys/devices/platform/omapdss/overlay1 ovl2=/sys/devices/platform/omapdss/overlay2
 * 1) !/bin/bash

mgr0=/sys/devices/platform/omapdss/manager0 mgr1=/sys/devices/platform/omapdss/manager1

lcd=/sys/devices/platform/omapdss/display0 tv=/sys/devices/platform/omapdss/display1

fb0=/sys/class/graphics/fb0 fb1=/sys/class/graphics/fb1 fb2=/sys/class/graphics/fb2

echo "0" > $ovl0/enabled echo "0" > $ovl1/enabled
 * 1) Disable the overlays

echo "0" > $fb0/overlays echo "1" > $fb1/overlays
 * 1) Connect fb0 to ovl0

echo "lcd" > $ovl0/manager echo "lcd" > $ovl1/manager
 * 1) Point both overlays to the lcd manager


 * 1) for param in bits_per_pixel modes virtual_size
 * do
 * 1) 	cat $fb0/$param > $fb1/$param
 * 2) done

echo 0,0 > $ovl0/position echo 640,480 > $ovl1/output_size echo 100,100 > $ovl1/position
 * 1) echo $ovl0/output_size > $ovl1/output_size

echo 128 > $ovl0/global_alpha echo  1 > $mgr0/alpha_blending_enabled

echo  1 > $mgr0/trans_key_enabled echo 65535 > $mgr0/trans_key_value echo gfx-destination > $mgr0/trans_key_type
 * 1) Turn on transparency, make white (65535) transparent
 * 1) echo video-source > $mgr0/trans_key_type

/usr/sbin/fbset -fb /dev/fb1 -nonstd 8
 * 1) Set the video mode to YUV
 * 2) http://groups.google.com/group/beagleboard/browse_thread/thread/9bc347f5f0853aa1/907f1ac3554b1a19?lnk=gst&q=fbset#907f1ac3554b1a19

echo "1" > $ovl0/enabled echo "1" > $ovl1/enabled

Turning off gpe
Running above will write on top of what Angstrom is doing. You can turn off the display manager by using: /etc/init.d/gpe-dm stop Replace  with   if you want to run it again.

Lab 7d Video Loopthru
I'm still working on this one.