Android Camera-HAL-Rockchip-hal3

introduction:

For the HAL layer of the Android camera, it implements a set of Framework API interfaces, and realizes the interaction with the kernel through the V4L2 framework. Different platforms will have different implementations. It is mainly the implementation of the interface of Android HAL3. See how rockchip supports hal3?

Code directory:

hardware/rockchip/camera/

hardware/rockchip/camera_engine_rkisp/

Basic structure:

 

3A control interacts with camera_engine_isp through the control loop interface.

The implementation of some other components or functions will also call some other third-party libraries:

cameraBuffer related, call to Gralloc

jpeg encoding, call to Hwjpeg

Basic components:

 

 

The modules in Camera hal3 mainly include AAL and PSL.
AAL:

Mainly responsible for interacting with the framework, camera_module and API interface instance camera3_device_ops are defined in this module. This module encapsulates this API, sends the request to the PSL, and waits for the corresponding data flow and control parameters to be returned by the receiving PSL.

PSL:

It is the specific implementation of the physical layer. The gcss, GraphConifg, and MediaController in the base are mainly responsible for the analysis of the configuration file xml, the configuration of the underlying pipeline, and the ControlUnit is mainly responsible for the interaction with the camera_engine_isp to realize the control of 3a, and transfer some requests and process and collect Metadata report. ImgUnit, OutputFrameWork, and postProcessPipeline are mainly responsible for obtaining data frames, processing them accordingly, and reporting them. V4l2device and V4l2Subdevice are responsible for interacting with the v4l2 driver to implement specific io operations

tunning xml

The tuning file is an effect parameter file

The naming method of the file: <sensor_name>_<module_name>_<lens_name>.xml, and push the file to the /vendor/etc/camera/rkisp1 directory of the board. Finally, the 3a library will read the tuning files that meet the rules from this directory.

When debugging the Raw sensor data path, you can also bypass the isp first. . Just set the sensor type to SOC. At this time, the tuning file can not be configured temporarily.

camera3_profiles.xml

camera3_profiles.xml contains multiple Profiles nodes, and the Profiles node contains a complete list of camera attributes. Several sensors are connected to the development board, that is, several Profiles nodes need to be configured.

 Relevant information can be obtained through the following command:

$ adb shell dumpsys media.camera

Generate the library after compilation:

1) Hal3 library: /vendor/lib/hw/camera.rk30board.so

2) librkisp : /vendor/lib/librkisp.so

3) 3a lib: /vendor/lib/rkisp//

4) Configuration file: /vendor/etc/camera/

The above configuration file is to copy the files in /etc/camera to the android out directory through precompilation. After modifying the source code and compiling, you only need to push camera.rk30board.so. If you modify the configuration file, you only need to push the corresponding configuration file

Guess you like

Origin blog.csdn.net/haigand/article/details/132463701