linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Enric Balletbò i Serra" <eballetbo@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: omap3isp: wrong image after resizer with mt9v034 sensor
Date: Tue, 25 Sep 2012 12:52:34 +0200	[thread overview]
Message-ID: <2021377.tLq3KYvgLo@avalon> (raw)
In-Reply-To: <CAFqH_528bnSm+6JjqEHKxNz1mw-PEArG8ut3w=J0-VvwH+xYaw@mail.gmail.com>

Hi Enric,

On Tuesday 25 September 2012 09:44:42 Enric Balletbò i Serra wrote:
> 2012/9/25 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> > On Monday 24 September 2012 15:49:01 Enric Balletbò i Serra wrote:
> >> 2012/9/24 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> >> > On Monday 24 September 2012 10:33:42 Enric Balletbò i Serra wrote:
> >> >> Hi everybody,
> >> >> 
> >> >> I'm trying to add support for MT9V034 Aptina image sensor to current
> >> >> mainline, as a base of my current work I start using the latest
> >> >> omap3isp-next branch from Laurent's git tree [1]. The MT9V034 image
> >> >> sensor is very similar to MT9V032 sensor, so I modified current driver
> >> >> to accept MT9V034 sensor adding the chip ID. The driver recognizes the
> >> >> sensor and I'm able to capture some frames.
> >> >> 
> >> >> I started capturing directly frames using the pipeline Sensor -> CCDC
> >> >> 
> >> >>     ./media-ctl -r
> >> >>     ./media-ctl -l '"mt9v032 3-005c":0->"OMAP3 ISP CCDC":0[1]'
> >> >>     ./media-ctl -l '"OMAP3 ISP CCDC":1->"OMAP3 ISP CCDC output":0[1]'
> >> >>     ./media-ctl -f '"mt9v032 3-005c":0 [SGRBG10 752x480]'
> >> >>     ./media-ctl -f '"OMAP3 ISP CCDC":1 [SGRBG10 752x480]'
> >> >>     
> >> >>     # Test pattern
> >> >>     ./yavta --set-control '0x00981901 1' /dev/v4l-subdev8
> >> >>     
> >> >>     # ./yavta -p -f SGRBG10 -s 752x480 -n 4 --capture=3 /dev/video2
> >> >> 
> >> >> --file=img-#.bin
> >> >> 
> >> >> To convert to jpg I used bayer2rgb [2] program executing following
> >> >> command,
> >> >> 
> >> >>     $ convert -size 752x480  GRBG_BAYER:./img-000000.bin
> >> >>     img-000000.jpg
> >> >> 
> >> >> And the result image looks like this
> >> >> 
> >> >>     http://downloads.isee.biz/pub/files/patterns/img-from-sensor.jpg
> >> >> 
> >> >> Seems good, so I tried to use following pipeline Sensor -> CCDC ->
> >> >> Preview -> Resizer
> >> >> 
> >> >>     ./media-ctl -r
> >> >>     ./media-ctl -l '"mt9v032 3-005c":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 -V '"mt9v032 3-005c":0[SGRBG10 752x480]'
> >> >>     ./media-ctl -V  '"OMAP3 ISP CCDC":0 [SGRBG10 752x480]'
> >> >>     ./media-ctl -V  '"OMAP3 ISP CCDC":2 [SGRBG10 752x480]'
> >> >>     ./media-ctl -V  '"OMAP3 ISP preview":1 [UYVY 752x480]'
> >> >>     ./media-ctl -V  '"OMAP3 ISP resizer":1 [UYVY 752x480]'
> >> >>     
> >> >>     # Set Test pattern
> >> >>     
> >> >>     ./yavta --set-control '0x00981901 1' /dev/v4l-subdev8
> >> >>     
> >> >>     ./yavta -f UYVY -s 752x480 --capture=3 --file=img-#.uyvy
> >> >>     /dev/video6
> >> >> 
> >> >> I used 'convert' program to pass from UYVY to jpg,
> >> >> 
> >> >>     $ convert -size 752x480 img-000000.uyvy img-000000.jpg
> >> >> 
> >> >> and the result image looks like this
> >> >> 
> >> >>     http://downloads.isee.biz/pub/files/patterns/img-from-resizer.jpg
> >> >> 
> >> >> As you can see, the image is wrong and I'm not sure if the problem is
> >> >> from the sensor, from the previewer, from the resizer or from my
> >> >> conversion. Anyone have idea where should I look ? Or which is the
> >> >> source of the problem ?
> >> > 
> >> > Could you please post the output of all the above media-ctl and yavta
> >> > runs, as well as the captured raw binary frame ?
> >> 
> >> Of course,
> >> 
> >> The log configuring the pipeline Sensor -> CCDC is
> >> 
> >>     http://pastebin.com/WX8ex5x2
> >> 
> >> and the raw image can be found
> >> 
> >>     http://downloads.isee.biz/pub/files/patterns/img-000000.bin
> > 
> > It looks like D9 and D8 have trouble keeping their high-level. Possible
> > reasons would be conflicts on the signal lines (with something actively
> > driving them to a low-level, a pull-down wouldn't have such an effect),
> > faulty cable/solder joints (but I doubt that), or sampling the data on
> > the wrong edge.
> 
> In that case don't be the first image also wrong ? (the image that
> outputs from sensor /dev/video2)

