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.

Linux/DRA76P: Support two digital cameras into CSI2 interface

Part Number: DRA76P
Other Parts Discussed in Thread: TVP5158

Tool/software: Linux

Hi,

By our design requirements, we would like to use two digital cameras into CSI2 interface on DRA76XP. As far as I know, TI had been verified OV490 camera sensor into CSI2 interface on DRA76XP EVM and low level configurations including CSI2 Phy data/clock lanes enabled, CAL and OV490 sensor driver (registered V4L2 devices) were supported.

But, I have a question about a definition MAX_CAMERAS_SUPPORTED in Camera HAL. The MAX_CAMERAS_SUPPORTED is 1. Does it means the Camera HAL just allow to access one camera only? I think the reason was caused by supporting one analog camera over TVP5158 into VIN. To meet our requirements, may I modify the definition MAX_CAMERAS_SUPPORTED to 3 (including one analog camera into VIN and two digital cameras into CSI2) and leads to initialize all of cameras completed? Besides, have anything else should I modify too?

Thank you.

  • Hi Mike,

    which SDK you use?

    Regards,
    Yordan
  • Hi Yordan Kamenov,

    I used SDK 6AO.1.0 and platform is J6 Plus EVM.

    Thank you

  • Hi Mike,

    I have forwarded your question to Android camera expert.

    Regards,
    Yordan
  • Hi Mike, 

    Just to clarify, we do not test multiple cameras with Android Camera HAL, or CSI-2 camera with Camera HAL. 

    In order to use multiple cameras, you would want to make sure to change MAX_SIMUL_CAMERAS_SUPPORTED as well as MAX_CAMERAS_SUPPORTED, otherwise CameraHal_Module will still refuse to open additional cameras. 

    If your CSI-2 camera uses a different resolution than your TVP camera, then you may need to look into either disabling some resolution checks as in this patch, or modifying the accepted values as in this patch

    Finally, you will likely have to find a workaround for selecting the correct video capture device. For example, V4LCameraAdapter.cpp's V4LCameraAdapter_Capabilities function currently exits the device finding loop as soon as the first valid video capture device is found. 

    Thanks,

    David

  • Hi Yordan,

    Thank you



    Hi David,

    Thanks for clarifying it. I found the ov490 is enabled and registered on csi2_phy0 in dra76-evm.dts so that think CSI2 camera function with Camera HAL is verified completely on DRA76XP EVM.

    If the definition MAX_SIMUL_CAMERAS_SUPPORTED and MAX_CAMERAS_SUPPORTED be changed to 3, the V4LCameraAdapter_Capabilities function will try to open and ioctl from/to all of existed video nodes many times depends on above definition. As long as CSI2 PHY is enabled cal.c and image sensor v4l2 driver is probed and registered successfully, I think the Camera HAL could support multiple cameras, is this idea correct?

    About resolution supported, the getCaps function in V4LCapabilities.cpp seems to get/set one parameter only. So it might be to modify as well for multi resolution support? By the way, our two digital camera sources have individual resolutions. One camera into CSI2_0 supports 720p/1080p and another camera into CSI2_1 supports 480p only.


    Thank you
  • Hi Mike,

    We have not tried using CSI2 cameras in the context of Camera HAL, but since the CAL driver is a V4L2 driver I would expect it to work fine. We do not test multiple camera functionality through Camera HAL so I cannot say with confidence how it will behave with multiple cameras. 

    As resolutions go, you're going to need to make sure each camera instance has the correct resolutions. The best way is, like you said, to go ahead and modify Camera HAL to make better use of the dimensions we get in getCaps and make sure that they are getting passed to V4LCameraAdapter. 

    Thanks,

    David