Last edited one week ago

V4L2 troubleshooting grid


Some typical issues related to the V4L2 camera & video framework are listed below. Solutions or debugging methods are proposed for these issues.

If your issue is not listed, try also looking in the articles available in the V4L2 or troubleshooting grids categories.


Symptom Resolution

The camera sensor output in preview mode or/and in capture mode is "dark".

Several possibilities may explain this issue depending on the camera sensor:

  • Camera sensor with integrated ISP: Double check the camera sensor initialization sequence in the related Linux® Kernel driver, maybe the integrated ISP is badly programmed.
  • Camera sensor without integrated ISP: Two operations are required in this case: Debayering (also called "demosaicing") from Raw Bayer color format to RGB color format, Image enhancement using "2A" algorithms (Auto exposure and Auto white balance).
    • On STM32MP1 series: The Debayering operation may be done for instance by GStreamer bayer2rgb plugin. The Image enhancement operation requires a software ISP library or/and application as there is no hardware camera peripheral in this serie supporting this use case. Note: It may be possible to use the GPU (available on STM32MP157 line More info.png) for these 2 operations but the related software is not part of the OpenSTLinux offer.
    • On STM32MP2 series: The DCMIPP internal peripheral integrates an image signal processing (ISP) block used to process camera sensor images. The Debayering operation can be performed by using GStreamer libcamerasrc (preferred) or v4l2src plugins. The Image enhancement operation requires to use libcamera (preferred) or, if V4l2-ctl is used, the dcmipp-isp-ctrl basic ISP tuning example application. Note: The X-LINUX-ISP expansion package can also be used to greatly enhance the sensor image compare to the dcmipp-isp-ctrl application.

Note: The dark output can also be related to the light environment, an object in front of the camera or a camera defect...