mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: "Németh Márton" <nm127@freemail.hu>,
	"Jean-Francois Moine" <moinejf@free.fr>,
	"Thomas Kaiser" <thomas@kaiser-linux.li>,
	linux-media@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RESEND][PATCH 1/2] v4l2: modify the webcam video standard handling
Date: Mon, 31 Aug 2009 10:03:32 -0300	[thread overview]
Message-ID: <20090831100332.2176c7c4@pedra.chehab.org> (raw)
In-Reply-To: <200908310858.24763.laurent.pinchart@ideasonboard.com>

Em Mon, 31 Aug 2009 08:58:24 +0200
Laurent Pinchart <laurent.pinchart@ideasonboard.com> escreveu:

> Hi Mauro,
> 
> On Monday 31 August 2009 04:41:14 Mauro Carvalho Chehab wrote:
> > Hi Németh,
> >
> > Em Sun, 23 Aug 2009 11:30:42 +0200
> >
> > Németh Márton <nm127@freemail.hu> escreveu:
> > > From: Márton Németh <nm127@freemail.hu>
> > >
> > > Change the handling of the case when vdev->tvnorms == 0.
> >
> > This patch (together with a few others related to tvnorms and camera
> > drivers) reopens an old discussion: should webcams report a tvnorm?
> >
> > There's no easy answer for it since:
> >
> > 1) removing support for VIDIOC_G_STD/VIDIOC_S_STD causes regressions, since
> > some userspace apps stops working;
> 
> Then those applications don't work with the uvcvideo driver in the first 
> place. This is getting less and less common :-)

Good to know. Yet, removing VIDIOC_[GS]_STD will break a behavior used on
webcams for a long time. One thing is to accept new webcam drivers without it.
This can be done (and were already done, when we accepted uvc). A separate
issue is to change the behavior of the userspace API on existing drivers.

> > 2) It is a common scenario to use cameras connected to some capture only
> > devices like several bttv boards used on surveillance systems. Those
> > drivers report STD, since they are used also on TV;
> >
> > 3) There are even some devices that allows cameras to be connected to one
> > input and TV on another input. This is another case were the driver will
> > report a TV std;
> 
> TV standards are ill-named, they are actually analog standards. 
> VIDIOC_[GS]_STD are perfectly valid for capture devices with analog inputs, 
> even if they don't use a TV tuner.

It is not that simple. In general, at the bridge chip, all inputs are digital.
The analog to digital conversion is done by a separate chip on most devices,
and there are some boards where you have, for example, digital sensors
connected to it.

> > 4) Most webcam formats are based on ITU-T formats designed to be compatible
> > with TV (formats like CIF and like 640x480 - and their
> > multiple/sub-multiples);
> 
> Even HD formats still have roots in the analog TV world. It's a real mess. 
> Nonetheless, even if the actual frame size is compatible with TV, there is 
> simply no concept of PAL/NTSC for webcams.

Ok, but still it is possible to use V4L2_STD_525_60 and V4L2_STD_625_50 when all
you need is to set the number of lines and the basis of the sampling rate.
There is also V4L2_STD_UNKNOWN standard used on some drivers.

> > 5) There are formats that weren't originated from TV on some digital
> > webcams, so, for those formats, it makes no sense to report an existing
> > std.
> >
> > Once people proposed to create an special format for those cases
> > (V4L2_STD_DIGITAL or something like that), but, after lots of discussions,
> > no changes were done at API nor at the drivers.
> 
> TV standards only apply to analog video. Let's simply not use it for digital 
> video. We don't expect drivers to implement VIDIOC_[GS]_JPEGCOMP with fake 
> values when they don't support JPEG compression, so we should not expect them 
> to implement VIDIOC_[GS]_STD when they don't support analog TV.

If you look at the tree, several drivers that returns compressed formats
implements those ioctls. This is even required on several cases, where you may
have an analog TV connected on it.

That's said, I understand your arguments that implementing [G/S]_STD is
senseless on almost all camera drivers, since it won't actually control
anything. So, IMO, a good compromise is to keep the existing implementation on
the legacy drivers [1], but think twice before implementing
it on a new driver.

[1] We could eventually drop it even for the existing drivers, provided that the
ioctl won't control anything at the device and that we properly document it in
Documentation/feature-removal-schedule.txt, giving enough time for the remaining
userspace apps and distros to change to the new behavior.

> > While we don't have an agreement on this, I don't think we should apply a
> > patch like this.



Cheers,
Mauro

      parent reply	other threads:[~2009-08-31 13:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07  6:17 [PATCH " Németh Márton
2009-08-23  9:30 ` [RESEND][PATCH " Németh Márton
2009-08-31  2:41   ` Mauro Carvalho Chehab
2009-08-31  5:55     ` Németh Márton
2009-08-31  6:58     ` Laurent Pinchart
2009-08-31  7:33       ` Hans Verkuil
2009-08-31 13:08         ` Mauro Carvalho Chehab
2009-08-31 14:44           ` Hans Verkuil
2009-08-31 13:03       ` Mauro Carvalho Chehab [this message]

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=20090831100332.2176c7c4@pedra.chehab.org \
    --to=mchehab@infradead.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=moinejf@free.fr \
    --cc=nm127@freemail.hu \
    --cc=thomas@kaiser-linux.li \
    /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

all inboxes | Powered by JetHome®