BeagleBoard-XM has an ARM cortex A8 processor (1Ghz) and an C64x DSP (800 Mhz) The
ARM will have Linux running on it and the DSP will have DSP-BIOS running on it. For interprocessor communication between the DSP and the ARM there are two mechanisms
(i) DSP-BRIDGE
(ii) DSP-LINK
The dsplink driver provides the API’s on both the linux and dspbios side for data interchange.
Memory should be allocated to the DSP during the kernel Boot Process. This can be done by
modifying the boot parameter in the uEnv.txt on the boot partition of the SD Card.
uEnv.txt
—————————————————————————————————————
mpurate=800 dvimode=1280x720MR-16@60 vram=12MB bootargs=console=ttyO2,115200n8
console=tty0 root=/dev/mmcblk0p2 rootwait ro vram=${vram} mem=99M@0x80000000
mem=384M@0x88000000 omapfb.mode=dvi:${dvimode} fixrtc buddy=${buddy}
mpurate=${mpurate}
optargs="mem=99M@0x80000000 mem=128@0x88000000"
—————————————————————————————————————
U-Boot will allocate the memory for the kernel and DSP at the time of booting. The DSP
side applications can be run in the memory allocated to the DSP. Cmem is used for allocating
memory to the DSP applications at runtime.
Lpm (Local Power Manager) can be used to switch ON and OFF the DSP. This is required if
we are running multiple programs on the DSP one after the other.
Insert the following modules after the linux is booted.
(i) Dsplinkk
(ii) Cmemk
(iii) lpm
(iv) sdmak
dsp.sh
—————————————————————————————————————
insmod dsplinkk.ko
insmod lpm_omap3530.ko
insmod sdmak.ko
insmod cmemk.ko allowOverlap=1 phys_start=0x86300000 phys_end=0x87300000
pools=1x5250000,6x829440,1x345600,1x691200,1x1
—————————————————————————————————————
For Kernel Version 3.2.18 and above not required to run the dsp.sh Script every time. Kernel Will Load the Modules while Boot-up.
lsmod command can be used to check wheter the modules are properly loaded or not.
Video Compression on DSP
The DSP can be used for Compression of the Video. This will free up the ARM an also makehelp reduce the time required for Compression. There are two programs which enable us to use
the DSP for Compression.
(i) GST-DSP
(ii) GStreamer-Ti
GST-DSP uses the DSPBrige and the the GStreamer-ti uses DSPLINK for interprocessor
communication
GST-DSP
GST-DSP are GStreamer plugins that work on the dsp of the BeagleBoard-Xm. Theses pluginsmake use of the TI’s DSP Algorithms. These can be used to perform the video encoding on the
dsp of BeagleBoard-xM. GST-DSP works on DSPBRIDGE.
Some of the features of GST-DSP are
(i) video decoding (MPEG-4, H.263, H.264, WMV)
(ii) video encoding (MPEG-4, H.263, H.264)
(iii) image encoding/decoding (JPEG)
GStreamer-ti
The TI DMAI GStreamer plug-in uses the Davinci Multimedia Application Interface to enable use of the DSP on the BeagleBoard-xM . GStreamer is run as an application on the ARM processor and through the use of DMAI is able to interact with the DSP modules to compress the video streams.DSP-LINK INTERFACE |
H.264 RTP Streaming
The BeagleBoard-xM captures the Video stream, encodes it in H.264 and transmits it using RTP. The Local station will receive the RTP packets of the compressed video stream and decode it and then display it on the screen.
Pipeline to Encode Video and Stream it using RTP.
$ gst-launch -v videotestsrc ! TIVidenc1 codecName=h264enc engineName=codecServer !
rtph264pay pt=96 ! udpsink host=192.68.0.10 port=5000
When the pipeline starts to run, you’ll see something that looks like this:
Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this
string in client below A simple RTP client to decodes H.264 and display on HOST machine
Pipeline to receive the RTP Video stream
$gst-launch -v udpsrc port=5000 caps="<CAPS_FROM_SERVER>" ! rtph264depay ! ffdec_h264
! xvimagesink sync=false
Example Stream Video and Store on Local Station:
Commands on BeagleBoard-Xm:
$ gst-launch -v v4l2src device=/dev/video0 ! video/x-raw-yuv, width=640, height=480,framerate=\(fraction\)30/1 ! ffmpegcolorspace ! TIVidenc1 codecName=h264enc engineName=codecServer ! rtph264pay pt=96 ! udpsink host=192.168.0.5 port=5004
Gstreamer Command Line on Local PC Station :
gst-launch -v udpsrc port=5004 caps=" application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"Z0KAHukBQHpCAAAH0AAB1MAI\\,aM48gA\\=\\=\", payload=(int)96, ssrc=(uint)2819279014, clock-base=(uint)2790818537, seqnum-base=(uint)59390" ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! tee name=my_videosink ! ffmpegcolorspace ! videorate ! video/x-raw-yuv,framerate=30/1 ! ffmpegcolorspace ! jpegenc ! avimux ! filesink location=/media/BBproject/pro_video/Video_Stream.avi my_videosink. ! queue ! ximagesink sync=false
No comments:
Post a Comment