Camera Orientation issue: Android Pie default Camera application

1,750 views
Skip to first unread message

Devendra Devadiga

unread,
Mar 12, 2021, 10:43:33 AM3/12/21
to android-porting

Hi,
I am using an (Android Pie) AOSP Camera2  application. (packages/apps/Camera2)

I am working on NXP's i.MX8MMini board with Android Pie AOSP.

We are using Camera module OV5640 as back camera module. Able to preview and capture the image and video in reverse landscape mode.
But the mechanical enclosure fitting camera module rotated 90 degrees right physically.
And in camera application for preview, image is coming as 90 degree left.

Please can you help on this ? What changes I need to do in the Hardware layer?

I had posted complete issue details in this link with physical camera image sensor.

https://groups.google.com/g/android-platform/c/2XZ0zCp0pqg/m/Gm6OtE2yBgAJ

The camera sensor in the image is uased as back camera.

In init.rc file I changed below line :

device/fsl/imx8m/iwg34m_8mm/init.rc

setprop back_camera_orient 0 ==> setprop back_camera_orient 90

But still not working.

I traced where this values is parsing and got this:

vendor/nxp-opensource/imx/libcamera3/CameraHAL.cpp:316:    property_get("back_camera_name", mSets[BACK_CAMERA_ID].mPropertyName, "0");

In NXP's libcamera3 layer parsing values happening but finally how it effect to camera orientation I didn't get.

Please can anyone check this and help me ?

Thanks and Regards,

Devendra




riccardo...@gmail.com

unread,
Mar 17, 2021, 7:11:16 PM3/17/21
to android-porting
Hi. I have working with basically the same configuration. Since the OV5640 has a flip logic at camera level, my suggestion is to edit the kernel driver in order to set the flip parameter at 90 (or 270, depending on the orientation) degree. If needed, it support also mirroring of the image. They should be flags on configuration registers. In this way there is no need to work at OS level or HAL level.

Devendra Devadiga

unread,
Mar 18, 2021, 12:15:38 PM3/18/21
to android-porting
Hi,
Thank you for your reply.
I tried to change the "mirror and flip" registers in driver level previously. But OV5640 only supports 180 degrees flip and with register combination I am able to flip to 180 degrees.
90 degrees and 270 degrees I didn't able to rotate with any combination of "mirror and flip" register values. I checked in datasheet of ov5640 and got the information like it will support only 180 degrees rotation. I had attached the image.
imgpsh_fullsize_anim.png

If you are able to configure  for 90 degrees or 270 degrees, please can you share those register combinations ?

Thanks and Regards,
Devendra

aung ko win

unread,
Mar 23, 2021, 12:24:40 PM3/23/21
to devendrad...@gmail.com, android-porting
--
--
unsubscribe: android-porti...@googlegroups.com
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-porti...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/983acfbb-e35d-47bf-ab7d-18c01211ea04n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages