DART-SD410 Debian Camera

From Variscite Wiki
DART-SD410 - Camera

This is the very first release with CSI based camera support. Only basic use cases are supported at the moment. More feature will be added, such as support for scaling, cropping or multiple cameras.

The release is configured to expect the OV5645 sensor on the CSI1. The setup is validated using an VAR-EXT-CB410 Rev 1.01 add on card.

This release includes drivers for:

OV5645 camera sensor;
QC MSM camera sub-system (CSIPHY, CSID, ISPIF, VFE);
QC Camera control interface.
The OV5645 camera sensor driver is in a final stage of implementation and is currently undergoing review in upstream lists.

The CAMSS (camera sub-system) driver is in a state of implementation. The CAMSS HW on 8016 consists of two CSIPHY modules, the CSID modules, ISPIF module and VFE module. The driver currently includes almost ready parts for configuration of the CSIPHY and CSID modules while the parts which configure the ISPIF and VFE are in a process of implementation. It is a V4L2 driver which also utilizes the media controller framework to model the internal topology of the system.

The CCI (camera control interface) driver is a version which originates from QC Android driver and is now separated from the CAMSS driver and compiled on our linux. For this another V4L2 driver and media device are created – this is only a temporary work to enable control on the camera sensor. Proper implementation will follow.

It is suggested to use virtual terminal and Linaro account for testing.

Make sure that you have the following package installed:

$ sudo apt-get update
$ sudo apt-get install v4l-utils

To ensure that your sensor is properly connected, you can inspect the output of the following command:

$ sudo media-ctl -d /dev/media1 -p

If everything is ok, you should see something like this:

entity 8: ov5645 1-0078 (1 pad, 1 link)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev6
pad0: Source
[fmt:UYVY8_2X8/1920x1080 field:none
-> "msm_csiphy0":0 [ENABLED,IMMUTABLE]

At this point you need to configure the pipeline: link CSIPHY to CSID and CSID to ISPIF, and configure formats on OV5645, CSIPHY and CSID:

$ sudo media-ctl -d /dev/media1 -l '"msm_csiphy1":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif":0[1]'
$ sudo media-ctl -d /dev/media1 -V '"ov5645 1-0078":0[fmt:UYVY2X8/1920x1080],"msm_csiphy0":0[fmt:UYVY2X8/1920x1080],"msm_csid0":0[fmt:UYVY2X8/1920x1080]'

At this point, the pipeline should be configured and ready to be used by any application that can use v4l2. For example, you can use Gstreamer to take a JPEG picture:

$ gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1' ! jpegenc ! filesink location=image01.jpg

Or you can use Gstreamer to show a live preview from the camera:

$ gst-launch-1.0 v4l2src ! glimagesink