public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: Joshua Hintze <joshua.hintze@gmail.com>
Cc: linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com
Subject: Re: Using MT9P031 digital sensor
Date: Mon, 26 Mar 2012 10:32:21 -0600	[thread overview]
Message-ID: <4F709A15.7050501@mlbassoc.com> (raw)
In-Reply-To: <CAGD8Z76vJSK9dCvSVWXW7FtUkN2MY5V2Dm9NJzHjrgjgS22Dxw@mail.gmail.com>

On 2012-03-26 09:37, Joshua Hintze wrote:
> Gary,
>
> I'm using linux branch from 2.6.39
>
> Fetch URL: git://www.sakoman.com/git/linux-omap-2.6
> branch: omap-2.6.39
>
> I'm using an overo board so I figured I should follow Steve Sakoman's
> repository.
>
> Which brings up another question, would you recommend going off of one
> of Laurent's repo's and if so which one?

The last time I tried Laurent's repo, it did not have the UYVY support in
the OMAP3ISP/CCDC merged in.  I don't know if that has changed recently.

> On Mon, Mar 26, 2012 at 9:25 AM, Gary Thomas<gary@mlbassoc.com>  wrote:
>> On 2012-03-25 23:13, Joshua Hintze wrote:
>>>
>>> Alright I made some progress on this.
>>>
>>> I can access the Mt9p031 registers that are exposed using a command such
>>> as
>>>
>>> ./yavta -l /dev/v4l-subdev8 to list the available controls. Then I can
>>> set the exposure and analog gain with
>>> ./yavta --set-control '0x00980911 1500' /dev/v4l-subdev8<--- This
>>> seems to give the desired effect.
>>>
>>> Note that ./yavta -w (short option for --set-control) gives a seg
>>> fault for me. Possible bug in yavta??
>>>
>>> Now I'm working on fixing the white balance. In my office the
>>> incandescent light bulbs give off a yellowish tint late at night. I've
>>> been digging through the omap3isp code to figure out how to enable the
>>> automatic white balance. I was able to find the private IOCTLs for the
>>> previewer and I was able to use VIDIOC_OMAP3ISP_PRV_CFG. Using this
>>> IOCTL I adjusted the OMAP3ISP_PREV_WB, OMAP3ISP_PREV_BLKADJ, and
>>> OMAP3ISP_PREV_RGB2RGB.
>>>
>>> Since I wasn't sure where to start on adjusting these values I just
>>> set them all to the TRM's default register values. However when I did
>>> so a strange thing occurred. What I saw was all the colors went to a
>>> decent color. I'm curious if anybody can shed some light on the best
>>> way to get a high quality image. Ideally if I could just set a bit for
>>> auto white balance and auto exposure that could be good too.
>>
>>
>> Just curious - what codebase (git URL) are you using?
>>
>>> On Fri, Mar 23, 2012 at 1:01 PM, Joshua Hintze<joshua.hintze@gmail.com>
>>>   wrote:
>>>>
>>>> Sorry to bring up this old message list. I was curious when you spoke
>>>> about the ISP preview engine being able to adjust the white balance.
>>>>
>>>> When I enumerate the previewer's available controls all I see is...
>>>>
>>>> root@overo:~# ./yavta -l /dev/v4l-subdev3
>>>> --- User Controls (class 0x00980001) ---
>>>> control 0x00980900 `Brightness' min 0 max 255 step 1 default 0 current 0.
>>>> control 0x00980901 `Contrast' min 0 max 255 step 1 default 16 current 16.
>>>> 2 controls found.
>>>>
>>>>
>>>> Is this what you are referring to? Are there other settings I can
>>>> adjust to get the white balance and focus better using the  OMAP3 ISP
>>>> AWEB/OMAP3 ISP AF?
>>>>
>>>> Thanks,
>>>>
>>>> Josh
>>>>
>>>>
>>>>
>>>>
>>>> Hi Gary,
>>>>
>>>> On Wednesday 30 November 2011 18:00:55 Gary Thomas wrote:
>>>>>
>>>>> On 2011-11-30 07:57, Gary Thomas wrote:
>>>>>>
>>>>>> On 2011-11-30 07:30, Laurent Pinchart wrote:
>>>>>>>
>>>>>>> On Wednesday 30 November 2011 15:13:18 Gary Thomas wrote:
>>>>
>>>>
>>>> [snip]
>>>>
>>>>>>>> This sort of works(*), but I'm still having issues (at least I can
>>>>>>>> move
>>>>>>>> frames!) When I configure the pipeline like this:
>>>>>>>> media-ctl -r
>>>>>>>> media-ctl -l '"mt9p031 3-005d":0->"OMAP3 ISP CCDC":0[1]'
>>>>>>>> media-ctl -l '"OMAP3 ISP CCDC":2->"OMAP3 ISP preview":0[1]'
>>>>>>>> media-ctl -l '"OMAP3 ISP preview":1->"OMAP3 ISP resizer":0[1]'
>>>>>>>> media-ctl -l '"OMAP3 ISP resizer":1->"OMAP3 ISP resizer output":0[1]'
>>>>>>>> media-ctl -f '"mt9p031 3-005d":0[SGRBG12 2592x1944]'
>>>>>>>> media-ctl -f '"OMAP3 ISP CCDC":0 [SGRBG12 2592x1944]'
>>>>>>>> media-ctl -f '"OMAP3 ISP CCDC":1 [SGRBG10 2592x1944]'
>>>>>>>> media-ctl -f '"OMAP3 ISP preview":0 [SGRBG10 2592x1943]'
>>>>>>>> media-ctl -f '"OMAP3 ISP resizer":0 [YUYV 2574x1935]'
>>>>>>>> media-ctl -f '"OMAP3 ISP resizer":1 [YUYV 660x496]'
>>>>>>>> the resulting frames are 666624 bytes each instead of 654720
>>>>>>>>
>>>>>>>> When I tried to grab from the previewer, the frames were 9969120
>>>>>>>> instead of 9961380
>>>>>>>>
>>>>>>>> Any ideas what resolution is actually being moved through?
>>>>>>>
>>>>>>>
>>>>>>> Because the OMAP3 ISP has alignment requirements. Both the preview
>>>>>>> engine and the resizer output line lenghts must be multiple of 32
>>>>>>> bytes. The driver adds padding at end of lines when the output width
>>>>>>> isn't a multiple of 16 pixels.
>>>>>>
>>>>>>
>>>>>> Any guess which resolution(s) I should change and to what?
>>>>>
>>>>>
>>>>> I changed the resizer output to be 672x496 and was able to capture video
>>>>> using ffmpeg.
>>>>>
>>>>> I don't know what to expect with this sensor (I've never seen it in use
>>>>> before), but the image seems to have color balance issues - it's awash
>>>>> in
>>>>> a green hue.  It may be the poor lighting in my office...  I did try the
>>>>> 9
>>>>> test patterns which I was able to select via
>>>>>     # v4l2-ctl -d /dev/v4l-subdev8 --set-ctrl=test_pattern=N
>>>>> and these looked OK.  You can see them at
>>>>> http://www.mlbassoc.com/misc/mt9p031_images/
>>>>
>>>>
>>>> Neither the sensor nor the OMAP3 ISP implement automatic white balance.
>>>> The
>>>> ISP preview engine can be used to modify the white balance, and the
>>>> statistics
>>>> engine can be used to extract data useful to compute the white balance
>>>> parameters, but linking the two needs to be performed in userspace.
>>>>
>>>>>>> So this means that your original problem comes from the BT656 patches.
>>>>>>
>>>>>>
>>>>>> Yes, it does look that way. Now that I have something that moves data,
>>>>>> I
>>>>>> can compare how the ISP is setup between the two versions and come up
>>>>>> with a fix.
>>>>>
>>>>>
>>>>> This is next on my plate, but it may take a while to figure it out.
>>>>>
>>>>> Is there some recent tree which will have this digital (mt9p031) part
>>>>> working that also has the BT656 support in it?  I'd like to try that
>>>>> rather than spending time figuring out why an older tree isn't working.
>>>>
>>>>
>>>> No, I haven't had time to create one, sorry. It shouldn't be difficult to
>>>> rebase the BT656 patches on top of the latest OMAP3 ISP and MT9P031 code.
>>>>
>>>> --
>>>> Regards,
>>>>
>>>> Laurent Pinchart
>>>> --
>>>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>>>> the body of a message to majord...@vger.kernel.org
>>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
>> --
>> ------------------------------------------------------------
>> Gary Thomas                 |  Consulting for the
>> MLB Associates              |    Embedded world
>> ------------------------------------------------------------

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

  reply	other threads:[~2012-03-26 16:43 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 19:01 Using MT9P031 digital sensor Joshua Hintze
2012-03-26  5:13 ` Joshua Hintze
2012-03-26  8:25   ` Laurent Pinchart
2012-03-26 15:44     ` Joshua Hintze
2012-03-26 17:38       ` Laurent Pinchart
2012-03-26 17:43         ` Joshua Hintze
     [not found]   ` <4F708A66.8090303@mlbassoc.com>
2012-03-26 15:37     ` Joshua Hintze
2012-03-26 16:32       ` Gary Thomas [this message]
2012-03-26 16:55         ` Joshua Hintze
2012-03-27 14:44         ` jean-philippe francois
2012-03-29 11:33           ` Laurent Pinchart
  -- strict thread matches above, loose matches on Subject: below --
2011-11-01 18:52 Gary Thomas
2011-11-04 10:37 ` Laurent Pinchart
2011-11-08 12:20   ` Gary Thomas
2011-11-08 12:30     ` Javier Martinez Canillas
2011-11-08 12:33       ` Laurent Pinchart
2011-11-08 12:52       ` Gary Thomas
2011-11-08 13:06         ` Laurent Pinchart
2011-11-08 13:38           ` Gary Thomas
2011-11-08 13:40             ` Gary Thomas
2011-11-09  0:54             ` Laurent Pinchart
2011-11-09 11:01               ` Gary Thomas
2011-11-09 16:18                 ` Laurent Pinchart
2011-11-09 16:24                   ` Gary Thomas
2011-11-11 14:26                     ` Laurent Pinchart
2011-11-14 11:42                       ` Gary Thomas
2011-11-16  1:26                         ` Laurent Pinchart
2011-11-16 12:03                           ` Gary Thomas
2011-11-24 11:28                             ` Laurent Pinchart
2011-11-25 11:50                               ` Gary Thomas
2011-11-28 11:07                                 ` Laurent Pinchart
2011-11-28 12:42                                   ` Gary Thomas
2011-11-28 12:49                                     ` Laurent Pinchart
2011-11-28 12:53                                       ` Gary Thomas
2011-11-30 14:13                                       ` Gary Thomas
2011-11-30 14:30                                         ` Laurent Pinchart
2011-11-30 14:38                                           ` Hiremath, Vaibhav
2011-11-30 14:57                                           ` Gary Thomas
2011-11-30 17:00                                             ` Gary Thomas
2011-11-30 23:49                                               ` Laurent Pinchart
2011-11-30 23:42                                             ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F709A15.7050501@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=joshua.hintze@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox