IMX219 camera diagnostics

I want to check if IMX219 camera works okay. That includes not only checking if it’s connected but also if there is a failure with the hardware or software. I would assume IMX219 camera should have a register that holds some kind of information, but I have yet to find it.
To start with, I intend to modify nvidia/drivers/media/i2c/imx219.c and add a polling code to detect each driver error (when probing, when streaming etc.) that is being produced and be notified from the user space. Is this a good approach? Will this provide enough information?

What else can I do to make sure picture is okay from the kernel driver side and from the user space side?

Thank you for information in advance.

hello mozcelikors,

sensor probing and device register happened during kernel initialization,
you cannot ensure camera functionality worked by seeing the camera driver probed.
please launch the camera to check the camera stream, there’re Approaches for Validating and Testing the V4L2 Driver.
please gather kernel logs for reference if you’re having failures. i.e. $ dmesg > klog.txt

My question is gather kernel logs for which driver?
If imx219.c logs are sufficient, then I can check its error logs rather than going to dmesg, is that correct?
You are right about probing, my bad. What I meant to say is I intend to send a message to user-space when an error is produced from imx219.c.

hello mozcelikors,

what’s your actual failure? or, you’re just have assumptions and try to figure-out the ways to debug the driver?

Yes, I am trying to check if the hardware really works, whether or not it has a weird image on the screen but thinks its working (be it a distorted image or it working in unexpected fashion). If such a case exists, I want to catch it from the driver. Is something like that possible?
I want to use the camera and jetson in a product, so if the camera is working unexpectedly I will have back-ups to way in. That’s why I want to detect if camera is really working. I want to catch whatever I can in terms of problems.

hello mozcelikors,

I think it’s straightforward to enable the camera preview stream to check camera functionality.
please refer to developer guide, Approaches for Validating and Testing the V4L2 Driver.

in general, camera basic function works if you’re able to see the preview frames.
there’re several reasons to make the camera not works. and, it’s necessary to dig into kernel logs.
you shall looks for reported errors from either camera driver, VI driver, or CSI driver for the details.