Linux Media Controller development
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "Rafał Rzepecki" <divided.mind@gmail.com>
Cc: linux-media@vger.kernel.org, Jean-Francois Moine <moinejf@free.fr>
Subject: Re: Startup delay needed for a Sonix camera
Date: Thu, 29 Mar 2012 11:03:37 +0200	[thread overview]
Message-ID: <4F742569.5020503@redhat.com> (raw)
In-Reply-To: <CAJu-Zix22G3WbCCJ1h7P7+9naEU0XkYNDELTk9hCzMQ8UYB-gQ@mail.gmail.com>

Hi,

On 03/29/2012 08:27 AM, Rafał Rzepecki wrote:
> Hi,
>
> I've tried to reach Jean-Francois with this a week ago, but I still
> haven't received an answer, so I'm sending it to the mailing list. I'd
> appreciate a CC of any follow-ups.
>
> I've been having problems with my ID 0c45:6128 Microdia PC Camera
> (SN9C325 + OM6802) using driver gspca_sonixj. Specifically, launching
> command:
> $ gst-launch-0.10 v4l2src ! ffmpegcolorspace ! pngenc ! filesink \
> location=/tmp/file.png
> gave a file that is all black. This is problematic because at least
> one program (odeskteam) uses a similar method to grab camshots.
>
> I thought it looked like as though the camera hasn't got enough time
> to initialize, and indeed, adding an msleep(30) near the end of
> sd_start() in sonixj.c solved the problem.

The problem is that the above method to take a snapshot is simply
wrong. Many cameras need to be streaming video data for "a while"
before they give a (good) picture.

Many cameras need some time for things like auto-gain, auto-exposure,
auto-whitebalance and auto-focus to get to their correct setting for
a proper picture. A black picture probably means that the auto-gain/
auto-exposure for set camera still needs to jank up the gain and/or
exposure. and you're simply not giving it time for this.

My high quality HD video microsoft studio pro camera also starts
out with a close to black picture when I start streaming data from
it in anything but bright sunlight, and then corrects the picture
in 1-5 frames. This same camera takes like .5 seconds to gets it
auto focus settled so your snapshot example would likely result
in a too dark, unsharp picture. Note that this is all handled by
the camera itself, the UVC driver it uses has no control over this.

Why do you think digital compact (still photo) cameras take so much
time from you pressing the take picture button to actually taking the
picture? They are in essence doing the same. The only difference
with webcams is that people want more then 1 picture / second so
the camera cannot do all those corrections before sending a picture,
instead it does them while it is streaming data, meaning that the
first second or so of data can be quite useless.

Regards,

Hans

  parent reply	other threads:[~2012-03-29  9:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29  6:27 Startup delay needed for a Sonix camera Rafał Rzepecki
2012-03-29  7:16 ` Rafał Rzepecki
2012-03-29 10:06   ` Jean-Francois Moine
2012-03-29  9:03 ` Hans de Goede [this message]
2012-03-29  9:18   ` Rafał Rzepecki

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=4F742569.5020503@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=divided.mind@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=moinejf@free.fr \
    /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