Custom camera sensor driver is not working alongside display driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom camera sensor driver is not working alongside display driver

978 Views
avijitnsec
Contributor III

I am trying to bring up ov7695 camera driver on imx8mm EVK. This is MIPI based camera. After initial development, camera driver is working when display driver is disabled. It stopped working when I am enabling the display driver.

Setup

- IMX8MM board
- OV7695 camera sensor driver
- MIPI to HDMI converter
- HDMI display
- Linux - 5.4
- gstreamer to stream the video to display and store video.
- v4l2grab to take image
- fb-test to test the display.

Use Cases
- Use Case-1:
Boot the device with camera and display both are connected. Display is working, camera is not working (streaming to display, image, and video storage - not working)
- Use Case-2:
Boot the device with camera is connected, display is not connected
No display, camera is working (save image and video, can’t test if the streaming to display is working)
- Use Case-3:
Boot the device with only camera connected, without display connected. Camara is working (save image and video, can’t test if the streaming to display is working). Connect the HDMI - Camera stop working, display is working
- Use Case-4:
Boot the device with camera connected, without display connected. Video and Image storage is working, start the video streaming using gstreamer. Connect the HDMI display. Video is streaming to HDMI display.

Software Analysis

When the display driver is loaded it is creating the /dev/fb0 node.
Camera driver is using /dev/video0 node.

When the camera image/video capture is not working it is failing at the v4l2 ioctl - VIDIOC_DQBUF. We are using v4l2grab utility to store image.
https://github.com/twam/v4l2grab/blob/master/v4l2grab.c#L284

It is returning EAGAIN in loop. The app is waiting forever (because of the application logic, not driver). And the device is going to this state when the display driver gets loaded (/dev/fb0 is created).

I would appreciate if someone can help me extending the debug effort.

Thanks,
Avijit

0 Kudos
3 Replies

949 Views
avijitnsec
Contributor III

I found the issue with the driver code. The quick work around is to reset the ov7695 sensor chip and set all the registers when the issue occurs. I believe one of the register gets corrupted when the camera data is streamed to display. I am debugging it further. 

0 Kudos

961 Views
avijitnsec
Contributor III

Thank you for your response. I am using Buildroot distribution. Other camera sensor drivers are working. I have tested the default camera - ov5640 and a custom camera - ov7692. Problem is happening only for the ov7695.

0 Kudos