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.

dm8148 connect custom video source

Other Parts Discussed in Thread: TVP7002, TVP5147

Hi all

I have a custom FPGA board, it can generate video format ycbcr4:2:2 and 16bit data bus.
I connect this FPGA board to our dm8148 board at VIN1 portA.

I want to capture this video and display on the LCD panel, who can tell me how to do that?

Bset Regard,

Steven

  • Hello,

    What is the software, that you are using?

    Best Regards,

    Margarita

  • Hi Margarita

    I use the DVSDK release version is ezsdk_dm814x-evm_5_05_01_04, and can work well in Mistral DM8148 EVM board.

    I note that the v4l2 capture driver only support TVP7002 and this decoder is connected to VIN0 portA. On the EVM board has 

    a TVP5147 decoder, but I don't found any driver and application to demo. our SCH design is reference at TVP5147.

    May be I need to modify some code for my case, but I don't know how to start my work.

    I need some help!

    Best Regard,

    Steven


  • Hello,

    Procedure for supporting new decoders is mentioned in app note at http://processors.wiki.ti.com/index.php/DM81xx_AM38xx_Adding_External_Decoders_to_V4L2_Capture_Driver

    Best Regards,

    Margarita

  • Hi Margarita

    Thanks you for reply.

    I will add a decoder follow this app note.

    Best Regard,

    Steven



  • Hi Margarita

    For the Mistral dm8148 EVM board,  tvp7002 is connected to VIN0 portA ,

    where the source code to configure VIN0 and VIN1 in v4l2 device?

    I only see the PINMUX configuration in device.c .

    Best Regard,

    Steven

  • That is part of V4L2 driver.

  • Hi HardikShah

    Thanks for reply.

    There are much file in v4l2 part , I look at the source code carefully  , but  I don't  find anything with configuration of the VIP0 and VIP1.

    would you give me the detail path or C file ?

    Best Regards,

    Steven

  • Hi,

    You can look in folder drivers/media/video/ti81xx/ and drivers/video/ti81xx/. Actual register settings happen in binary. So from these files there are only calls to binary.

  • Hi HardikShah

    Thanks for reply.

    I test my custom dm8148 board and meet some error, need your help. 

    Our external decoder was connnected to VIP1 portA, i2c3,  image format is ycbcr 4:2:2, 16bits, distcrete sync. 

    1. My i2c wrok well,  communication with decoder successfully.

    2. saLoopBackFbdev open device /dev/video5

    3. Our decoder also name tvp7002, I comment some relelant code for our decoder

    4. Our decoder image resolution is 1600x1200

    Following is my quesion

    1. when saLoopBackFbdev load startCapture function, the keneral run crash.

    2. when  saLoopBackFbdev load ioctl(capt.fd, VIDIOC_DQBUF, &capt.buf) , this function never return.

       also say  App can not got video buffer.

    I am very strange and no way to solve this question, I need some help!

    following is wok log

    //------------------------------------------------------------------------------------------------

    root@dm814x-evm:~/dm814x-evm/xjf-module# ./saLoopBackFbdev
    VPSS_GRPX : please stop grpx0 before continue.
    ti81xxvin ti81xxvin: ti81xxvin_open
    ti81xxvin ti81xxvin: vidioc_querycap
    Driver Name: ti81xxvin
    Driver bus info: TI81xx Platform
    Driver is capable of doing capture

    ti81xxvin ti81xxvin: vidioc_query_dv_preset
    tvp7002 4-0055: tvp7002_query_dv_preset
    tvp7002 4-0055: detected preset: 19
    ti81xxvin ti81xxvin: inst->video.cur_dv_preset: 19
    tvp7002 4-0055: tvp7002_mbus_fmt
    tvp7002 4-0055: MBUS_FMT: Width - 1600, Height - 1200, name - 1200p@12
    ti81xxvin ti81xxvin: ti81xxvin_update_std_info
    ti81xxvin ti81xxvin: ti81xxvin_config_format
    ti81xxvin ti81xxvin: ti81xxvin_config_format, preset: 19
    ti81xxvin ti81xxvin: ti81xxvin_vps_config_format
    ti81xxvin ti81xxvin: ti81xxvin_v4l2_df_to_vps_df
    ti81xxvin ti81xxvin: ti81xxvin_vps_config_scalar
    APP: VIDIOC_QUERY_DV_PRESET: 19
    saLoopBackFbdev: Mode set is 19

    ti81xxvin ti81xxvin: vidioc_s_dv_preset
    tvp7002 4-0055: tvp7002_s_dv_preset
    tvp7002 4-0055: tvp7002_mbus_fmt
    tvp7002 4-0055: MBUS_FMT: Width - 1600, Height - 1200, name - 1200p@12
    ti81xxvin ti81xxvin: ti81xxvin_update_std_info
    ti81xxvin ti81xxvin: ti81xxvin_config_format
    ti81xxvin ti81xxvin: ti81xxvin_config_format, preset: 19
    APP: VIDIOC_S_DV_PRESET: 19

    ti81xxvin ti81xxvin: vidioc_g_fmt_vid_cap
    APP: VIDIOC_G_FMT
    =============================================================
    Capture 1 Format:
    =============================================================
    fmt.type = 1
    fmt.width = 1600
    fmt.height = 1200
    fmt.pixelformat = 0x56595559
    fmt.bytesperline = 3200
    fmt.sizeimage = 3840000
    =============================================================

    ti81xxvin ti81xxvin: vidioc_s_fmt_vid_cap
    ti81xxvin ti81xxvin: ti81xxvin_check_format, pixfmt->pixelformat: 0x56595559
    ti81xxvin ti81xxvin: ti81xxvin_get_valid_field
    ti81xxvin ti81xxvin: ti81xxvin_vps_config_format
    ti81xxvin ti81xxvin: ti81xxvin_v4l2_df_to_vps_df
    ti81xxvin ti81xxvin: ti81xxvin_vps_config_scalar
    APP: VIDIOC_S_FMT

    ti81xxvin ti81xxvin: vidioc_g_fmt_vid_cap
    APP: VIDIOC_G_FMT
    =============================================================
    Capture 2 Format:
    =============================================================
    fmt.type = 1
    fmt.width = 1600
    fmt.height = 1200
    fmt.pixelformat = 0x56595559
    fmt.bytesperline = 3200
    fmt.sizeimage = 3840000
    =============================================================

    ti81xxvin ti81xxvin: vidioc_reqbufs
    ti81xxvin ti81xxvin: ti81xxvin_buffer_setup
    APP: VIDIOC_REQBUFS


    Fix Screen Info:
    ----------------
    Line Length - 3200
    Physical Address = 0x8ce00000
    Buffer Length = 41943040


    Var Screen Info:
    ----------------
    Xres - 800
    Yres - 600
    Xres Virtual - 800
    Yres Virtual - 1800
    nonstd - 0
    Bits Per Pixel - 32
    blue lenth 8 msb 0 offset 0
    red lenth 8 msb 0 offset 16
    green lenth 8 msb 0 offset 8
    trans lenth 8 msb 0 offset 24

    APP: FBIOPUT_VSCREENINFO

    Var Screen Info:
    ----------------
    Xres - 800
    Yres - 600
    Xres Virtual - 800
    Yres Virtual - 2400
    nonstd - 0
    Bits Per Pixel - 24
    blue lenth 8 msb 0 offset 0
    red lenth 8 msb 0 offset 16
    green lenth 8 msb 0 offset 8
    trans lenth 0 msb 0 offset 0


    Fix Screen Info:
    ----------------
    Line Length - 2400
    Physical Address = 0x8ce00000
    Buffer Length = 41943040

    ti81xxvin ti81xxvin: vidioc_qbuf, length: 3840000
    ti81xxvin ti81xxvin: ti81xxvin_buffer_prepare
    ti81xxvin ti81xxvin: ti81xxvin_uservirt_to_phys
    ti81xxvin ti81xxvin: vidioc_qbuf, length: 3840000
    ti81xxvin ti81xxvin: ti81xxvin_buffer_prepare
    ti81xxvin ti81xxvin: ti81xxvin_uservirt_to_phys
    ti81xxvin ti81xxvin: vidioc_qbuf, length: 3840000
    ti81xxvin ti81xxvin: ti81xxvin_buffer_prepare
    ti81xxvin ti81xxvin: ti81xxvin_uservirt_to_phys
    ti81xxvin ti81xxvin: vidioc_qbuf, length: 3840000
    ti81xxvin ti81xxvin: ti81xxvin_buffer_prepare
    ti81xxvin ti81xxvin: ti81xxvin_uservirt_to_phys
    APP: queueCaptureBuffers

    ti81xxvin ti81xxvin: vidioc_streamon
    ti81xxvin ti81xxvin: ti81xxvin_check_format, pixfmt->pixelformat: 0x56595559
    ti81xxvin ti81xxvin: ti81xxvin_get_valid_field
    ti81xxvin ti81xxvin: ti81xxvin_vps_create
    ti81xxvin ti81xxvin: ti81xxvin_vps_create end, interlaced: 0
    ti81xxvin ti81xxvin: ti81xxvin_buffer_queue, instance_id: 2                    // instance_id is 2 (VIP1 portA)
    ti81xxvin ti81xxvin: inst->captctrl->set_buffer, instance_id: 2
    ------------[ cut here ]------------
    WARNING: at kernel/softirq.c:159 local_bh_enable+0x54/0xc4()
    Modules linked in: bufferclass_ti omaplfb pvrsrvkm ti81xxhdmi ti81xxvin tvp7002 ti81xxvo ti81xxfb vpss syslink ipv6
    Backtrace:
    [<c0046bd0>] (dump_backtrace+0x0/0x110) from [<c03686d0>] (dump_stack+0x18/0x1c)
    r7:00000000 r6:c006f5b8 r5:c041d50a r4:0000009f
    [<c03686b8>] (dump_stack+0x0/0x1c) from [<c006a020>] (warn_slowpath_common+0x54/0x6c)
    [<c0069fcc>] (warn_slowpath_common+0x0/0x6c) from [<c006a05c>] (warn_slowpath_null+0x24/0x2c)
    r9:c04beca4 r8:d0884780 r7:0000000d r6:cca69800 r5:c049be68
    r4:c04e4e80
    [<c006a038>] (warn_slowpath_null+0x0/0x2c) from [<c006f5b8>] (local_bh_enable+0x54/0xc4)
    [<c006f564>] (local_bh_enable+0x0/0xc4) from [<c0063e98>] (omap_mbox_msg_send+0xcc/0xdc)
    r5:c049be68 r4:00000000
    [<c0063dcc>] (omap_mbox_msg_send+0x0/0xdc) from [<c02cfe9c>] (notify_shm_drv_send_event+0x1c8/0x208)
    r5:00000001 r4:00000000
    [<c02cfcd4>] (notify_shm_drv_send_event+0x0/0x208) from [<c02cd62c>] (notify_send_event+0x114/0x26c)
    [<c02cd518>] (notify_send_event+0x0/0x26c) from [<bf190a08>] (vps_fvid2_queue+0xe4/0x21c [vpss])
    [<bf190924>] (vps_fvid2_queue+0x0/0x21c [vpss]) from [<bf199ccc>] (capture_queue+0x50/0x64 [vpss])
    r8:bf1d2904 r7:60000013 r6:c8b46080 r5:00000000 r4:cbcc9400
    [<bf199c7c>] (capture_queue+0x0/0x64 [vpss]) from [<bf1d1614>] (ti81xxvin_buffer_queue+0xc0/0x134 [ti81xxvin])
    r5:cb69a000 r4:cbcc9400
    [<bf1d1554>] (ti81xxvin_buffer_queue+0x0/0x134 [ti81xxvin]) from [<c02aff78>] (videobuf_streamon+0x80/0xd0)
    r7:60000013 r6:cb69a1c4 r5:cb69a104 r4:c8b46080
    [<c02afef8>] (videobuf_streamon+0x0/0xd0) from [<bf1d0fa0>] (vidioc_streamon+0x280/0x460 [ti81xxvin])
    r7:cb69a104 r6:00000001 r5:cb69a000 r4:00000000
    [<bf1d0d20>] (vidioc_streamon+0x0/0x460 [ti81xxvin]) from [<c02a5880>] (__video_do_ioctl+0x1618/0x3f34)
    r7:cb6a6a00 r6:40045612 r5:00000000 r4:00000001
    [<c02a4268>] (__video_do_ioctl+0x0/0x3f34) from [<c02a4058>] (__video_usercopy+0x2e4/0x428)
    [<c02a3d74>] (__video_usercopy+0x0/0x428) from [<c02a41cc>] (video_ioctl2+0x30/0x38)
    [<c02a419c>] (video_ioctl2+0x0/0x38) from [<c02a320c>] (v4l2_ioctl+0xe8/0x11c)
    r5:cb6a6a00 r4:c8b46000
    [<c02a3124>] (v4l2_ioctl+0x0/0x11c) from [<c00d0fd4>] (vfs_ioctl+0x28/0x44)
    r9:c8b58000 r8:bec0cc4c r7:00000004 r6:00000004 r5:c8b46000
    r4:00000000
    [<c00d0fac>] (vfs_ioctl+0x0/0x44) from [<c00d16e4>] (do_vfs_ioctl+0x500/0x540)
    [<c00d11e4>] (do_vfs_ioctl+0x0/0x540) from [<c00d177c>] (sys_ioctl+0x58/0x7c)
    [<c00d1724>] (sys_ioctl+0x0/0x7c) from [<c0042e00>] (ret_fast_syscall+0x0/0x30)
    r8:c0042fa8 r7:00000036 r6:00000004 r5:00000001 r4:00012168
    ---[ end trace 37eecf017915825a ]---
    ti81xxvin ti81xxvin: inst->captctrl->queue, instance_id: 2
    ti81xxvin ti81xxvin: ti81xxvin_buffer_queue, instance_id: 2
    ti81xxvin ti81xxvin: inst->captctrl->set_buffer, instance_id: 2
    ti81xxvin ti81xxvin: inst->captctrl->queue, instance_id: 2
    ti81xxvin ti81xxvin: ti81xxvin_buffer_queue, instance_id: 2
    ti81xxvin ti81xxvin: inst->captctrl->set_buffer, instance_id: 2
    ti81xxvin ti81xxvin: inst->captctrl->queue, instance_id: 2
    ti81xxvin ti81xxvin: ti81xxvin_buffer_queue, instance_id: 2
    ti81xxvin ti81xxvin: inst->captctrl->set_buffer, instance_id: 2
    ti81xxvin ti81xxvin: inst->captctrl->queue, instance_id: 2
    ti81xxvin ti81xxvin: ti81xxvin_vps_start
    APP: startCapture

    ti81xxvin ti81xxvin: vidioc_dqbuf
    ti81xxvin ti81xxvin: inst->captctrl->dequeue
    ti81xxvin ti81xxvin: num_frms_dequeued: 0      // never return to App