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.

DM365 capture device setting

Other Parts Discussed in Thread: TVP5158

Dear All,

I have ran the demo application dvsdk/encodedecode successfully before I changed the kernel for IPNC of Appro.

There is error if I run the encodedecode in EVM. I guess the error becasue of the wrong capture device be selected.

Where is the document to describe the capture device setup for DM365? Or could someone tell me the advice for understanding the capture device setting?

How let demo AP to run?

root@192.168.3.106:/opt/dvsdk/dm365# ./encodedecode
Encodedecode demo started.
DavinciDisplay DavinciDisplay.1: Before finishing with S_FMT:
layer.pix_fmt.bytesperline = 736,
 layer.pix_fmt.width = 720,
 layer.pix_fmt.height = 480,
 layer.pix_fmt.sizeimage =529920
DavinciDisplay DavinciDisplay.1: pixfmt->width = 720,
 layer->layer_info.config.line_length= 736
davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:108
davinci_previewer davinci_previewer.2: ipipe_set_preview_config
davinci_previewer davinci_previewer.2: ipipe_set_preview_config
vpfe ccdc capture vpfe ccdc capture.1: IMP chained
vpfe ccdc capture vpfe ccdc capture.1: Resizer present
vpfe ccdc capture vpfe ccdc capture.1: hpitch = 720, vpitch = 480, bpp = 1
vpfe ccdc capture vpfe ccdc capture.1: hpitch = 720, vpitch = 480, bpp = 1
IRQ handler type mismatch for IRQ 0
vpfe ccdc capture vpfe ccdc capture.1: Error in requesting VINT0 <3>vpfe ccdc capture vpfe ccdc capture.1: Error in attaching interrupt handle
Trying to free already-free IRQ 0
Error: Failed to create capture device
Process one buffer to figure out buffer requirements

my bootarg=console=ttyS0,115200n8 noinitrd rw ip=dhcp root=/dev/nfs nfsroot=192.168.3.220:/home/person/workdir/filesys,nolock mem=76M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4

Best Regards,

