AnsweredAssumed Answered

Issue with Camera HAL v3 Service and IMX6 Gralloc/HWComposer Library on Android Lolipop

Question asked by Mohamed Thalib Haja on Oct 12, 2015
Latest reply on Oct 15, 2015 by Wigros Sun

We are developing Camera HAL V3 for our custom board [esom imx6], on Android Lolipop

 

We are facing issue in getting garalloc buffer - The (private_handle_t) buffer given by Camera Service is corrupted/invalid.

 

Note: We are able to use Camera using HAL v2 without any problem, we are upgrading to HAL v3 for more features in v3 HAL.

 

After some comparison study of the Camera Service layer of HAL version v2 and v3 we found, that the service layer implementation for HAL version v3 and v2 are using different code flow path.

 

In Camera HAL v2 Service, the gralloc buffer is obtained using

 

 native_window_dequeue_buffer_and_wait(mConsumerInterface.get(), &anwBuffers[bufferIdx]);     -> (file: Camera2Device.cpp) 

 

  But in Camera HAL v3 Service, the gralloc buffer is obtained directly from hwcomposer using

 

 currentConsumer->dequeueBuffer(currentConsumer.get(), &anb, &fenceFd);     -> (file: Camera3OutputStream.cpp) 

 

mConsumer is nothing but

 

 sp<ANativeWindow> currentConsumer = mConsumer; 

 

The implementation of ANativeWindow is buried inside /system/lib/hw/hwcomposer_fsl.imx6.so - which is closed proprietor library of freescale.

 

The buffer (private_handle_t) returned by deqeueBuffer in HALv3 service is junk/corrupted, trying to access/use the buffer results in segmentation, Changing anything in the camera service will break default implementation.

 

 

Can some one help/suggest what is the best solution to fix this issue without breaking the existing Service layer for Camera HAL v3 on Android Lolipop

[or]

Is there any v3 HAL implementation already available for IMX6

Outcomes