All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Tomasz Figa <tfiga@chromium.org>,
	mchehab@s-opensource.com, Hans Verkuil <hverkuil@xs4all.nl>,
	pali.rohar@gmail.com, sre@kernel.org,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [RFC, libv4l]: Make libv4l2 usable on devices with complex pipeline
Date: Wed, 6 Jun 2018 13:57:01 -0300	[thread overview]
Message-ID: <20180606135620.38668a3f@coco.lan> (raw)
In-Reply-To: <20180606100150.GA32299@amd>

Em Wed, 6 Jun 2018 12:01:50 +0200
Pavel Machek <pavel@ucw.cz> escreveu:

> Hi!
> 
> > > > Who would be calling this function?
> > > >
> > > > The scenario that I could think of is:
> > > > - legacy app would call open(/dev/video?), which would be handled by
> > > > libv4l open hook (v4l2_open()?),  
> > >
> > > I don't think that kind of legacy apps is in use any more. I'd prefer
> > > not to deal with them.  
> > 
> > In another thread ("[ANN v2] Complex Camera Workshop - Tokyo - Jun,
> > 19"), Mauro has mentioned a number of those:
> > 
> > "open source ones (Camorama, Cheese, Xawtv, Firefox, Chromium, ...) and closed
> > source ones (Skype, Chrome, ...)"  
> 
> Yep, ok. Still would prefer not to deal with them.

I guess we'll end by needing to handle them. Anyway, now that PCs are
starting to come with complex cameras[1], we'll need to address this
with a focus on adding support for existing apps.

[1] we had a report from one specific model but I heard from a reliable
source that there are already other devices with similar issues.

> (Opening additional fds behind application's back is quite nasty,
> those apps should really switch to v4l2_ variants).

Only closed source apps use the LD_PRELOAD hack. All the others
use v4l2_ variants, but, as Nicolas mentioned at the other
thread, there are a number of problems with the current approach.

Perhaps is time for us to not be limited to the current ABI, writing
a new API from scratch, and then adding a compatibility layer to be
used by apps that rely on v4l2_ variants, in order to avoid breaking
the ABI and keep providing LD_PRELOAD. We can then convert the apps
we use/care most to use the new ABI.

> 
> > > > - v4l2_open() would check if given /dev/video? figures in its list of
> > > > complex pipelines, for example by calling v4l2_open_complex() and
> > > > seeing if it succeeds,  
> > >
> > > I'd rather not have v4l2_open_complex() called on devices. We could
> > > test if argument is regular file and then call it... But again, that's
> > > next step.
> > >  
> > > > - if it succeeds, the resulting fd would represent the complex
> > > > pipeline, otherwise it would just open the requested node directly.  
> > 
> > What's the answer to my original question of who would be calling
> > v4l2_open_complex(), then?  
> 
> Application ready to deal with additional fds being
> opened. contrib/test/sdlcam will be the first one.
> 
> We may do some magic to do v4l2_open_complex() in v4l2_open(), but I
> believe that should be separate step.

In order to avoid breaking the ABI for existing apps, v4l2_open() should
internally call v4l2_open_complex() (or whatever we call it at the new
API design).

> > > >  - handling metadata CAPTURE and OUTPUT buffers controlling the 3A
> > > > feedback loop - this might be optional if all we need is just ability
> > > > to capture some frames, but required for getting good quality,
> > > >  - actually mapping legacy controls into the above metadata,  
> > >
> > > I'm not sure what 3A is. If you mean hardware histograms and friends,
> > > yes, it would be nice to support that, but, again, statistics can be
> > > computed in software.  
> > 
> > Auto-exposure, auto-white-balance, auto-focus. In complex camera
> > subsystems these need to be done in software. On most hardware
> > platforms, ISP provides necessary input data (statistics) and software
> > calculates required processing parameters.  
> 
> Ok, so... statistics support would be nice, but that is really
> separate problem.
> 
> v4l2 already contains auto-exposure and auto-white-balance. I have
> patches for auto-focus. But hardware statistics are not used.

Feel free to submit the auto-focus patches anytime. With all 3A
algos there (even on a non-optimal way using hw stats), it will
make easier for us when designing a solution that would work for
both IMAP3 and ISP (and likely be generic enough for other hardware).

For the full complex hardware solution, though, it is probably better
to fork v4l-utils into a separate project, in order to do the development
without affecting current users of it, merging it back only after we'll
be sure that existing apps will keep working with v4l2_foo() functions
and LD_PRELOAD.

Anyway, this is something that it makes sense to discuss during the
Complex Camera Workshop.

> > > Yes, we'll need something more advanced.
> > >
> > > But.. we also need something to run the devices today, so that kernel
> > > drivers can be tested and do not bitrot. That's why I'm doing this
> > > work.  
> > 
> > I guess the most important bit I missed then is what is the intended
> > use case for this. It seems to be related to my earlier, unanswered
> > question about who would be calliing v4l2_open_complex(), though.
> > 
> > What userspace applications would be used for this testing?  
> 
> Main use case is kernel testing.
> 
> Secondary use case is taking .jpg photos using sdlcam.

If a v4l2_complex_open() will, for now, be something that we don't
export publicly, using it only for the tools already at libv4l2,
I don't see much troubles on adding it, but I would hate to have to
stick with this ABI. Otherwise, we should analyze it after having
a bigger picture. So, better to wait for the Complex Camera
Workshop before adding this.

Btw, would you be able to join us there (either locally or
remotely via Google Hangouts)?
 
> Test apps such as qv4l2 would be nice to have, and maybe I'll
> experiment with capturing video somehow one day. I'm pretty sure it
> will not be easy.

Capture video is a must have for PCs. The final solution should
take it into account.

> 
> Oh and I guess a link to how well it works? See
> https://www.youtube.com/watch?v=fH6zuK2OOVU .
> 
> Best regards,
> 								Pavel

Thanks,
Mauro

  reply	other threads:[~2018-06-06 16:57 UTC|newest]

Thread overview: 152+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 12:20 [PATCH v3 0/2] v4l: Add camera voice coil lens control class, current control Sakari Ailus
2017-02-14 12:20 ` [PATCH v3 1/2] " Sakari Ailus
2017-02-14 22:47   ` Pavel Machek
2017-02-15  7:15     ` Sakari Ailus
2017-02-15  8:09       ` Pavel Machek
2017-02-20 22:26         ` Sakari Ailus
2017-02-20 22:48           ` Pavel Machek
2017-04-15  2:23   ` Mauro Carvalho Chehab
2017-04-15  7:12     ` Pavel Machek
2017-04-16  9:12     ` Sakari Ailus
2017-04-19 13:51       ` Mauro Carvalho Chehab
2017-04-24  9:30         ` support autofocus / autogain in libv4l2 Pavel Machek
2017-04-24 13:38           ` Mauro Carvalho Chehab
2017-04-24 13:38             ` Mauro Carvalho Chehab
2017-04-24 21:29             ` Pavel Machek
2017-04-24 21:29               ` Pavel Machek
2017-04-25  1:47               ` Mauro Carvalho Chehab
2017-04-25  1:47                 ` Mauro Carvalho Chehab
2017-04-25  8:05                 ` Pavel Machek
2017-04-25  8:05                   ` Pavel Machek
2017-04-25  8:08                   ` Pali Rohár
2017-04-25  8:08                     ` Pali Rohár
2017-04-25  8:08                     ` Pali Rohár
2017-04-25 11:23                     ` Pavel Machek
2017-04-25 11:23                       ` Pavel Machek
2017-04-25 11:30                       ` Pali Rohár
2017-04-25 11:30                         ` Pali Rohár
2017-04-25 12:28                         ` Pavel Machek
2017-04-25 12:28                           ` Pavel Machek
2017-04-25 12:51                           ` Pali Rohár
2017-04-25 12:51                             ` Pali Rohár
2017-04-25 16:55                         ` Nicolas Dufresne
2017-04-25 16:55                           ` Nicolas Dufresne
2017-04-25 16:51                     ` Nicolas Dufresne
2017-04-25 16:51                       ` Nicolas Dufresne
2017-04-25 16:53                   ` Nicolas Dufresne
2017-04-25 16:53                     ` Nicolas Dufresne
2017-04-25 16:53                     ` Nicolas Dufresne
2017-04-26 10:53                     ` Pavel Machek
2017-04-26 10:53                       ` Pavel Machek
2017-04-26 10:53                 ` [patch] propagating controls in libv4l2 was " Pavel Machek
2017-04-26 10:53                   ` Pavel Machek
2017-04-26 11:13                   ` Mauro Carvalho Chehab
2017-04-26 11:13                     ` Mauro Carvalho Chehab
2017-04-26 13:23                     ` [patch] autogain support for bayer10 format (was Re: [patch] propagating controls in libv4l2) Pavel Machek
2017-04-26 13:23                       ` Pavel Machek
2017-04-26 15:43                       ` Ivaylo Dimitrov
2017-04-26 15:43                         ` Ivaylo Dimitrov
2017-04-26 22:51                         ` Pavel Machek
2017-04-26 22:51                           ` Pavel Machek
2017-04-26 22:51                           ` Pavel Machek
2017-04-27  5:52                           ` Ivaylo Dimitrov
2017-04-27  5:52                             ` Ivaylo Dimitrov
2017-07-13  7:57                             ` Pavel Machek
2017-07-13  7:57                               ` Pavel Machek
2017-05-03 19:05                         ` Russell King - ARM Linux
2017-05-03 19:05                           ` Russell King - ARM Linux
2017-05-03 19:58                           ` Pavel Machek
2017-05-03 19:58                             ` Pavel Machek
2017-05-08 22:28                         ` [patch, libv4l]: fix integer overflow Pavel Machek
2017-05-09  6:29                           ` Hans Verkuil
2017-05-09  6:32                             ` Hans Verkuil
2017-05-09  8:02                               ` Pavel Machek
2017-05-09 10:59                             ` [patch, libv4l]: fix typos Pavel Machek
2017-05-09 11:01                             ` [patch, libv4l]: Add support for GRBG10 format conversion Pavel Machek
2017-05-09 11:04                             ` [patch, libv4l]: Introduce define for lookup table size Pavel Machek
2017-05-16 11:17                               ` Hans Verkuil
2017-05-16 12:45                                 ` Pavel Machek
2017-05-16 12:56                                   ` Hans Verkuil
2017-05-16 23:23                                     ` Pavel Machek
2017-05-19  9:13                                     ` [libv4l]: How to do 10-bit support? Stand-alone conversions? Pavel Machek
2018-03-16 20:55                                     ` [RFC, libv4l]: Make libv4l2 usable on devices with complex pipeline Pavel Machek
2018-03-19  9:47                                       ` Hans Verkuil
2018-03-19 10:23                                         ` Pavel Machek
2018-03-19 10:47                                           ` Mauro Carvalho Chehab
2018-03-19 11:11                                             ` Hans Verkuil
2018-03-19 12:00                                               ` Pavel Machek
2018-03-19 12:15                                                 ` Hans Verkuil
2018-03-19 12:48                                                   ` Pavel Machek
2018-03-19 13:29                                                     ` Hans Verkuil
2018-03-19 22:18                                                       ` Pavel Machek
2018-03-19 13:45                                                     ` Mauro Carvalho Chehab
2018-03-19 13:26                                                   ` Mauro Carvalho Chehab
2018-03-20  7:50                                                     ` Pavel Machek
2018-05-15 20:01                                                     ` Pavel Machek
2018-05-15 22:03                                                       ` Mauro Carvalho Chehab
2018-05-16 20:53                                                         ` Pavel Machek
2018-06-02 21:01                                                         ` Pavel Machek
2018-06-06  6:18                                                           ` Tomasz Figa
2018-06-06  8:46                                                             ` Pavel Machek
2018-06-06  8:53                                                               ` Tomasz Figa
2018-06-06 10:01                                                                 ` Pavel Machek
2018-06-06 16:57                                                                   ` Mauro Carvalho Chehab [this message]
2018-06-06 21:27                                                                     ` Pavel Machek
2018-06-07 12:22                                                                     ` [PATCH, " Pavel Machek
2018-06-06 10:51                                                                 ` [RFC, " Pavel Machek
2018-06-06 11:16                                                                   ` Tomasz Figa
2018-06-06 20:37                                                                     ` Pavel Machek
2018-06-06 17:13                                                                   ` Mauro Carvalho Chehab
2018-06-06 10:23                                                             ` Pavel Machek
2018-06-07  7:25                                                             ` Pavel Machek
2017-05-09 11:10                             ` [patch, libv4l]: fix integer overflow Pavel Machek
2017-05-16 10:42                             ` Pavel Machek
2017-05-21 10:33                             ` [patch, libv4l]: add sdlcam example for testing digital still camera functionality Pavel Machek
2017-05-26 20:41                               ` Pavel Machek
2017-05-27  9:27                                 ` Hans Verkuil
2017-05-29  6:13                               ` Hans Verkuil
2017-05-29  7:32                                 ` Pavel Machek
2017-05-29  8:02                                   ` Hans Verkuil
2017-06-14 11:16                                     ` Sakari Ailus
2017-06-14 20:41                                       ` Pavel Machek
2017-07-13  8:36                                       ` Pavel Machek
2017-05-09  8:07                           ` [patch, libv4l]: fix integer overflow Pavel Machek
2017-04-30 22:48                       ` [patch] autogain support for bayer10 format (was Re: [patch] propagating controls in libv4l2) Pavel Machek
2017-04-30 22:48                         ` Pavel Machek
2017-07-13  9:49                     ` [patch] propagating controls in libv4l2 was Re: support autofocus / autogain in libv4l2 Pavel Machek
2017-07-13  9:49                       ` Pavel Machek
2017-04-26 11:26                   ` Mauro Carvalho Chehab
2017-04-26 11:26                     ` Mauro Carvalho Chehab
2017-04-29  9:19                     ` Pavel Machek
2017-04-29  9:19                       ` Pavel Machek
2017-10-21 22:00                     ` Camera support, Prague next week, sdlcam Pavel Machek
2017-10-22  7:36                       ` Hans Verkuil
2017-10-22  7:36                         ` Hans Verkuil
2017-10-22  8:31                         ` Pavel Machek
2017-10-22  8:31                           ` Pavel Machek
2017-10-23 18:54                         ` Pavel Machek
2017-10-23 18:54                           ` Pavel Machek
2017-10-23 19:24                           ` Hans Verkuil
2017-10-23 19:24                             ` Hans Verkuil
2017-10-23 20:15                             ` Sakari Ailus
2017-10-23 20:15                               ` Sakari Ailus
2017-10-23 21:02                               ` Mauro Carvalho Chehab
2017-10-23 21:02                                 ` Mauro Carvalho Chehab
2017-10-31 21:28                               ` Nokia N9: fun with camera Pavel Machek
2017-11-01  6:36                                 ` Pavel Machek
2017-11-01  6:36                                   ` Pavel Machek
2017-11-01 15:32                                   ` Pavel Machek
2017-11-01 15:32                                     ` Pavel Machek
2017-04-24 22:07             ` support autofocus / autogain in libv4l2 Pavel Machek
2017-04-24 22:07               ` Pavel Machek
2017-04-25  1:57               ` Mauro Carvalho Chehab
2017-04-25  1:57                 ` Mauro Carvalho Chehab
2017-04-25  8:20                 ` Pavel Machek
2017-04-25  8:20                   ` Pavel Machek
2017-04-25 11:23                 ` Pavel Machek
2017-04-25 11:23                   ` Pavel Machek
2017-04-28 22:00         ` [PATCH v3 1/2] v4l: Add camera voice coil lens control class, current control Pavel Machek
2017-04-29  1:46           ` Mauro Carvalho Chehab
2017-05-12 10:49         ` Sakari Ailus
2017-05-13 11:08           ` Pavel Machek
2017-02-14 12:20 ` [PATCH v3 2/2] ad5820: Use VOICE_COIL_CURRENT control Sakari Ailus

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=20180606135620.38668a3f@coco.lan \
    --to=mchehab+samsung@kernel.org \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=pali.rohar@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sre@kernel.org \
    --cc=tfiga@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.