Yes, it should be, and 
http://downloads.isee.biz/pub/files/patterns/img-000000.bin is corrupted. 
That's the image captured at the CCDC output, isn't it ?

>  http://downloads.isee.biz/pub/files/patterns/img-from-sensor.jpg

How did you capture that one ?

> I'll investigate a bit more following this line.
> 
> > The last option should be easy to test, just change the struct
> > isp_v4l2_subdevs_group::bus::parallel::clk_pol field.
> 
> I tested and seems this is not the problem.
> 
> >> And the log configuring the pipeline Sensor -> CCDC -> Previewer ->
> >> Resizer is http://pastebin.com/wh5ZJwne and the raw image can be found
> >> 
> >>     http://downloads.isee.biz/pub/files/patterns/img-000000.uyvy
> >> >> 
> >> >> [1]
> >> >> http://git.linuxtv.org/pinchartl/media.git/shortlog/refs/heads/
> >> >> omap3isp-omap3isp-next
> >> >> [2] https://github.com/jdthomas/bayer2rgb

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2012-09-25 10:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24  8:33 omap3isp: wrong image after resizer with mt9v034 sensor Enric Balletbò i Serra
2012-09-24 12:39 ` Laurent Pinchart
2012-09-24 13:49   ` Enric Balletbò i Serra
2012-09-25  0:43     ` Laurent Pinchart
2012-09-25  7:44       ` Enric Balletbò i Serra
2012-09-25 10:52         ` Laurent Pinchart [this message]
2012-09-25 11:23           ` Enric Balletbò i Serra
2012-09-25 11:31             ` Laurent Pinchart
2012-09-26  7:57               ` Enric Balletbò i Serra
2012-09-26  8:49                 ` Laurent Pinchart
2012-09-26 14:15                   ` Enric Balletbò i Serra
2012-09-27 11:19                     ` Laurent Pinchart
     [not found]                       ` <CAFqH_5245L5XqEGy=fpR8VNd9EHwUMZFO=p2NoLF4g4J3K0hCg@mail.gmail.com>
2012-09-27 23:32                         ` Laurent Pinchart
     [not found]                           ` <CAFqH_52g8nTTDQDJEzx9E9sC5GoQML7bV-hxjA8q4Q2TcDOTYg@mail.gmail.com>
     [not found]                             ` <1378805.eK71Lgs3H4@avalon>
2012-09-28 15:32                               ` Enric Balletbò i Serra
2012-10-01 10:25                                 ` Laurent Pinchart
2012-10-01 10:49                                   ` Enric Balletbò i Serra
2012-10-01 11:03                                     ` 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=2021377.tLq3KYvgLo@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=eballetbo@gmail.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;
as well as URLs for NNTP newsgroup(s).