How to access to camera directly on Qualcomm Android platform?

183 views Asked by At

I have a mobile phone equipped with Snapdragon 820. I succeeded in modifying its boot.img and change its boot actions so that it can boot Ubuntu. I spent a week getting its screen and WiFi to work properly. Now I'm trying to make its camera work properly. But I had found some problems and spent a lot of time trying to solve them. Through researching materials and reading the blogs of some big shots, I found that directly accessing the camera on Qualcomm's Android platform is not an easy task. Because Qualcomm's camera driver is different from traditional camera drivers, I am unable to use v4l2 utils to access the camera and obtain data.Currently, I have found the following possible solutions:

  1. Use Qualcomm's camera HAL framework.
  2. Read the source code of Qualcomm's camera driver and make a program like HAL framework.
  3. Directly set registers and obtain data based on the information in the device tree.

Anyway,my question is:

  1. Are the above solutions feasible?
  2. Does Qualcomm's camera HAL framework rely on Android's zygote environment? (I have read the source code of Qualcomm's camera HAL framework and I think it doesn't rely on zygote but I am not very sure about it).
  3. I have tried to create a program based on the HAL framework, but it is always difficult to pass during compilation. I think it may be because I did not download the entire Qualcomm AOSP source code locally, but the entire AOSP source code takes up a lot of space. So I want to know if there is a simpler way to use Qualcomm's HAL framework.
1

There are 1 answers

1
VimMax On

In fact, there are already compiled dynamic libraries in the native Android system of my phone. Therefore, I can dynamically load dynamic libraries through the dlopen function. So, I tried to use the gcc compiler installed on Ubuntu to load dynamic libraries, but encountered some difficult to solve errors when loading dynamic libraries. I think it should be that the gcc compiler downloaded on Ubuntu is incompatible with the compiler used during Android system compilation.So I tried downloading the latest version of NDK. Finally, by reading Qualcomm's mm-qcamera-interface source code and compiling my program using NDK, I was able to directly access the camera and obtain data by writing the program.