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.

V4L error in MCVIP_v4l2Create()

Other Parts Discussed in Thread: TVP5158

I'm getting a V4L failure on our custom DM6467 board in MCVIP_v4l2Create().  The input enumeration shows a "TVP5158" input, but I get "Remote I/O error" when it tries to select this input in the VIDIOC_S_INPUT driver call.  The log does show that it reads the correct TVP5158 chip ID in TVP5158_checkChipId().  So, I think the I2C bus is ok.
Any ideas on what the problem is?  I have included the boot output as well as output from our app.
Thanks

Uncompressing Linux........................................................................................................... done, booting the kernel.
Linux version 2.6.32-rc2-davinci1 (blake@msp0vlx2-1) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #99 PREEMPT Thu Feb 20 13:49:38 CST 2014
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: DaVinci DM646x EVM
Memory policy: ECC disabled, Data cache writeback
DaVinci dm6467_rev3.x variant 0x1
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 20320
Kernel command line: console=ttyS0,115200n8 root=/dev/ram0 rw initrd=0x81100000,14M eth=00:0E:99:02:B5:A0 ip=192.168.2.101:192.168.2.6:192.168.2.6:255.255.255.0:DM6467:eth0::off mem=80M
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 80MB = 80MB total
Memory: 63308KB available (2988K code, 271K data, 104K 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... 246.57 BogoMIPS (lpj=1232896)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
DaVinci: 43 gpio irqs
NET: Registered protocol family 16
MUX: Setting register STSOMUX_DISABLE
           PINMUX0 (0x00000000) = 0x00000000 -> 0x00000000
MUX: Setting register STSIMUX_DISABLE
           PINMUX0 (0x00000000) = 0x00000000 -> 0x00000000
MUX: Setting register PTSOMUX_DISABLE
           PINMUX0 (0x00000000) = 0x00000000 -> 0x00000000
MUX: Setting register PTSIMUX_DISABLE
           PINMUX0 (0x00000000) = 0x00000000 -> 0x00000000
MUX: Setting register NOR_EMIFA_ENABLE
           PINMUX0 (0x00000000) = 0x00000000 -> 0x00000000
bio: create slab <bio-0> at 0
vpif vpif: vpif probe success
Switching to clocksource timer0_1
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
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.
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 14336K
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 151
io scheduler noop registered
io scheduler anticipatory registered (default)
CIR device registered successfully                        (Major = 253,  Minor = 0)
Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a ST16654
console [ttyS0] enabled
serial8250 serial8250.0: unable to register port at index 1 (IO0 MEM1c20400 IRQ41): -22
serial8250 serial8250.0: unable to register port at index 2 (IO0 MEM1c20800 IRQ42): -22
brd: module loaded
loop: module loaded
physmap platform flash device: 02000000 at 42000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
NOR chip too large to fit in mapping. Attempting to cope...
 Amd/Fujitsu Extended Query Table at 0x0040
physmap-flash.0: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
Reducing visibility of 65536KiB chip to 32768KiB
cmdlinepart partition parsing not available
RedBoot partition parsing not available
Using physmap partition information
Creating 4 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000080000 : "bootloader"
0x000000080000-0x0000000a0000 : "u-boot_params"
Parsing MAC address from boot arguments (eth=xx:xx:xx:xx:xx:xx).
Found 'eth=' in the boot arguments.
MAC address from boot arguments is 00:0e:99:02:b5:a0
0x0000000a0000-0x0000004a0000 : "kernel"
0x0000004a0000-0x000000aa0000 : "fs_os"
spi_davinci spi_davinci.0: DaVinci SPI driver in EDMA mode
Using RX channel = 17 , TX channel = 16 and event queue = 3
spi_davinci spi_davinci.0: Controller at 0xfec66800
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
dm9000 Ethernet Driver, V1.31
console [netcon0] enabled
netconsole: network logging started
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
Linux video capture interface: v2.00
I2C: Module install successful, device major num = 252
DMA: Module install successful, device major num = 251
TVP5158: Module built on Feb 20 2014 13:49:34
tvp5158 1-0058: chip found @ 0xb0 (DaVinci I2C adapter)
tvp5158 1-0058: tvp5158 1-0058 decoder driver registered !!
tvp5158_initialize}
vpif_capture vpif_capture: registered sub device I2C_IG
vpif_capture vpif_capture: DM646x VPIF Capture driver initialized
watchdog watchdog: heartbeat 60 sec
TCP cubic registered
NET: Registered protocol family 17
Clocks: disable unused uart1
Clocks: disable unused mcasp0
Clocks: disable unused mcasp1
Clocks: disable unused emac
Clocks: disable unused timer1
Clocks: disable unused pci
Clocks: disable unused ide
emac-mii: probed
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=1:01, id=221513)
IP-Config: Complete:
     device=eth0, addr=192.168.2.101, mask=255.255.255.0, gw=192.168.2.6,
     host=DM6467, domain=, nis-domain=(none),
     bootserver=192.168.2.6, rootserver=192.168.2.6, rootpath=
RAMDISK: gzip image found at block 0
PHY: 1:01 - Link is Up - 100/Full
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing init memory: 104K
INIT: version 2.86 booting
Please wait: booting...
Starting udev
Populating dev cache
Remounting root file system...
Setting up IP spoofing protection: rp_filter.
Configuring network interfaces... done.
Mon Jun 21 13:01:00 UTC 2010
INIT: Entering runlevel: 5
Starting syslogd/klogd: done

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

Arago Project http://arago-project.org sciu_dm6467 ttyS0

Arago 2009.11 sciu_dm6467 ttyS0

sciu_dm6467 login: root
root@sciu_dm6467:~# ./encode-jpeg.xv5T &
root@sciu_dm6467:~# Max Header Length is now 29 bytes
06/21 13:01:19.103 000 NOTE: ---------------------------------------------------
06/21 13:01:19.103 000 NOTE: | Executing loadmodules.sh
06/21 13:01:19.103 000 NOTE: ---------------------------------------------------
CMEMK module: built on Feb 19 2014 at 17:04:01
  Reference Linux version 2.6.32
  File /opt/dvsdk/dvsdk_3_10_00_19/linuxutils_2_25_04_10/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
allocated heap buffer 0xc9000000 of size 0x219000
cmemk initialized
DSPLINK Module (1.64) created on Date: Feb 20 2014 Time: 13:50:02
crw-r--r--    1 root     root     251,   0 Jun 21 13:01 /dev/dev_dma
crw-r--r--    1 root     root     252,   0 Jun 21 13:01 /dev/dev_i2c
06/21 13:01:19.384 000 NOTE: ---------------------------------------------------
06/21 13:01:19.384 000 NOTE: | Starting application
06/21 13:01:19.384 000 NOTE: ---------------------------------------------------
@0,386,570us: [+6 T:0x4001f050] CE - Engine_init> CE debugging on (CE_DEBUG=1; allowed CE_DEBUG levels: 1=min, 2=good, 3=max)
[DSP] @0x000002a9:[T:0x00000000] server - main> Welcome to DSP server's main().
 pObj->client=[0]
