This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM36X EVM: How to capture / encode video from composite?

Other Parts Discussed in Thread: TVP5146, PCA9543A, TSC2004, THS7303, TVP7002, THS7353

Hi all,

I need your help...

I tried to capture / encode video from composite device to file and I do not know how to do this.

I tried this:

/encode -I1 -vtest.mpeg4 -y2 -t20

and I got this error message:

root@dm365-evm:/usr/share/ti/dvsdk-demos# ./encode -I1 -vtest.mpeg4 -y2 -t20
Encode demo started.
davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
davinci_previewer davinci_previewer.2: ipipe_set_preview_config
vpfe-capture vpfe-capture: IPIPE Chained
vpfe-capture vpfe-capture: Resizer present
EVM: switch to tvp5146 SD video input
tvp514x 1-005d: Write: retry ... 0
...
tvp514x 1-005d: Write failed. Err[-121]
tvp514x 1-005d: Unable to turn on decoder
tvp514x 1-005d: Write: retry ... 0
...

Error: Failed to create capture device. Is video input connected?

Does something know else way to capture video from composite?

Is there a way to do that with gstreamer? If yes, How?

Thanks!

My setup:

DM36X EVM (with DM368).

DVSDK 4.0.2

In u-boot:

setenv bootargs console=ttyS0,115200n8 rw mem=54M video=davincifb:vid0=ON:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=1 vpfe_capture.cont_bufsize=6291456 davinci_enc_mngr.ch0_output=COMPOSITE davinci_enc_mngr.ch0_mode=480P-60 root=/dev/nfs nfsroot=172.20.160.144:/home/myuser/targetfs ip=dhcp

  • Hi,

    It looks like the TVP514x (video decoder) driver is unable to communicate with the chip over the I2C bus.  Would you post the complete kernel boot log?

    Thanks,

    Chris Richardson

  • Hi Chris,

    Please see the startup log (tell me if you mean to another log):


    root@dm365-evm:/usr/share/ti/dvsdk-demos# boot
    BOOTP broadcast 1
    DHCP client bound to address 172.20.161.23
    TFTP from server 172.20.160.144; our IP address is 172.20.161.23
    Filename 'uImage-dm365-evm.bin'.
    Load address: 0x80700000
    Loading: *#################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    ##############################
    done
    Bytes transferred = 2148124 (20c71c hex)
    ## Booting kernel from Legacy Image at 80700000 ...
    Image Name: Arago/2.6.32.17-psp03.01.01.39/d
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 2148060 Bytes = 2 MB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux............................................................................................................................................ done, booting the kernel.
    Linux version 2.6.32.17-davinci1 (sdk@nemo) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #1 PREEMPT Thu Mar 24 19:30:24 CDT 2011
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
    CPU: VIVT data cache, VIVT instruction cache
    Machine: DaVinci DM36x EVM
    Memory policy: ECC disabled, Data cache writeback
    DaVinci dm36x_rev1.2 variant 0x8
    Built 1 zonelists in Zone order, mobility grouping off. Total pages: 13716
    Kernel command line: console=ttyS0,115200n8 rw mem=54M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=1 vpfe_capture.cont_bufsize=6291456 davinci_enc_mngr.ch0_output=COMPOSITE davinci_enc_mngr.ch0_mode=PAL root=/dev/nfs nfsroot=172.20.160.144:/home/myuser/targetfs ip=dhcp
    PID hash table entries: 256 (order: -2, 1024 bytes)
    Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
    Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
    Memory: 54MB = 54MB total
    Memory: 50076KB available (4024K code, 393K data, 144K init, 0K highmem)
    SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    Hierarchical RCU implementation.
    NR_IRQS:245
    Console: colour dummy device 80x30
    Calibrating delay loop... 147.86 BogoMIPS (lpj=739328)
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    DaVinci: 8 gpio irqs
    NET: Registered protocol family 16
    davinci_serial_init:97: failed to get UART2 clock
    EVM: HD imager video input
    bio: create slab <bio-0> at 0
    DM365 IPIPE initialized in Continuous mode
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    pca9543a_probe
    vpss vpss: dm365_vpss vpss probed
    vpss vpss: dm365_vpss vpss probe success
    dm365_afew_hw_init
    ch0 default output "COMPOSITE", mode "PAL"
    VPBE Encoder Initialized
    cfg80211: Using static regulatory domain info
    cfg80211: Regulatory domain: US
    (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
    (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
    (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
    (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
    (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
    (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
    cfg80211: Calling CRDA for country: US
    LogicPD encoder initialized
    Switching to clocksource timer0_1
    musb_hdrc: version 6.0, cppi-dma, host, debug=0
    musb_hdrc: USB Host mode controller at fec64000 using DMA, IRQ 12
    musb_hdrc musb_hdrc: MUSB HDRC host driver
    musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
    usb usb1: configuration #1 chosen from 1 choice
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    NET: Registered protocol family 2
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 2048 (order: 2, 16384 bytes)
    TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    TCP: Hash tables configured (established 2048 bind 2048)
    TCP reno registered
    NET: Registered protocol family 1
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
    msgmni has been set to 97
    alg: No test for stdrng (krng)
    io scheduler noop registered
    io scheduler anticipatory registered (default)
    Console: switching to colour frame buffer device 90x36
    davincifb davincifb.0: dm_osd0_fb: 720x576x16@0,0 with framebuffer size 4050KB
    davincifb davincifb.0: dm_vid0_fb: 0x0x16@0,0 with framebuffer size 1224KB
    davincifb davincifb.0: dm_osd1_fb: 720x576x4@0,0 with framebuffer size 810KB
    davincifb davincifb.0: dm_vid1_fb: 0x0x16@0,0 with framebuffer size 1224KB
    DM365 IPIPEIF probed
    imp serializer initialized
    davinci_previewer initialized
    davinci_resizer initialized
    Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
    console [ttyS0] enabled
    brd: module loaded
    at24 1-0050: 32768 byte 24c256 EEPROM (writable)
    Read MAC addr from EEPROM: 00:0e:99:03:50:d5
    spi_davinci spi_davinci.0: DaVinci SPI driver in EDMA mode
    Using RX channel = 17 , TX channel = 16 and event queue = 3
    at25 spi0.0: 8 KByte at25640 eeprom, pagesize 32
    spi_davinci spi_davinci.0: Controller at 0xfec66000
    console [netcon0] enabled
    netconsole: network logging started
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    usbcore: registered new interface driver usbtest
    mice: PS/2 mouse device common for all mice
    input: TSC2004 Touchscreen as /devices/virtual/input/input0
    dm365evm_keys: probe of 1-0025 failed with error -16
    i2c /dev entries driver
    Linux video capture interface: v2.00
    ths7303 1-002c: chip found @ 0x58 (DaVinci I2C adapter)
    vpfe_init
    vpfe-capture: vpss clock vpss_master enabled
    vpfe-capture vpfe-capture: v4l2 device registered
    vpfe-capture vpfe-capture: video device registered
    EVM: switch to tvp5146 SD video input
    tvp514x 1-005d: tvp514x 1-005d decoder driver registered !!
    vpfe-capture vpfe-capture: v4l2 sub device tvp5146 registered
    EVM: switch to tvp7002 HD video input
    tvp7002 1-005c: tvp7002 1-005c decoder driver registered !!
    vpfe-capture vpfe-capture: v4l2 sub device tvp7002 registered
    EVM: switch to tvp7002 HD video input
    ths7353 1-002e: chip found @ 0x5c (DaVinci I2C adapter)
    ths7353 1-002e: No platform data!!
    vpfe-capture vpfe-capture: v4l2 sub device ths7353 registered
    vpfe_register_ccdc_device: DM365 ISIF
    DM365 ISIF is registered with vpfe.
    af major#: 252, minor# 0
    AF Driver initialized
    aew major#: 251, minor# 0
    AEW Driver initialized
    Trying to register davinci display video device.
    layer=c20b5400,layer->video_dev=c20b5570
    Trying to register davinci display video device.
    layer=c20b5800,layer->video_dev=c20b5970
    davinci_init:DaVinci V4L2 Display Driver V1.0 loaded
    watchdog watchdog: heartbeat 60 sec
    davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
    usbcore: registered new interface driver usbhid
    usbhid: v2.6:USB HID core driver
    Advanced Linux Sound Architecture Driver Version 1.0.21.
    No device for DAI tlv320aic3x
    No device for DAI davinci-i2s
    asoc: tlv320aic3x <-> davinci-i2s mapping ok
    ALSA device list:
    #0: DaVinci EVM (tlv320aic3x)
    TCP cubic registered
    NET: Registered protocol family 17
    lib80211: common routines for IEEE802.11 drivers
    Clocks: disable unused mmcsd1
    Clocks: disable unused spi1
    Clocks: disable unused spi2
    Clocks: disable unused spi3
    Clocks: disable unused spi4
    Clocks: disable unused pwm0
    Clocks: disable unused pwm1
    Clocks: disable unused pwm2
    Clocks: disable unused pwm3
    Clocks: disable unused timer1
    Clocks: disable unused timer3
    Clocks: disable unused emac
    Clocks: disable unused voice_codec
    Clocks: disable unused rto
    Clocks: disable unused mjcp
    emac-mii: probed
    eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=1:01, id=221613)
    Sending DHCP requests .
    PHY: 1:01 - Link is Up - 100/Full
    ., OK
    IP-Config: Got DHCP answer from 0.0.0.0, my address is 172.20.161.23
    IP-Config: Complete:
    device=eth0, addr=172.20.161.23, mask=255.255.254.0, gw=172.20.161.254,
    host=172.20.161.23, domain=star-ds.local, nis-domain=(none),
    bootserver=0.0.0.0, rootserver=172.20.160.144, rootpath=
    Looking up port of RPC 100003/2 on 172.20.160.144
    Looking up port of RPC 100005/1 on 172.20.160.144
    VFS: Mounted root (nfs filesystem) on device 0:14.
    Freeing init memory: 144K
    INIT: version 2.86 booting
    Please wait: booting...
    Starting udev
    udev: starting version 141
    Remounting root file system...
    Caching udev devnodes
    Populating dev cachemv: cannot rename '/tmp/devices': No such file or directory
    NET: Registered protocol family 10
    ALSA: Restoring mixer settings...
    NOT configuring network interfaces: / is an NFS mount
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    Thu Mar 24 21:02:00 UTC 2011
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    INIT: Entering runlevel: 5
    Starting system message bus: dbus.
    Starting telnet daemon.
    Starting syslogd/klogd: done
    Starting thttpd.
    CMEMK module: built on Mar 24 2011 at 19:34:57
    Reference Linux version 2.6.32
    File /sdk/build/DVSDK_4_02/4_02_00_06/arago-install/arago-tmp/work/dm365-evm-none-linux-gnueabi/ti-linuxutils-1_2_26_01_02-r52d/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
    allocated heap buffer 0xc5000000 of size 0x4400000
    heap fallback enabled - will try heap if pool buffer is not available
    CMEM Range Overlaps Kernel Physical - allowing overlap
    CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x83600000)
    cmemk initialized
    IRQK module: built on Mar 24 2011 at 19:35:11
    Reference Linux version 2.6.32
    File /sdk/build/DVSDK_4_02/4_02_00_06/arago-install/arago-tmp/work/dm365-evm-none-linux-gnueabi/ti-linuxutils-1_2_26_01_02-r52d/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/irq/src/module/irqk.c
    irqk initialized
    EDMAK module: built on Mar 24 2011 at 19:35:06
    Reference Linux version 2.6.32
    File /sdk/build/DVSDK_4_02/4_02_00_06/arago-install/arago-tmp/work/dm365-evm-none-linux-gnueabi/ti-linuxutils-1_2_26_01_02-r52d/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/edma/src/module/edmak.c

    _____ _____ _ _
    | _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
    | | _| .'| . | . | | __| _| . | | | -_| _| _|
    |__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
    |___| |___|

    Arago Project http://arago-project.org dm365-evm ttyS0

    Arago 2011.02 dm365-evm ttyS0

    dm365-evm login: root
    root@dm365-evm:~#
    .
    .
    .
    root@dm365-evm:/usr/share/ti/dvsdk-demos# ./encode -I1 -y2- -vtest.264 -t10
    Encode demo started.
    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
    davinci_previewer davinci_previewer.2: ipipe_set_preview_config
    vpfe-capture vpfe-capture: IPIPE Chained
    vpfe-capture vpfe-capture: Resizer present
    EVM: switch to tvp5146 SD video input
    tvp514x 1-005d: Write: retry ... 0
    tvp514x 1-005d: Write: retry ... 1
    tvp514x 1-005d: Write: retry ... 2
    tvp514x 1-005d: Write: retry ... 3
    tvp514x 1-005d: Write: retry ... 4
    tvp514x 1-005d: Write: retry ... 5
    tvp514x 1-005d: Write failed. Err[-121]
    tvp514x 1-005d: Unable to turn on decoder
    tvp514x 1-005d: Write: retry ... 0
    tvp514x 1-005d: Write: retry ... 1
    tvp514x 1-005d: Write: retry ... 2
    tvp514x 1-005d: Write: retry ... 3
    tvp514x 1-005d: Write: retry ... 4
    tvp514x 1-005d: Write: retry ... 5
    Error: Failed to create capture device. Is video input connected?

    Thanks!

  • Hi,

    Well it looks like the board info for the decoders is correct.  I haven't used the EVM for a long time and our board file is now a lot different than the EVM board file, so it's hard to come up with any suggestions.  I can say that we are using SD composite input just fine here and were also using it on the EVM, so it does work.

    A search revealed the following thread: http://e2e.ti.com/support/embedded/linux/f/354/t/94157.aspx, which suggests that disabling the "TI DaVinci Key Scan" driver in the kernel config may help.  The probe seems to be failing anyways, from your boot log (the line is "dm365evm_keys: probe of 1-0025 failed with error -16").

    Sorry I couldn't be of more help and good luck!

    Chris Richardson

  • Update: After I replaced the DM365 EVM, the problem disappeared.

    It seems that the problem was in the tvp5146 device.

    Thanks!