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.

DM814X/AM387X EVM Video Capture Problems

Other Parts Discussed in Thread: TVP7002, TLC59108

Hello, I have the ti-ezsdk_dm814x-evm_5_03_00_09 code base and have patched ~/ti-ezsdk_dm814x-evm_5_03_00_09/board-support/linux-2.6.37-psp04.01.00.06.patch1/ with the patch2 file found here: http://software-dl.ti.com/dsps/dsps_public_sw/psp/LinuxPSP/DM814x_04_01/04_01_00_06/index_FDS.html

I have enabled the capture driver in menu config and built the kernel. However, when attempting to load the modules contained in TI814x-HDVPSS-01.00.01.33.zip the system locks up when inserting the vpss.ko module

insmod syslink.ko
./slaveloader startup VPSS-M3 ti814x_hdvpss_1G.xem3
insmod vpss.ko

I also tried inserting the 512M.xem3 file as I'm not sure which one I should use, but both result in the serial console locking up.

I just need the /dev/video0 node to be available for the video for linux 2 API

-Thanks

Alex Wright

  • Hi,

    For V4L2 capture driver you should be using PSP04.01.00.06_patch2. patch1 doesnt support V4L2 capture driver.

    Regards,

    Hardik Shah

  • Patch1 comes with the SDK on the flash card, and you are right it does not support capture. -- Which is why I patched it with the patch2 kernel diff file as I stated above.

    Right now I've downloaded the latest ti-ezsdk_dm814x-evm_5_03_01_15 [http://software-dl.ti.com/dsps/dsps_public_sw/ezsdk/latest/index_FDS.html] and it seems to have everything, but I still havent gotten video0 due to some i2c error when inserting the ti81xxvin.ko, but I'm still messing with it

    -Thanks

    Alex Wright

    root@dm814x-evm:~# modprobe ti81xxvin
    tvp7002 3-005d: tvp7002 found @ 0x5d (OMAP I2C adapter)
    omap_i2c omap_i2c.3: controller timed out
    omap_i2c omap_i2c.3: controller timed out
    omap_i2c omap_i2c.3: controller timed out
    omap_i2c omap_i2c.3: controller timed out
    omap_i2c omap_i2c.3: controller timed out
    tvp7002 3-005d: TVP7002 read error -110
    tvp7002: probe of 3-005d failed with error -110
    ti81xxvin ti81xxvin: Error registering v4l2 subdevice




  • Seems this is an issue without loading the firmware, after doing:

    ./slaveloader startup VPSS-M3 ti814x_hdvpss_1G.xem3

    the module loaded, but I still dont have /dev/video0

    root@dm814x-evm:~# lsmod
    Module                  Size  Used by
    ti81xxvin              20567  0
    tvp7002                 6429  0
    bufferclass_ti          4946  0
    omaplfb                10794  0
    pvrsrvkm              155474  2 bufferclass_ti,omaplfb
    tlc59108                1545  0
    ti81xxhdmi             14478  0
    ti81xxfb               21771  2
    vpss                   72297  4 ti81xxvin,omaplfb,ti81xxhdmi,ti81xxfb
    syslink              1112651  0
    ipv6                  209855  12

    If I manually make the video0 node with:

    mknod /dev/video0 c 81 0

    An application will complain on the open() call with "no such device"
  • Sometimes when I insert the module I get the following:

    root@dm814x-evm:~# insmod /lib/modules/2.6.37/kernel/drivers/media/video/ti81xx/
    ti81xxvin.ko
    tvp7002 3-005d: tvp7002 found @ 0x5d (OMAP I2C adapter)
    tvp7002 3-005d: Rev. 02 detected.
    Unable to handle kernel NULL pointer dereference at virtual address 00000002
    pgd = c9e18000
    [00000002] *pgd=89e7c031, *pte=00000000, *ppte=00000000
    Internal error: Oops: 17 [#1]
    last sysfs file: /sys/module/tvp7002/initstate
    Modules linked in: ti81xxvin(+) tvp7002 bufferclass_ti omaplfb pvrsrvkm tlc59108 ti81xxhdmi ti81xxfb vpss syslink ipv6
    CPU: 0    Not tainted  (2.6.37 #1)
    PC is at vps_ti814x_select_video_decoder+0x28/0xac
    LR is at ti81xxvin_probe+0x3e4/0x50c [ti81xxvin]
    pc : [<c005c500>]    lr : [<bf253fc4>]    psr: a0000113
    sp : c9c9ddd8  ip : c9c9de08  fp : c9c9de04
    r10: bf255250  r9 : bf255250  r8 : 00000004
    r7 : c04f6324  r6 : 00000000  r5 : 00000000  r4 : 00000000
    r3 : c0528be0  r2 : 0000000c  r1 : 00000000  r0 : c9c9dddc
    Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
    Control: 10c5387d  Table: 89e18019  DAC: 00000015
    Process insmod (pid: 1262, stack limit = 0xc9c9c2e8)
    Stack: (0xc9c9ddd8 to 0xc9c9e000)
    ddc0:                                                       c9c9de04 c9c9dde8
    dde0: c02a976c c0095cac c9c76fc0 c9c8fc00 bf255240 00000000 c9c9de44 c9c9de08
    de00: bf253fc4 c005c4e4 00000000 00000001 c050e6c8 c04f61c8 c9c9de34 c04f61d0
    de20: c04f61d0 bf255080 c9cc9780 c050e6c8 c9c9c000 00000000 c9c9de54 c9c9de48
    de40: c0201708 bf253bec c9c9de74 c9c9de58 c0200674 c02016f4 c04f61d0 c04f6204
    de60: bf255080 c9cc9780 c9c9de94 c9c9de78 c020079c c02005b0 00000000 c0200734
    de80: bf255080 c9cc9780 c9c9debc c9c9de98 c01ffe20 c0200740 cc821138 cc87a030
    dea0: c01afcd8 00000000 bf25511c bf255080 c9c9decc c9c9dec0 c0200498 c01ffddc
    dec0: c9c9defc c9c9ded0 c01ff6f8 c0200484 bf254cde c9c9dee0 00000000 bf25511c
    dee0: bf255080 00012018 bf259000 00000000 c9c9df24 c9c9df00 c0200ad4 c01ff650
    df00: 00000000 bf25511c 00012008 00012018 bf259000 c9c9c000 c9c9df34 c9c9df28
    df20: c0201bac c0200a30 c9c9df44 c9c9df38 bf259014 c0201b6c c9c9df7c c9c9df48
    df40: c003a3d8 bf25900c bf25511c 00012008 00012018 c0044f48 00000000 bf25511c
    df60: 00012008 00012018 c0044f48 00000000 c9c9dfa4 c9c9df80 c0097598 c003a314
    df80: c00c3e80 c00c3d98 00000000 00010000 00000003 00000080 00000000 c9c9dfa8
    dfa0: c0044da0 c0097508 00000000 00010000 00012018 00008d74 00012008 00000001
    dfc0: 00000000 00010000 00000003 00000080 00012008 00000000 00012018 00000000
    dfe0: bea87e98 bea87c2c 00008da0 401fb7d4 60000010 00012018 006c7274 636b5f5f
    Backtrace:
    [<c005c4d8>] (vps_ti814x_select_video_decoder+0x0/0xac) from [<bf253fc4>] (ti81xxvin_probe+0x3e4/0x50c [ti81xxvin])
     r6:00000000 r5:bf255240 r4:c9c8fc00
    [<bf253be0>] (ti81xxvin_probe+0x0/0x50c [ti81xxvin]) from [<c0201708>] (platform_drv_probe+0x20/0x24)
    [<c02016e8>] (platform_drv_probe+0x0/0x24) from [<c0200674>] (driver_probe_device+0xd0/0x190)
    [<c02005a4>] (driver_probe_device+0x0/0x190) from [<c020079c>] (__driver_attach+0x68/0x8c)
     r7:c9cc9780 r6:bf255080 r5:c04f6204 r4:c04f61d0
    [<c0200734>] (__driver_attach+0x0/0x8c) from [<c01ffe20>] (bus_for_each_dev+0x50/0x84)
     r7:c9cc9780 r6:bf255080 r5:c0200734 r4:00000000
    [<c01ffdd0>] (bus_for_each_dev+0x0/0x84) from [<c0200498>] (driver_attach+0x20/0x28)
     r6:bf255080 r5:bf25511c r4:00000000
    [<c0200478>] (driver_attach+0x0/0x28) from [<c01ff6f8>] (bus_add_driver+0xb4/0x234)
    [<c01ff644>] (bus_add_driver+0x0/0x234) from [<c0200ad4>] (driver_register+0xb0/0x13c)
    [<c0200a24>] (driver_register+0x0/0x13c) from [<c0201bac>] (platform_driver_register+0x4c/0x60)
     r9:c9c9c000 r8:bf259000 r7:00012018 r6:00012008 r5:bf25511c
    r4:00000000
    [<c0201b60>] (platform_driver_register+0x0/0x60) from [<bf259014>] (ti81xxvin_init+0x14/0x1c [ti81xxvin])
    [<bf259000>] (ti81xxvin_init+0x0/0x1c [ti81xxvin]) from [<c003a3d8>] (do_one_initcall+0xd0/0x1a4)
    [<c003a308>] (do_one_initcall+0x0/0x1a4) from [<c0097598>] (sys_init_module+0x9c/0x1bc)
    [<c00974fc>] (sys_init_module+0x0/0x1bc) from [<c0044da0>] (ret_fast_syscall+0x0/0x30)
     r7:00000080 r6:00000003 r5:00010000 r4:00000000
    Code: e3a01000 e3a0200c e24b0028 e5935000 (e1d560b2)
    ---[ end trace ff817326df119b23 ]---
    Segmentation fault

  • When using the 512M firmware and loading the modules I get this pretty consistantly:

    tvp7002 3-005d: tvp7002 found @ 0x5d (OMAP I2C adapter)
    tvp7002 3-005d: TVP7002 read error -121
    tvp7002: probe of 3-005d failed with error -121
    ti81xxvin ti81xxvin: Error registering v4l2 subdevice


  • It seems the default init scripts are loading all the modules. I manually disabled the matrix app, disabled the graphics0-3 and display0-3 flags, removed all the modules, and ran the /usr/share/ti/ti-media-controller-utils/load-hd-v4l2-firmware.sh and I now have all the video nodes.

    However, as soon as I run my application that captures video data (some old v4l2 code I had that got image frames from a logitech c310. Attached, definitely not clean code, but shouldnt crash the kernel module.)

    I get the folowing:

    Device CapabilitDivision by zero in kernel.
    ies
    Driver nameBacktrace: : ¾f
    Device na
    me: 8

    Bus Info[<c0048b70>] (dump_backtrace+0x0/0x110) from [<c039dd84>] (dump_stack+0x18/0x1c)
    :
    Version: 0. r7:00000001179.28
    Capabili r6:00000000ties: 0
     r5:c6dfa004 r4:000001e0
    [<c039dd6c>] (dump_stack+0x0/0x1c) from [<c0049364>] (__div0+0x18/0x20)
    [<c004934c>] (__div0+0x0/0x20) from [<c01acfc4>] (Ldiv0+0x8/0x10)
    [<bf1b5d1c>] (ti81xxvin_check_format+0x0/0x31c [ti81xxvin]) from [<bf1b64b0>] (vidioc_s_fmt_vid_cap+0xb0/0x110 [ti81xxvin])
    [<bf1b6400>] (vidioc_s_fmt_vid_cap+0x0/0x110 [ti81xxvin]) from [<c02a1640>] (__video_do_ioctl+0xb88/0x3f34)
     r7:c6d5c400 r6:c0cc5605 r5:00000000 r4:c0cc5605
    [<c02a0ab8>] (__video_do_ioctl+0x0/0x3f34) from [<c02a08a8>] (__video_usercopy+0x2e4/0x428)
    [<c02a05c4>] (__video_usercopy+0x0/0x428) from [<c02a0a1c>] (video_ioctl2+0x30/0x38)
    [<c02a09ec>] (video_ioctl2+0x0/0x38) from [<c029fa5c>] (v4l2_ioctl+0xe8/0x11c)
     r5:c6d5c400 r4:ca849b80
    [<c029f974>] (v4l2_ioctl+0x0/0x11c) from [<c00d2514>] (vfs_ioctl+0x28/0x44)
     r9:c6dc6000 r8:bea7aad0 r7:00000003 r6:00000003 r5:ca849b80
    r4:00000000
    [<c00d24ec>] (vfs_ioctl+0x0/0x44) from [<c00d2c24>] (do_vfs_ioctl+0x500/0x540)
    [<c00d2724>] (do_vfs_ioctl+0x0/0x540) from [<c00d2cbc>] (sys_ioctl+0x58/0x7c)
    [<c00d2c64>] (sys_ioctl+0x0/0x7c) from [<c0044da0>] (ret_fast_syscall+0x0/0x30)
     r8:c0044f48 r7:00000036 r6:00008a4c r5:00000000 r4:0000b31c
    type 1 width 640 height 480 format 1448695129
    0 0 0 0 0 0 0 1 0
    640x480
    mmap error 22, Invalid argument


  • So to summarize where I'm at:

    1. flash card generated from: ti-ezsdk_dm814x-evm_5_03_01_15

    2. renamed /etc/rc5.d/S01load-hd-firmware.sh to /etc/rc5.d/old_S01load-hd-firmware.sh

    3. renamed /etc/rc5.d/S99matrix-gui-e to /etc/rc5.d/old_S99matrix-gui-e

    4. Boot

    5. Run /usr/share/ti/ti-media-controller-utils/load-hd-v4l2-firmware.sh

    6. Run capture.c program

    The following code which sets a desired pixel format:

    memset(&fmt, 0, sizeof(fmt));

    fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;

    fmt.fmt.pix.width = 320;

    fmt.fmt.pix.width = 240;

    fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;

    fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;

    if (-1 == xioctl(fd, VIDIOC_S_FMT, &fmt))

        errno_exit("VIDIOC_S_FMT");

    Causes a kernel module division by zero

  • Okay, I changed my capture code to more closely follow an example capture.c I got on the net yesterday somewhere (it was an example for this devkit I believe)

    See code here:

    http://paste2.org/p/1955825

    It seems to work up until I call VIDIOC_DQBUF which always returns -1 and gives me EAGAIN as an error number. Feel free to point out where I'm messing up if you could.

    -Thanks

    Alex Wright

  • Hi,

    Alex Wright said:
    tvp7002 3-005d: tvp7002 found @ 0x5d (OMAP I2C adapter)
    tvp7002 3-005d: TVP7002 read error -121
    tvp7002: probe of 3-005d failed with error -121

    Above normally happens if your daughter card is not connected properly with base board. Try removing daughter card and re-fix it firmly.

    Regards,

    Hardik Shah

  • Hi,

    what error you are seeing is a known problem. Its  not a kernel crash but its a kernel dump. It will come first time only. But in spite of  this warning capture works. Can you please try running saLoopBack and confirm that it works. What are you trying to do with capture.c.

    Regards,

    Hardik Shah

  • Okay, I downloaded the TI814X-LINUX-PSP-04.01.00.07, modified the Rules.make and made some small changes to the Makefile to compile the examples. I really dont like how this code includes board specific include files: <linux/ti81xxfb.h> <linux/ti81xxhdmi.h> and <linux/ti81xxvin.h> as this kills any hope of this code being portable.

    My code was based on an early online v4l2 example from last summer, (it successfully captures from a logitech C310) which I modified yesterday with an another example capture.c I found on this dm814x/am387 forum in hopes that it would work, but didnt. (It now fails with EAGAIN on VIDIOC_DQBUF indefinitely, I added it to pastebin and linked to it on here, but I think it got flagged as spam as it required 'moderator approval')

    Anyway, the saLoopBack example results in the following output:

    Driver Name: ti81xxvin
    Driver bus info: TI81xx Platform
    Driver is capable of doing capture
    saLoopBack:
     Mode set is 0
    Setting DV Preset failed

    All I want to do is get a single frame from a camera connected to the digital parallel CAM input port. It outputs 320x240@60hz

    -Thanks

    Alex Wright

  • Hi,

    If you are using your own decoder you have to add that decoder to V4L2 capture driver. Here is a wiki for doing same. If you are trying to capture through TVP7002 than it supports 720P60, 1080P60 and 1080I60 resolutions only.

    Regards,

    Hardik Shah

  • I dont think I need a decoder as the image is already digital yuv data. Looking at this post: http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/171548.aspx You've said: "You are right, ISS is best suited for your use case. You will be able to do interpolation in hardware. We dont have V4L2 interface on it as of now. You can contact your TI local representative to get the software for ISS.  It will not be V4L2 based."

    Which I believe means that I cannot use the standard video for linux 2 api's to get the data. One of our other davinici based projects uses a DM365 and the IPNC reference design code from appro that relies on manually setting ISIF registers to initialize a hardware controller that DMA's data into memory that is then extracted using the CMEM kernel module. Can this be done on this board as well? If so where can I find the memory mapped registers for things such as resolution etc for this board? (All this information for the DM365 is found here: http://www.ti.com/lit/ug/sprufg8c/sprufg8c.pdf)

  • Hi,

    Alex Wright said:
    Which I believe means that I cannot use the standard video for linux 2 api's to get the data.

    True,

    Alex Wright said:
    If so where can I find the memory mapped registers for things such as resolution etc for this board?

    ISS is under NDA so you wont find it under TRM. You will have to get in touch with local TI representative to get more details.

    Regards,

    Hardik Shah