Has anybody ported bayer type grayscale sensor to the android? In my case it's Aptina mt9p031. I wvas able to get the driver build and chip initialize up to the point where it outputs clock, data and sychronization signals. I made small changes to the HAL layer so that it recognizes the chip and starts talking. I also limited resolution to 640x480 and made camera to output vertical bars test patterns. I'm getting camera preview and capture with no apparent errors reported from kernel or HAL. However, picture is green with some slowly moving blocks. My problem is that there is no clear guide on where to make changes to make new camera work and I'm hoping that through this forum and experience of others I can make progress.
Let me know if you need more information.
已解决! 转到解答。
I fixed green/pink issue and now Aptina camera displays normal gray picture in Android. I'll post my patch when I clean up the code. If somebody needs it right away reply to this thread.
it turns out the mt9p031 driver that is in the tree I mentioned above is in the MAINLINE kernel and not in the freescale sources. Look at this thread:https://lists.yoctoproject.org/pipermail/meta-freescale/2013-March/001803.html.
Freescale doesn't make use of soc_camera or media controller for their capture interfaces. Instead, their drivers are in /media/video/mxc/capture. So looks like what you are doing with taking the ov5642 driver and modifying it for the aptina sensor is the way to go. I would be interested in your patch such that I could use it for doing the MT9T111/MT9T112 driver. Regards
what kernel sources have you been using? I am using the sabrelite board and trying to use the mt9t112.c driver for a MT9T111 sensor but I noticed that this file is not up to date in the sabrelite linux-imx kernel (https://github.com/boundarydevices/linux-imx6/tree/boundary-imx_3.0.35_1.1.1/drivers/media/video).
I also noticed that there is no driver for the mt9p031 camera that you are using. On the other hand, this driver does exist in the Freescale's linux-imx tree (linux-imx/drivers/media/video at master · Freescale/linux-imx · GitHub). I assume you are using this one?
I am trying to merge this kernel into my sabrelite kernel working directory
I use MCIMX6Q-SDP board and running 3.0.35 Linux kernel. Currently while I'm in the exploratory phase, I just modified ov5642 driver to work with Aptina camera. Thanks for the pointer to that Aptina driver, I'll take a look.
I got preview from mt9p031 working on iMX6 SDK with resolution 640x480@30fps but the picture is squished to the left. Once I iron things out, I'll post the changes I had to make. If somebody needs them right away please let me know.
I was able to get camera working on Android. However the picture is green in black areas and pink in white areas. Difference is:
SDK: RGB888 (sensor) ->RGB565 (memory) ->RGB666 (display)
Android: RGB888 (sensor) ->YUV420 (planar) ->RGB666 (display)
YUV planar is default preview memory configuration on Android. When I try the same configuration in SDK as on Android I get the same pink/green outcome. I'm looking into this. If anybody has an idea what the reason is please make a suggestion.