Difference between revisions of "How to setup tvp5151 video decoder"

From IGEP - ISEE Wiki

Jump to: navigation, search
m (Play with TVP5151)
(Remove kernel 2.6.35 (deprecated))
 
Line 96: Line 96:
 
*Camera with PAL output live video.
 
*Camera with PAL output live video.
 
*IGEP SDK (IGEP VM suggested).
 
*IGEP SDK (IGEP VM suggested).
 
= Kernel 2.6.35.y =
 
== Get the ISP kernel binaries  ==
 
 
You can download the compiled images from here:
 
 
[http://downloads.isee.biz/pub/files/tvp5151/2.6.35/uImage Kernel 2.6.35 (uImage)]
 
 
[http://downloads.isee.biz/pub/files/tvp5151/2.6.35/zImage Kernel 2.6.35 (zImage)]
 
 
[http://downloads.isee.biz/pub/files/tvp5151/2.6.35/linux-2.6.35-10-modules.tgz Kernel 2.6.35 (Modules])
 
 
== TVP5151 Setup  ==
 
 
You need the program [http://downloads.isee.biz/pub/files/tvp5151/2.6.35/media-ctl media-ctl] this program it's useful for configure the ISP. You can download the sources from [http://downloads.isee.biz/pub/files/tvp5151/2.6.37/media-ctl.tar.gz here]&nbsp;or access to media-ctl git from [http://git.ideasonboard.org/media-ctl.git/commit/b16cbe7bce0fd8d9d940473a2272b6b0148795c3 here].<br>
 
 
There are two modules that you will use that are not inserted into the kernel: iommu2 (tvp5151) and isp.
 
 
You have to load these kernel modules before start:<br>
 
<pre>modprobe iommu2
 
modprobe omap3-isp
 
</pre>
 
(Note: The first load order must be the iommu2 and then the omap3-isp)<br>
 
 
=== Steps to configure the ISP and TVP5151  ===
 
 
Configure the right ISP routing.<br>
 
<pre>./media-ctl -r -l '"tvp5150 2-005c":0-&gt;"OMAP3 ISP CCDC":0[1], "OMAP3 ISP CCDC":1-&gt;"OMAP3 ISP CCDC output":0[1]'</pre>
 
Configure the video capture setup.<br>
 
<pre>./media-ctl --set-format '"tvp5150 2-005c":0 [UYVY 720x628]'
 
</pre>
 
 
== Play with TVP5151  ==
 
 
You can use for get the captured images [http://downloads.isee.biz/pub/files/tvp5151/2.6.35/yavta yavta] or gstreamer as live stream.&nbsp;You can download the sources from [http://downloads.isee.biz/pub/files/tvp5151/2.6.37/yavta.tar.gz here] or access to yavta git from [http://git.ideasonboard.org/yavta.git/commit/82ff2efdb9787737b9f21b6f4759f077c827b238 here].
 
 
This is the suggested yavta capture setup:<br>
 
<pre>./yavta -f UYVY -s 720x628 -n 4 --capture=4 -F /dev/video2
 
</pre>
 
or the gstreamer pipeline setup:<br>
 
<pre>gst-launch-0.10 -v v4l2src device=/dev/video2 queue-size=1&nbsp;! video/x-raw-yuv,format=\(fourcc\)UYVY,width=720,height=628&nbsp;! omapdmaifbsink</pre>
 
or using gstreamer for the TCP live streaming:
 
 
Set up UDP server from IGEPv2:<br>
 
<pre>gst-launch-0.10 -v v4l2src device=/dev/video2 queue-size=8&nbsp;! video/x-raw-yuv,format=\(fourcc\)UYVY&nbsp;! TIVidenc1 codecName=h264enc \
 
engineName=codecServer resolution=720x576&nbsp;! rtph264pay pt=96&nbsp;! udpsink host=&lt;YOUR_PC_IP&gt; port=&lt;PORT&gt;
 
</pre>
 
Set up UDP client on your Machine:
 
<pre>gst-launch-0.10 -v udpsrc do-timestamp=false port=&lt;PORT&gt;&nbsp; caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, \
 
encoding-name=(string)H264, payload=(int)96, ssrc=(uint)446210637, clock-base=(uint)697749128, seqnum-base=(uint)21380"&nbsp;! queue \
 
! rtph264depay&nbsp;! ffdec_h264&nbsp;! xvimagesink
 
</pre>
 
  
 
= Kernel 2.6.37.y =
 
= Kernel 2.6.37.y =

Latest revision as of 14:00, 26 July 2013

What is?

The TVP5151 device is an ultralow-power NTSC/PAL/SECAM video decoder. Available in a space-saving 48-terminal PBGA package or a 32-terminal TQFP package, the TVP5151 decoder converts NTSC, PAL, and SECAM video signals to 8-bit ITU-R BT.656 format. Discrete syncs are also available. The optimized architecture of the TVP5151 decoder allows for ultralow power consumption. The decoder consumes 138-mW power under typical operating conditions and consumes less than 1 mW in power-down mode, considerably increasing battery life in portable applications. The decoder uses just one crystal for all supported standards. The TVP5151 decoder can be programmed using an I2C serial interface.

The TVP5151 decoder converts baseband analog video into digital YCbCr 4:2:2 component video.

TVP5151 Features

  • Accepts NTSC (J, M, 4.43), PAL (B, D, G, H, I, M, N, Nc) and SECAM (B, D, G, K, K1, L) Video.
  • Supports ITU-R BT.601 Standard Sampling.
  • High-Speed 9-Bit Analog-to-Digital Converter (ADC).
  • Two Composite Inputs or One S-Video Input.
  • Fully Differential CMOS Analog Preprocessing Channels With Clamping and Automatic Gain Control (AGC) for Best Signal-to-Noise (S/N) Performance.
  • Ultralow Power Consumption.
  • Power-Down Mode: <1 mW
  • Brightness, Saturation, Hue, and Sharpness Control Through I2C
  • Complementary 4-Line (3-H Delay) Adaptive Comb Filters for Both Cross-Luminance and Cross-Chrominance Noise Reduction
  • Single 27.000-MHz Crystal for All Standards
  • Internal Phase-Locked Loop (PLL) for Line-Locked Clock and Sampling
  • Subcarrier Genlock Output for Synchronizing Color Subcarrier of External Encoder
  • Variable Digital I/O Supply Voltage Range from 1.8 V to 3.3 V
  • Standard Programmable Video Output Format:
    • ITU-R BT.656, 8-Bit 4:2:2 With Embedded Syncs
    • 8-Bit 4:2:2 With Discrete Syncs
  • Macrovision™ Copy Protection Detection
  • Advanced Programmable Video Output Formats

Output Formatter

The YCbCr digital output can be programmed as 8-bit 4:2:2 or 8-bit ITU-R BT.656 parallel interface standard.
Summary of Line Frequencies, Data Rates, and Pixel Counts

STANDARDS
(ITU-R BT.601)
PIXELS PER
LINE
ACTIVE
PIXELS PER
LINE
LINES PER
FRAME
NTSC-J, M 858 720 525
NTSC-4.43 858 720 525
PAL-M 858 720 525
PAL-B, D, G, H, I 864 720 625
PAL-N 864 720 625
PAL-Nc 864 720 625
SECAM 864 720 625










Dependecies

  • IGEP Board with TVP5151 peripheral (IGEPv2 Expansion Board or IGEP Berlin).
  • Camera with PAL output live video.
  • IGEP SDK (IGEP VM suggested).

Kernel 2.6.37.y

IGEP Firmware Yocto

(from How to create a SD-card with the latest software image)

Information.jpg This How-To was tested IGEP SDK Virtual Machine, but most of the contents are valid also for other GNU/Linux distributions.

There is no guarantee that this will work on other ones.

Create IGEP Firmware bootable SD-card

IGEP AM335x - The first thing you'll do is download the latest firwmare from ISEE site Yocto IGEP AM335x
IGEP OMAP 3 - Start session in IGEP SDK Virtual Machine. The first thing you'll do is download the latest firwmare from ISEE site Yocto IGEP OMAP 3
IGEP SMARC i.MX6 Dual/Quad - The first thing you'll do is download the latest firwmare from ISEE site Yocto IGEP SMARC i.MX6 Dual/Quad
IGEP SMARC i.MX6 DualLite - The first thing you'll do is download the latest firwmare from ISEE site Yocto IGEP SMARC i.MX6 DualLite
IGEP SMARC i.MX6 Solo - The first thing you'll do is download the latest firwmare from ISEE site Yocto IGEP SMARC i.MX6 Solo


  1. Select Products -> Processor Boards
  2. Click on your processor board product.
  3. Click on Software tab
  4. Click on IGEP Firmware
  5. Select Download icon.

Once the file is downloaded you can create bootable SD-Card, under Linux, untar the IGEP

tar jxf igep_firmware-yocto-*.tar.bz2
cd igep_firmware-yocto-*

Insert a SD-Card media and use the igep-media-create script to copy the firmware to SD-Card media.

./igep-media-create -–mmc <mmc> --image <image file> --machine <machine>

where:
<mmc> - is the SD-Card device of your computer.
<image file> - is the file that contains bootloader, kernel and rootfs image.
<machine> - is the IGEP Processor Board. Available options are:

  • igep0020 - For IGEP v2 Processor Board
  • igep0030 - For IGEP COM MODULE Processor Board
  • igep0032 - For IGEP COM PROTON Processor Board
  • igep0033 - For IGEP COM AQUILA Processor Board
  • igep0046 - For IGEP iMX6 Processor Board


For example, assuming the SD-card device takes '/dev/sdf' and you have an IGEPv2 board ('igep0020'), type

./igep-media-create --mmc /dev/sdf --machine igep0020 --image demo-image-sato-igep00x0.tar.bz2

For example, assuming the SD-card device takes '/dev/sdb' and you have an IGEP COM MODULE ('igep0030'), type

./igep-media-create --mmc /dev/sdb --machine igep0030 --image demo-image-sato-igep00x0.tar.bz2

These methods should give you a bootable SD-card.


Booting IGEP device and login/connect methods

Insert the bootable SD-card media into the micro-SD card socket of IGEP device and power on it. This should result in a running system with Sato graphical desktop root filesystem built by Yocto.

If you want login in/connect to the system, you have several options:

  • Serial debug link, you should just plug serial cable to your computer
  • Ethernet, you should assign an IP in the range 192.168.5.[2-254] and connect to target using a SSH client and connecting to 192.168.5.1 
  • Wifi, connect to IGEP_xx network, a dynamic IP should be assigned in your host and you can sign into the target connecting to 192.168.6.1
  • USB ethernet gadget, connect a IGEP device to USB port of your computer, dynamic IP should be assigned in your host and you can sign into the target connecting to 192.168.7.1 o (if available) Graphical interface on plugged DVI/TFT display and USB Keyboard in IGEP device

The root password is empty, so to log in type 'root' for the user name and hit 'Enter' at the Password prompt: (empty password) and you should be in.

Then, you could play and fun with IGEP board.

For example, you could flash the latest software image into internal FLASH memory ( How to flash the latest software image )



Igep forum.png If you have any question, don't ask to ask at the IGEP Community Forum or the IGEP Community Chat Irc.png

Configure TVP5151

Use the following steps to configure analog video:

  • Connect a video composite input to J501 connector from IGEPv2 Expansion (near CAN Bus) or J402 connector from IGEP BERLIN (near HDMI output)
  • Connect a screen, for example HDMI monitor.
  • Refresh repositories and accept it.
zypper ref 
  • Install video4linux2 plugin
zypper in gst-plugins-good-video4linux2


Play with TVP5151


  • Load OMAP ISP kernel module
modprobe omap3-isp
  • Configure ISP, for PAL resulution use 720x576 for NTSC resolution use 720x480 for IGEPv2 Expansion:
media-ctl -r -l '"tvp5150 2-005c":0->"OMAP3 ISP CCDC":0[1], "OMAP3 ISP CCDC":1->"OMAP3 ISP CCDC output":0[1]'
media-ctl -v --set-format '"tvp5150 2-005c":0 [UYVY 720x480]'
media-ctl -v --set-format '"OMAP3 ISP CCDC":0 [UYVY 720x480]'
media-ctl -v --set-format '"OMAP3 ISP CCDC":1 [UYVY 720x480]' 


  • Configure ISP, for PAL resulution use 720x576 for NTSC resolution use 720x480 for IGEP BERLIN:
media-ctl -r -l '"tvp5150 3-005d":0->"OMAP3 ISP CCDC":0[1], "OMAP3 ISP CCDC":1->"OMAP3 ISP CCDC output":0[1]'
media-ctl -v --set-format '"tvp5150 3-005d":0 [UYVY 720x480]'
media-ctl -v --set-format '"OMAP3 ISP CCDC":0 [UYVY 720x480]'
media-ctl -v --set-format '"OMAP3 ISP CCDC":1 [UYVY 720x480]' 
  • Export display
export DISPLAY=:0.0 
  • Launch gstreamer
gst-launch-0.10 -v v4l2src device=/dev/video2 queue-size=8 ! video/x-raw-yuv,format=\(fourcc\)UYVY,width=720,height=480 ! ffmpegcolorspace ! autovideosink
  • Now you can see in your IGEP screen a result similar like this
Igepv2expgstreamercapture.jpg