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.

About v4l2 capture drvier in dm816x-evm5_03_01_15

Other Parts Discussed in Thread: TVP5147, TVP7002, TVP5147M1, TVP5150, TVP5151

Board:EVM8168
EZSDK:
hdvpss v4l2 frimware name: dm816x_hdvpss_v4l2.xem3
App:saLoopBack

I have a question about v4l2 capture drvier. I try to work tvp5147 on videoin1 , but not work.

Questions
1. Video standard of tvp5147 support NTSC/PAL. 1080P,1080I and 720P is not support.
   The capture driver support NTSC/PAL input ?

2. Tvp7002 was work on videoin0. Video output format is 20-bit 4:2:2 outputs with Embedded Syncs.
   Did the capture drvier support Separate Syncs ( Embedded Sync disabled ) ?
   Beause if tvp5147 is not work, I try to work SiI1161 device.

I refered DM81xx_AM38xx_Video_Capture_Driver_User_Guide.
The following support list is V4L2 capture driver supports following features.

Supports VIP0 instance of the VPSS.
Supports TVP7002 standard Linux sub device driver.
Supports YUV422 interleaved, YUV422 semiplanar, YUV420 semiplanar and RGB888 color formats to memory.
Supports scaling and cropping for YUV formats (downscaling only)
Supports 1080P60, 1080P30, 1080I60 and 720P60 input resolutions.
Supports user pointer buffer mechanism of the V4L2 driver interface.

 

  • Hi,

    Answers inline

    Masaki Hayakawa said:
    I have a question about v4l2 capture drvier. I try to work tvp5147 on videoin1 , but not work.

    We have not tested TVP5147 with V4L2 capture driver. Although code is present. You also have to do mux settings to select between TVP7002 and TVP5147 for getting the data to VIP. Further you have to use /dev/video2 node for VIN1.

    Masaki Hayakawa said:
    Video standard of tvp5147 support NTSC/PAL. 1080P,1080I and 720P is not support.
       The capture driver support NTSC/PAL input ?

    Yes, We have coded capture driver keeping TVP5147 support in mind. But since its never tested it may have bugs.

    Masaki Hayakawa said:
    Tvp7002 was work on videoin0. Video output format is 20-bit 4:2:2 outputs with Embedded Syncs.
       Did the capture drvier support Separate Syncs ( Embedded Sync disabled ) ?
       Beause if tvp5147 is not work, I try to work SiI1161 device.

    Yes, VIP can work in discrete as well as embedded sync. But there is errata for DM816x for discrete sync of operation. Please look at advisory 1.1.10 for discrete sync. I dont think SII1161 will be able to take care of errata. So you need to work with embedded syncs only.

    Regards,

    Hardik Shah

  • Hi, Thank you for quick reply. I have two quessions.

    No.1 About video_if_mode
    In case of embedded syncs mode, tvp5147m1 supports 10-bit-bit ITU-R BT.656 4:2:2 YCbCr with embedded syncs mode only. 
    The v4l2 drvier of tvp514x is default settings.
    I tried to confirm this settings.
    The capture driver supported VPS_CAPT_VIDEO_IF_MODE_8BIT ?
    Because I confirmed camera input image on VPS_CAPT_VIDEO_IF_MODE_16BIT setting (picture1.jpg).

    I confirmed the following process.
    1. I chagned arch/arm/mach-omap2/ti81xx_fb.c
       I changed structure number one of hdvpss_capture_sdev_info.
      
       .name = "tvp514x",
      .board_info = {
       /* TODO Find the correct address
       I2C_BOARD_INFO("tvp5147m1", 0x5c),
       .platform_data = &tvp5147_pdata,
      },
       :
      .video_if_mode = VPS_CAPT_VIDEO_IF_MODE_8BIT, // for 10bit embedded syncs
     
    2.I changed drivers/ti81xx/ti81xx_main.c
      I registered two hdvpss_capture_sdev_info for tvp514x driver.

    3.The boot messege
      I could register tvp514x device with capture driver.
    tvp514x 1-005c: tvp514x 1-005c decoder driver registered !!
    tvp514x 1-005c: tvp5147m1 (Version - 0x07) found at 0xb8 (OMAP I2C adapter)
    ti81xxvin ti81xxvin: registered sub device tvp514x
    ti81xxvin ti81xxvin: TI81xx HDVPSS Capture driver initialized

    4.I executed saLoopBack
      I converted /dev/video0 to /dev/video5 for videoin1.
      I added S_INPUT, S_STD and QUERYSTD of ioctl for NTSC output.

     # echo 0 > /sys/devices/platform/vpss/graphics0/enabled
     # ./saLoopBack
     
     Nothing is HDMI Display (picture2.jpg).

    No.2 About the decrete sync mode
    Did you work the decrete sync mode on tvp7002 device ?
    Prograssive mode is work ?

    I refered errota number Advisiory 2.0.62.

    picture1.jpg

    picutre2.jpg

  • We too are trying to use the TVP5147.

    We've repeated step one above:

    1. I chagned arch/arm/mach-omap2/ti81xx_fb.c
       I changed structure number one of hdvpss_capture_sdev_info.
      
       .name = "tvp514x",
      .board_info = {
       /* TODO Find the correct address
       I2C_BOARD_INFO("tvp5147m1", 0x5c),
       .platform_data = &tvp5147_pdata,
      },
       :
      .video_if_mode = VPS_CAPT_VIDEO_IF_MODE_16BIT, //I've left it in 16 bit

    we noticed that we needed to duplicate the structure

    struct ti81xxvin_interface tvp7002_pdata = ...

    we created

    struct ti81xxvin_interface tvp5147_pdata = ...

    We do not understand step 2

    2.I changed drivers/ti81xx/ti81xx_main.c
      I registered two hdvpss_capture_sdev_info for tvp514x driver.

    ti81xx_main.c does not exist. What file do you mean?

    Also why are you registering two devices?

    What steps did you take to register the device?

    Step 3

    We boot and insert the modules however upon inserting

    ...

    # insmod tvp514x.ko

    # insmod ti81xxvin.ko

    we get

    tvp514x 2-005c: tvp514x 2-005c decoder driver registered !!

    tvp514x 2-005c: chip id mismatch msb 0x0 lsb 0x0

    tvp514x 2-005c: Unable to detect decoder

    tvp514x 2-005c: Unable to query std

    Why do we get a  chip id mismatch?

     

    Thank you,

    Chris

  • Chris, you get a chip mismatch because the wrong I2C bus is being scanned. TI have hardcoded the I2C adapter number instead of making it configurable. You can see the code marked as a "TODO" in the Linux kernel source, line 2512 of file drivers/media/video/ti81xx/ti81xxvin_main.c:

       /* TODO Get the proper adapter id */
        if (cpu_is_ti814x())
            i2c_adap = i2c_get_adapter(3);
        else if (cpu_is_ti816x())
            i2c_adap = i2c_get_adapter(2);
        else
            i2c_adap = i2c_get_adapter(2);

    The TVP5147 chip is on I2C bus number 1, so simply change the relevant line to say i2c_get_adapter(1) instead. This at least makes the VPSS subsystem detect the chip, at the expense of knocking out everything on I2C bus number 2.

    The proper fix for this would probably be to implement an integer "adapter" field in the ti81xxvin_subdev_info structure. We might have to do this ourselves as TVP5147 support is essential for us. If there is interest I might put together a fork of the kernel somewhere, as it seems many people need TVP5147 support.

    Best regards,

    Peter.

  • Hello Peter,

    I know I would really appreciate a copy of the working kernel for TVP5147 support as it is proving difficult to get it to work.

    -Roberto

  • Hi Roberto,

    My current set of kernel patches for TVP5147 are here: http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/191420.aspx

    It detects the chip and GStreamer manages to go the the PLAYING state, but it doesn't stream video properly yet - it gets the error "VPSS_FVID2: create handle is NULL" when trying to stream video from the chip. I don't know enough to fix that problem, but if you have more luck than me then please post patches!

    TI employees: Can someone PLEASE let us know why this isn't working and when you will provide support for the TVP5147?

    As an aside, I also have a set of patches that makes the TVP7002 support PAL 576i component video successfully. If anyone needs them I can post them. However, this doesn't help us as we need to support 576i composite video, and TI's lack of response on this issue is extremely worrying for us.

    Peter.

  • How are you running the video to get that error? And what video are you streaming?  Sorry I took so long to reply, I had to add the patches by hand since our code didn't match up and then I ran into problems compiling everything.

  • Peter Millerchip said:
    The proper fix for this would probably be to implement an integer "adapter" field in the ti81xxvin_subdev_info structure. We might have to do this ourselves as TVP5147 support is essential for us. If there is interest I might put together a fork of the kernel somewhere, as it seems many people need TVP5147 support.

    We are planning this. I2C adapter will be part of each subdevice, so that each subdevice can be on different I2C bus.

    Regards,

    Hardik Shah

  • Hardik: That's great news, do you know when this will be finished and available?

    Roberto: We just tried streaming from a standard SD PAL-format camera attached to the composite video input of the TVP5147. If you can get that working then please let us all know!

  • Is there any timeline on when TVP5147 support will be available? There seems to be enough interest in it and TI seems to be looking at adding support for most of 2012 or so..any chance it's going to happen sometime this year?

  • We ended up going with a company that manufactures the 8168 with PAL and NTSC input via tvp5150 decoders. http://z3technology.com/  Their support and the tiny size of the board is worth the price. They even provide a nice webui.

  • Masaki Hayakawa said:

    4.I executed saLoopBack
      I converted /dev/video0 to /dev/video5 for videoin1.
      I added S_INPUT, S_STD and QUERYSTD of ioctl for NTSC output.

     # echo 0 > /sys/devices/platform/vpss/graphics0/enabled
     # ./saLoopBack

    Hello,

    I'm trying to get a TVP5150 working on a custom DM8148 board and looks like I need to add support for at least QUERYSTD to get things going. Could you please share your modifications to the saLoopBack application and any related changes you made to the TVP514x driver so that I can mirror those for the TVP5150 driver as well..

    Thanks

    ~Ashwin

  • Hi,

    There is no change required in the sample application as it uses V4L2 interface. What you need to is to create TVP5150 driver (if already not available) based on sub-dev model and attach it to 8148 master driver..

    Regards,

    Brijesh Jadav

  • Brijesh Jadav said:

    Hi,

    There is no change required in the sample application as it uses V4L2 interface. What you need to is to create TVP5150 driver (if already not available) based on sub-dev model and attach it to 8148 master driver..

    Regards,

    Brijesh Jadav

    Hi Brijesh,

    On the contrary, the saLoopback and saLoopbackFbdev applications assume you are talking to a HD decoder that supports the QUERY_DV_PRESET IOCTL to set things up. The SD decoder (like the TVP5147 and TVP5151) don't have this IOCTL but rather support the QUERYSTD IOCTL. There is a driver for the TVP5150 that kinda works. However, without adding support for QUERYSTD to both the application and the driver, things don't get set up into a default state like the rest of the V4L2 stack expects it to be.

    There are patches in the works for the TVP5150 driver to add support for Media Controller and the remaining QUERY controls. I'm in the process of backporting those patches to make them happy in the 2.6.37 Kernel that's part of the EZSDK.

    Your suggestion might work for the TVP5147 that's on the DM8148 EVM because some of this support has been added to that driver.

    Regards

    ~Ashwin

  • Hi,

    Application needs to call querystd, getStd and setStd instead of preset. Preset is used for HD and digital inputs while std is used for standard TV formats like NTSC and PAL.

  • hi Ashwin,

    Yes, you are correct, we need to change applicaiton since this app is for HD resolution.

    Thanks,

    Brijesh Jadav

  • Hi,

       In the DM8168-EVM we got the TVP5147 working with V4L2, you can find more info here:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/326172/1170437.aspx#1170437

    -David

  • What are the steps to maka a PAL decoder working?

  • Hello,

    If you are using TVP514x, this driver is already avaiable as a part of Linux kernel under $Kernel/driver/media/tvp514x.c. You just need to hook this up to V4L2 capture driver.
    Follow this user guide :


    processors.wiki.ti.com/.../DM81xx_AM38xx_Adding_External_Decoders_to_V4L2_Capture_Driver

    BR
    Margarita