How to obtain number of cameras connected

Hi,

I am using sample 13_multi_camera with a 3-camera adapter. I changed the MAX_CAMERA_NUM constant to 3. I have only 2 cameras connected from the 3 available MIPI Ports. When using cameraDevices.size(), 3 is still outputted instead of 2. Is there a way to obtain the number of connected cameras instead of the size of the adapter?

Hi,

First, you can try verifying the video devices at the userscape level:

/dev/video0
/dev/video1

Can you provide more information about your enviroment?

Regards
Angel

Hi aphillipso,

I can confirm that in the dev directory, there are video0, video1 & video2 although only two cameras are connected. I am making use of 2 IMX477 MIPI Leopard Imaging cameras using L1-JTX1-MIPI-ADPT REV1.2 3-Camera adapter board. Currently using the ARGUS library and R32.1 Linux. I would like to obtain 2 instead of 3 which represents the number of cameras connected.

You may need to modify the imx274 probe function to check if i2c failed then don’t register the video node.
Or modify the device tree to remove the third camera module from the tegra-camera-platform.

Hi ShaneCCC,

I have tried to delete the third module in the tegra-camera-platform but it does not give me permission to delete. What should I do?

Also, how can I access the imx477 probe function?

Thanks

You need to modify the device tree source code to update the dtb instead of delete it from the /proc/device-tree/tegra-camera-platform.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fkernel_custom.html%23