Person

  • I am not really familiar with the IPNC kernel, so it is hard for me to say how similar it is to our DVSDK kernel.  Often, third party solutions such as IPNC start from our software and make necessary changes to support their solution, and of course these solutions is supported by the corresponding third parties at this point.   Things to look out for is what version of our DVSDK did they base their software on (assuming they based it on one of our DVSDKs); grabing the same version or asking them if they have ported their current solution to our latest DVSDK can resolve things...

    That said, assuming the kernels (IPNC vs DVSDK) behave very similar, the following part of bootargs "davinci_capture.device_type=4" selects the input capture device.  The current settings are the default and I believe select the component input on our DVEVM.  Also, the encodedecode demo has options you can pass to it (see encodedecode.txt or run encodedecode with -h option) that can allow you to change some of the default input attributes.  You can also try running the encode demo alone which has more options for resolutions (NTSC, 720p...).

  • Hi,

    IPNC Ref Design from Appro/TI does not use the video capture drivers from the LSP (Linux support package) of DVSDK. The VD0 interrupt is not connected to the interrupt handler in the LSP driver and instead is being used in our own implementation of capture driver.

    This is the reason IPNC Ref Design comes with its own version of LSP package and DVSDK components.

    Please do not use DVSDK demos like encode, encodedecode etc. on the IPNC LSP package.

    What exactly is the requirement to use IPNC codebase and run DVSDK encodedecode demo? BTW, IPNC system does not use DMAI also.

     

    Regards,

    Anshuman

  • Hi,

    Thank you very much, and I also know a little more about DM365 SDK.

    Are there tips to understand capture driver for linux more quickly?

    If we need to change the capture device(to TVP5158), what should I know expect reading sprufg8.pdf(VPFE)?

    To use DVSDK demos in IPNC codebase is not our purpose, it just is my testing.

    I found there are three ways to use Codec Engine.

    1.  "av_capture" framework from Appro (or TI's secret weapon ?)

    2. DMAI

    3. dm365_codecs packages

    How do I choose one of them? Why IPNC system don't use DMAI?

    Best Regards,

    Person

  • Person,

    The DM365 DVSDK provided by TI is the official software for the DM365 EVM.  Please note that software stacks from third parties such as Appro may have been written for a different hardware solution (DM365 IPNC vs our EVM); third parties are free to design their own hardware solutions and provide their own software to support them; although TI works closely with some of them, they own their solutions and support of them.  Therefore, from a support model perspective, I can only provide advice on DVSDK software architecture as I am not familiar with third party software (TI does not own the support for these).

    Now to answer your questions.  As you may know, Linux drivers are provided for DM365 EVM; whenever possible, these drivers are written to adhere to established Linux industry standards; for example, video capture and display is nothing new and has been around in Linux systems for quite some time, hence there are established standards such as V4L2 and FBDev along with documentation of the APIs established by these standards out on the web; since TI did not come up with the standards, we do no provide documentation for such standards and simply adhere to them.  That said, in some cases our devices have specialized hardware that do not fit well with an established Linux Standard and we do provide documentation for the Linux driver we design to control this hardware.  In addition, we do provide very top-level documents that help introduce users to key features of our platform such as the video system.  If you look under dvsdk_2_10_xx_xxx/PSP_xx_xx_xxx/docs  directory in DVSDK, you will see driver-related docs, including a brief discussion on V4L2 capture driver with links to the established Linux Standard for more detailed information.  You will also find the driver data-manual document, which describes drivers provided, what features the drivers support, any limitations, as well as performance numbers for each driver.  Hopefully, this answers your question on how to understand capture driver.

    the rest of your questions

    1) If you are going with Appro hardware, you should use appro software.  Our DVSDK software is not tested on Appro (or any other third party) hardware solution.  At least no by TI.

    2) DMAI is a user-space software library that TI added recently our latest DVSDKs; the purpose of DMAI is to abstract driver API and codec engine API and instead provide a much simpler API for application developers to use (after requests from our customers that they wanted something simpler).  Before DMAI, application such as demos included with DVSDK interfaced directly to driver APIs and codec engine APIs, now you have a choice, applications can use DMAI (much smaller/simpler application code) or can talk to driver and codec engine APIs directly.  Many third parties that did not base their software solution on our latest DVSDK is likely missing not only DMAI, but perhaps other features we have incorporated into our DVSDKs.

    3) codec packages interface to codec engine API directly.  DMAI abstracts codec engine API for Linux applications...  As an application developer you can choose to interface to codec engine directly or via DMAI. 

     

     

     

  • I have encounted the same problem.

    I am running the encodedecode demo app:

    # ./loadmodules_sd.sh

    #./encodedecode -y 2 -v h264 -o

    the output is as following:

    ...

    Error: Failed to create capture device
    Process one buffer to figure out buffer requirements

     

    My question is what reason can cause this problem ? how to fix it ?

    thanks!

  • Maybe there is something wrong with the capture device driver, such as vpfe driver and decoder device driver, so you can not operate the capture device in the user space. You should read some source code of the DVSDK, and add debug messages to figure out what's going on.

  • Xing Hong,

    Let me get this post back to the original question. The issue was related to not receiving VPFE interrupt using IP Camera reference design kernel, using encodedecode demo.

    If the case is same, i and Juan have already explained details about it.

    If that's not the case, then we would request you to provide more details. encodedecode demo has been tested as part of DVSDK 2.x and 3.x release on DM365 on TI EVM. If you are using anything different, you need to analyze the error logs and share the setup details with us.

    Regards,

    Anshuman

  • I need  help on encodedecode demo to configure capture driver not to do de-interlacing of captured data.  I am using encodedecode demo in passThrough mode without any encoders as I need the info from both fields in a frame.  I am not a Linux guru and am struggling to find where driver is set up to do automatic de-nterlacing.  Is it in resizer/previewer running in chained mode or is it through SDOFST where VPFE doc (sprufg8a) says "This provides a means to deinterlace an interlaced, two-field input and also to invert an input image vertically" ? (p66).  Is this setting set up on initialisation and which source file should I look in to make the change?

    Thanks, Jinh T

  • Jinh,

    - As you mentionned de-interlacing is done directly on on-the-fly so the video during capture is ouput to memory via the resizer. This is setup in the Linux Video drivers that is used by the DMAI interface.
    Refering to the LSP 2.10 of the DM365 DVSDK 2.10 details on the Linux driver are provided in the following documents:
    Driver user's manual - SPRS566A
    http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/psp/mv_lsp_2_10/02_10_00_14/exports/docs/DaVinciLinux_DriversDataManual_SPRS566A.pdf

    - There are ways to use the video capture so that the de-interlacing  is not done (so the VPFE is not used in continuous mode but in one-shot mode and data does not go though the resizer).
    More information are provided in the following document (Refering to the LSP 2.10 of the DM365 DVSDK 2.10):
    VPFE Capture Driver UsersGuide - SPRUGP6
    http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/psp/mv_lsp_2_10/02_10_00_14/exports/docs/DaVinciLinux_VPFECaptureDriverUsersGuide_SPRUGP6.pdf

    Doc should be located in the following folder after installation of the DVSDK:
        dvsdk_2_xx_xx_x/PSP_02_xx_x_xx/docs

    It looks like that video data need to use what is called data path 1 in the document. Data path 2 will be used for on the fly de-interlacing. See section 2.1 and 2.2.2.6 of this document.
    I think that there is no need to change the V4L2 driver source code. It should be possible to select the data path using some IOCTL. Still I am not sure if the DMAI interface enables to do that diretcly (but I would think so) or if the DMAI src need to be changed.

    - It looks like as well that some example V4L2 examples are provided for both one-shot and continuous mode (this are not DMAI example but example using directly V4L2 at the application level). You should look at a folder called like the following:
        dvsdk_2_xx_xx_x/PSP_02_xx_x_xx/examples/dm365

    Hope it helps,

    A.

  • Thanks for the help.

    Just a comment to start with on the documentation - loads of it - that sometimes the english is not up to standard and a bit confusing.

    I managed to skip the de-interlacing by running in one_shot mode but from the documentation it was not really clear when to use what mode as one-shot sounds like something for doing stills and continues soemthing to use for streaming video especially if the documantation (sprufgg8a) gives "Resizer Bypass Mode" and mentions using SDOFST as a means to do de-interlacing but this does not seem to be used in the drivers which has probably eveolved from previous platforms and not use all features of DM365.

    Running one-shot mode in encodedecode demo I had to change Capture.c in DMAI to not run capture chain mode, change the bootargs to set up one-shot mode and change the color space to UYVY and after the driver not able to allocate enough contiguous memery for 4 display buffers in new pixel format changed it to 3 and it worked.  Now only my display is offset to the left by some pixels that I need to resolve as well as how Black and White is packed in UYVY format for my edge insertion data.

    Thanks, Jinh T.

  • Hi,

    I am facing similar problem, but due to different reasons. (I have been through sprufg8b)

    The design is similar to reference design of Camera (using MT9P031), except some hardware changes, by our designers.

    1> The C_WE_FIELD is not used. Instead, it is input to some other GPIO100/YIN4.

    2> CLKOUT0 is not used, instead it is connected to CLKOUT1.

    I understand that these changes will require some changes in the respective modules, and I have been digging for some time.

    Any lead or pointer will be a big help and highly appreciated.

    TIA,

    Ranjeet

     

  • High Jihn,

    i am trying to modify my application from Oneshot mode to Chain mode.

    for continuous capture i changed the following two things.

    1. In boot args dm365_imp.oper_mode=0

    2. captureChainMode = TRUE in Capture.c present inside dmai_2_xx/..../linux folder.

     

    i am getting some error while running my application

    -----------------

    davinci_resizer davinci_resizer.2: Operation mode doesn't match with current hw mode

    ccdc_enable(): SYNCEN:0x00000002

    ccdc_output_to_sdram(): SYNCEN:0x00000000

    ----------------

    do i need any other changes ? 

  • Hi Sujit, from what I could remember is that your mode must be set up correctly, mode=0 is fine, and captureChainMode must be true (I am using encodedecode demo so everywhere was set to D1_PAL and Composite) and the colorspace and pixelformat must be correct (i think).  I was also not using the previewer and resizer and was disabling it everywhere to the edge of not breaking functionality.  Most of these might not have an influence as I was trying to find the reason why the app didn't start up on a black and white camera which was another feature in the video_davinci_evm driver that I had to change.

    Hope it helps, cheers, Jinh T.

  • Hi Jihn

    thank you very much for your reply.

    actually we are not using EVM, we are using our custom design camera.

    also we need the resizer. 

    is there anywhere setting required for chain mode in registers , apart from oper_mode at boot env and in Capture.c Chain Mode,  present inside dmai/linux/ folder ?

  • Hi Sujit,

    sorry but about previewer and resizer I can't tell you more than what you see in Capture.c as I didn't explore it at all. 

    Hope you come right with this issue.

    Regards, Jinh T.

  • jhin

    what should be the colorspace format for chain mode?

  • Sujit,

    After change and recompile DMAI,  make sure you also recompile your application with new DMAI.
    If you didn't make any changes in your app code after DMAI is recompiled, your app didn't recompile with new DMAI.
    Make a small change in your app, and then recompile app, so that new DMAI is taken.

    Marko.

     

  • Hi Marko,

    you are right.

    but i am getting the message from driver "  mode doesn't allow multiple instances "

    because my application needs multiple instances to be enabled.

    for testing i just made rsz_dev.users =0 in the imp_resizer.c file present inside kernel/linux version../drivers/char/

    it boots fine but no profiles are available and so no video for any of the codecs in my camera.

     

  • encodedecode demo was running ColorSpace_YUV420SEMI in chain mode but then it was automatically deinterlacing the video which I did not want.  Switching to one-shot mode I changed the colorspace to ColorSpace_UYVY.

    Let us know how you got it fixed, Jinh T.

  • Hi Sujit,

    In chain mode only one resize per frame is allowed.
    You can find a lot on that topic at :  http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/7777.aspx?PageIndex=3   (code in : RSZB_Output_Code.zip)

    To get  two  resolutions from the resizer in a chain mode, besides what you have already done,
    enable and set dimension(width,height) of output2 in DMAI Resize.c in function  Resizer_continous_config() .
    Then you can get both, the first and the second-resized frame in the same buffer, just one after another.
    Look at attached files in mentioned post.

    Marko.