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.

TDA4VM: TivxCaptureNode vs Linux Kernel Driver for MIPI Camera

Part Number: TDA4VM

I'm developing a stereo vision application using two mipi cameras. We're using a TDA4VM for prototyping, but we're considering j721s2-family SoCs as well.

For our test setup, we've built:

  • A Linux kernel driver for our camera CMOS which is successfully streaming through V4L2
  • A TiOvx pipeline for lens distortion correction etc, and stereo depth inference
  • Everything is running from Linux on the A72.
  • We're using the latest processor sdk linux

This is working well, though we need to start optimizing for throughput. We've got several unnecessary copies related to acquiring frames that we're trying to now eliminate.

Using a `tivxCaptureNode` seemed appealing because its output wouldn't require mapping into OVX images, but I wanted to confirm a few things:

  1. Are V4L2+KernelDriver and tivxCaptureNode mutually exclusive systems?
  2. Does using the capture node require a (kernel) driver at all? If not, how are common operations like setting exposure or starting the stream done? Do you just do the I2C writes directly?
  3. Can tivxCaptureNodes be used from A72/Linux?
  4. Does the presence of a camera + linux kernel driver somehow disable tivxCapture? Put differently, what might I need to do to convert my existing V4L2+KernelDriver setup to a tiovx based setup? Should I remove the driver, the device tree node.

Finally, I just wanted to understand if there are inherent advantages to using tivxCapture over V4L2? Could achieve equally good performance with V4L2, if i were smarter about MMAPing, using vxSwapHandle etc.

  • Hi Paul,

    Please find below answers to your questions,

    Are V4L2+KernelDriver and tivxCaptureNode mutually exclusive systems?

    Yes, for the same CSIRX instances, it can be used only from one core ie A72 (Linux) or R5F(CaptureNode).

    Does using the capture node require a (kernel) driver at all? If not, how are common operations like setting exposure or starting the stream done? Do you just do the I2C writes directly?

    No, capture node has no dependency on Linux Kernel driver. Exposure and other settings are done on sensor, so yes, it is done using i2c. 

    Can tivxCaptureNodes be used from A72/Linux?

    Well, you can instantiate capture node on A72. The OpenVX in which we can instantiate any node runs on Linux. 

    Does the presence of a camera + linux kernel driver somehow disable tivxCapture? Put differently, what might I need to do to convert my existing V4L2+KernelDriver setup to a tiovx based setup? Should I remove the driver, the device tree node.

    No, you will require disabling capture node explicitly when you use it from Linux. 

    Regards,

    Brijesh

  • Hey Brijesh

    Thanks for the prompt reply. I have a few quick follow ups.

    Does the presence of a camera + linux kernel driver somehow disable tivxCapture? Put differently, what might I need to do to convert my existing V4L2+KernelDriver setup to a tiovx based setup? Should I remove the driver, the device tree node.
    No, you will require disabling capture node explicitly when you use it from Linux.

    I guess I'm trying to go the other way. I have a Linux driver and V4L2 setup, but now I want to test the capture node. I'm having trouble getting that to work, and I'd like to know if I need to e.g. remove the kernel module that runs the cameras. Here's what I'm seeing:

     20002.952927 s:  VX_ZONE_ERROR:[ownContextSendCmd:822] Command ack message returned failure cmd_status: -7
     20002.952957 s:  VX_ZONE_ERROR:[ownContextSendCmd:862] tivxEventWait() failed.
     20002.952976 s:  VX_ZONE_ERROR:[ownNodeKernelInit:527] Target kernel, TIVX_CMD_NODE_CREATE failed for node node_94
     20002.952992 s:  VX_ZONE_ERROR:[ownNodeKernelInit:528] Please be sure the target callbacks have been registered for this core
     20002.953008 s:  VX_ZONE_ERROR:[ownNodeKernelInit:529] If the target callbacks have been registered, please ensure no errors are occurring within the create callback of this kernel
     20002.953137 s:  VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 0, kernel com.ti.capture ... failed !!!
     20002.953162 s:  VX_ZONE_ERROR:[vxVerifyGraph:2055] Node kernel init failed
     20002.953178 s:  VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed
    

    Also do you have any thoughts about this:

    Finally, I just wanted to understand if there are inherent advantages to using tivxCapture over V4L2? Could achieve equally good performance with V4L2, if i were smarter about MMAPing, using vxSwapHandle etc.

  • Hi Paul,

    have a Linux driver and V4L2 setup, but now I want to test the capture node.

    For this, please use vision apps dtb file, this file uses overlay feature and disables the CSIRX driver from Linux.

    In your log, i dont see any messages from mcu2_0, so not sure why it failed. Please share complete log.

    Finally, I just wanted to understand if there are inherent advantages to using tivxCapture over V4L2? Could achieve equally good performance with V4L2, if i were smarter about MMAPing, using vxSwapHandle etc.

    Well, capture node supports more features and since it is running on control core, it does not get affected by other modules in Linux.

    Regards,

    Brijesh 

  • For this, please use vision apps dtb file, this file uses overlay feature and disables the CSIRX driver from Linux.

    I suspect this is the issue.

    I'm going to run a few more experiments with V4L2, and then I'll focus the capture node. That will take me a while. If I get stuck I'll start a new thread, but for now I'll resolve.

    Thank you for your responses.