I2C: Driver registration successful I2C_IG  (address=58)..[58]
06/21 13:01:19.434 001 DEBG:
06/21 13:01:19.447 000 DEBG: Thread initialization complete
TVP5158_checkChipId: TVP5158 Chip ID = 0x51, 0x58
MCVIP_v4l2Create: Enumerating the inputs...
hndl->v4l2InputToUse = 'TVP5158'
MCVIP_v4l2Create: Input 0: input.name = 'TVP5158'
MCVIP_v4l2Create: Input 1: input.name = 'Component'
MCVIP_v4l2Create: Input 2: input.name = 'Component'
MCVIP_v4l2Create: Done enumerating:
MCVIP_v4l2Create:    Input to use = 0
MCVIP_v4l2Create:    Standard supported =  9223372032559808512
MCVIP_v4l2Create: Selecting video input 0 via VIDIOC_S_INPUT ioctl...
MCVIP_v4l2Create: Attempt #0, VIDIOC_S_INPUT ioctl returned = -1
MCVIP_v4l2Create:   ...failed with errno = Remote I/O error
06/21 13:01:19.448 002 DATA: Capture started in 4CH D1 Crop Mode
MCVIP_v4l2Create: Attempt #1, VIDIOC_S_INPUT ioctl returned = -1
MCVIP_v4l2Create:   ...failed with errno = Remote I/O error
MCVIP_v4l2Create: Attempt #2, VIDIOC_S_INPUT ioctl returned = -1
MCVIP_v4l2Create:   ...failed with errno = Remote I/O error
MCVIP_v4l2Create: Attempt #3, VIDIOC_S_INPUT ioctl returned = -1
MCVIP_v4l2Create:   ...failed with errno = Remote I/O error
MCVIP_v4l2Create: Attempt #4, VIDIOC_S_INPUT ioctl returned = -1
MCVIP_v4l2Create:   ...failed with errno = Remote I/O error
MCVIP_v4l2Create: Attempt #5, VIDIOC_S_INPUT ioctl returned = -1
MCVIP_v4l2Create:   ...failed with errno = Remote I/O error
MCVIP_v4l2Create: Attempt #6, VIDIOC_S_INPUT ioctl returned = -1
MCVIP_v4l2Create:   ...failed with errno = Remote I/O error
MCVIP_v4l2Create: Attempt #7, VIDIOC_S_INPUT ioctl returned = -1
MCVIP_v4l2Create:   ...failed with errno = Remote I/O error
MCVIP_v4l2Create: Attempt #8, VIDIOC_S_INPUT ioctl returned = -1
MCVIP_v4l2Create:   ...failed with errno = Remote I/O error
MCVIP_v4l2Create: Attempt #9, VIDIOC_S_INPUT ioctl returned = -1
MCVIP_v4l2Create:   ...failed with errno = Remote I/O error
 ERROR  (/local_home/blake/sciu/sciu_dm6467_app/src/mcvip_tvp5158/mcvip/src/mcvip_v4l2.c|MCVIP_v4l2Create|126): Input set timed out. Exiting.
 ERROR  (/local_home/blake/sciu/sciu_dm6467_app/src/mcvip_tvp5158/mcvip/src/mcvip_api.c|MCVIP_stop|290): MCVIP_stop received NULL handle
 ERROR  (/local_home/blake/sciu/sciu_dm6467_app/src/mcvip_tvp5158/mcvip/src/mcvip_api.c|MCVIP_delete|206): MCVIP_delete received NULL handle
06/21 13:01:20.458 002 EROR: MCVIP_create() failedlog_verify_fd(): open(/tmp/log.txt <file>) = 19
06/21 13:01:20.458 002 EROR: Failed to start capture06/21 13:01:20.458 002 DEBG: Stopping MCVIP
06/21 13:01:20.458 002 DEBG: Deleted MCVIP
06/21 13:01:20.463 002 DEBG: Capture stopped06/21 13:01:20.463 002 DEBG: MCVIP exited06/21 13:01:20.463 002 DEBG: CMEM exited06/21 13:01:20.463 002 EROR: Failed to init MCVIP

  • I did a 'dmesg' and noticed ten I2C reads to address 0x3B, which probably correspond to the ten VIDIOC_S_INPUT ioctl attempts.  Per the DM6467 technical reference document, I2C address 0x3B is the video control register in the CPLD on the EVM.  Since we don't have the CPLD on our custom board, the driver returns "Remote I/O error".

    Now I just have to figure out what kernel file to update to avoid communicating with a non-existent CPLD.

  • Good find!

    The I2C devices are usually defined in the "board" file, i.e. in the arch/arm/mach-davinci folder there should be C files corresponding to each board.  There's generally a structure defining the various I2C devices.

  • Yes, I am somewhat familiar with the file board-dm646x-evm.c, because I previously added MTD NOR flash partitions.  I was able to comment-out the CPLD items in that file.  The app now gets past the problem area.

    Thanks!