public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@nokia.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	Nayden Kanchev <nkanchev@mm-sol.com>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Cohen David Abraham <david.cohen@nokia.com>
Subject: Re: [RFC] V4L2 API for flash devices
Date: Tue, 05 Apr 2011 16:35:50 +0300	[thread overview]
Message-ID: <4D9B1AB6.8010202@nokia.com> (raw)
In-Reply-To: <201104051328.34774.laurent.pinchart@ideasonboard.com>

Laurent Pinchart wrote:
> Hi Sakari,

Hi,

> On Tuesday 05 April 2011 13:21:03 Sakari Ailus wrote:
>> Laurent Pinchart wrote:
>>> On Tuesday 05 April 2011 12:23:51 Sakari Ailus wrote:
>>>> Sakari Ailus wrote:
>>>>> Laurent Pinchart wrote:
>>>>>> On Wednesday 30 March 2011 13:05:54 Sakari Ailus wrote:
>>>>>>> Laurent Pinchart wrote:
>>>>>>>> On Monday 28 March 2011 14:55:40 Sakari Ailus wrote:
>>>>>>>>
>>>>>>>> [snip]
>>>>>>>>
>>>>>>>>> 	V4L2_CID_FLASH_STROBE_MODE (menu; LED)
>>>>>>>>>
>>>>>>>>> Use hardware or software strobe. If hardware strobe is selected,
>>>>>>>>> the flash controller is a slave in the system where the sensor
>>>>>>>>> produces the strobe signal to the flash.
>>>>>>>>>
>>>>>>>>> In this case the flash controller setup is limited to programming
>>>>>>>>> strobe timeout and power (LED flash) and the sensor controls the
>>>>>>>>> timing and length of the strobe.
>>>>>>>>>
>>>>>>>>> enum v4l2_flash_strobe_mode {
>>>>>>>>>
>>>>>>>>> 	V4L2_FLASH_STROBE_MODE_SOFTWARE,
>>>>>>>>> 	V4L2_FLASH_STROBE_MODE_EXT_STROBE,
>>>>>>>>>
>>>>>>>>> };
>>>>>>>>
>>>>>>>> [snip]
>>>>>>>>
>>>>>>>>> 	V4L2_CID_FLASH_LED_MODE (menu; LED)
>>>>>>>>>
>>>>>>>>> enum v4l2_flash_led_mode {
>>>>>>>>>
>>>>>>>>> 	V4L2_FLASH_LED_MODE_FLASH = 1,
>>>>>>>>> 	V4L2_FLASH_LED_MODE_TORCH,
>>>>>>>>>
>>>>>>>>> };
>>>>>>>>
>>>>>>>> Thinking about this some more, shouldn't we combine the two controls
>>>>>>>> ? They are basically used to configure how the flash LED is
>>>>>>>> controlled: manually (torch mode), automatically by the flash
>>>>>>>> controller (software strobe mode) or automatically by an external
>>>>>>>> component (external strobe mode).
>>>>>>>
>>>>>>> That's a good question.
>>>>>>>
>>>>>>> The adp1653 supports also additional control (not implemented in the
>>>>>>> driver, though) that affect hardware strobe length. Based on register
>>>>>>> setting, the led will be on after strobe either until the timeout
>>>>>>> expires, or until the strobe signal is high.
>>>>>>>
>>>>>>> Should this be also part of the same control, or a different one?
>>>>>>
>>>>>> That can be controlled by a duration control. If the duration is 0,
>>>>>> the flash is lit for the duration of the external strobe, otherwise
>>>>>> it's lit for the programmed duration.
>>>>>
>>>>> Sounds good to me.
>>>>
>>>> Thinking about this again; there won't be a separate duration control
>>>
>>> Why not ? I think we need two timeouts, a watchdog timeout to prevent
>>> flash fire or meltdown, and a normal timeout to lit the flash for a
>>> user-selected duration.
>>
>> Let's assume that an application wants to expose a frame using flash
>> with software strobe.
>>
>> 1. strobe flash
>> 2. qbuf
>> 3. streamon
>> 4. dqbuf
>> 5. streamoff
>> 6. ...
>>
>> How does an application know how long is the time between 1 -- 4? I'd
>> guess that in 6 the application would like to switch off the flash
>> instead of specifying a timeout for it.
> 
> That's a valid use case, and we need to support it. It requires a way to lit 
> the flash with no timeout other than the watchdog timeout, and a way to turn 
> it off.
> 
> However, I'm not sure we should rule out the usefulness of a duration-based 
> software flash strobe. Can't the two APIs coexist ? Or do you think a 
> duration-based API is useless ?

I don't want to rule it out, but I don't see use for it either for the
time being and thus don't see a reason to specify an API for it. The
adp1653 driver does not implement a software based shutdown timeout and
I'm not aware of others implementing it either. It was just an idea to
overcome the coarse hardware watchdog timeout.

If there is use for it then I think we could bring up the question
again: use V4L2_CID_FLASH_TIMEOUT or create V4L2_CID_FLASH_DURATION for it.

What do you think?

-- 
Sakari Ailus
sakari.ailus@maxwell.research.nokia.com

  reply	other threads:[~2011-04-05 13:36 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 12:55 [RFC] V4L2 API for flash devices Sakari Ailus
2011-03-29  6:49 ` Hans Verkuil
2011-03-29  9:35   ` Sakari Ailus
2011-03-29  9:54     ` Hans Verkuil
2011-03-29 11:38       ` Sakari Ailus
2011-03-29 11:51         ` Sakari Ailus
2011-03-30  8:47           ` Laurent Pinchart
2011-04-05 10:00             ` Sakari Ailus
2011-05-02 16:04               ` Sakari Ailus
2011-05-02 19:13                 ` Hans Verkuil
2011-05-02 19:32                   ` Laurent Pinchart
2011-05-02 20:07                     ` Hans Verkuil
2011-03-30  8:55     ` Laurent Pinchart
2011-03-30 12:44       ` Sakari Ailus
2011-03-30 13:53         ` Laurent Pinchart
2011-03-30 14:18           ` Sakari Ailus
2011-03-30 14:57             ` David Cohen
2011-03-30 15:00               ` Laurent Pinchart
2011-03-31  8:09                 ` Sakari Ailus
2011-03-29 10:43 ` Kim, HeungJun
2011-03-29 14:41   ` Sakari Ailus
2011-03-30  5:06     ` Kim, HeungJun
2011-03-30 11:37       ` Sakari Ailus
2011-03-30 20:37         ` Kim HeungJun
2011-03-31  8:50           ` Sakari Ailus
2011-03-30  9:34 ` Laurent Pinchart
2011-03-30 11:05   ` Sakari Ailus
2011-03-30 13:54     ` Laurent Pinchart
2011-03-31  8:17       ` Sakari Ailus
2011-04-05 10:23         ` Sakari Ailus
2011-04-05 10:39           ` Laurent Pinchart
2011-04-05 11:21             ` Sakari Ailus
2011-04-05 11:28               ` Laurent Pinchart
2011-04-05 13:35                 ` Sakari Ailus [this message]
     [not found]                   ` <4D9B303D.1000003@mm-sol.com>
2011-04-05 16:25                     ` Laurent Pinchart
2011-04-05 12:11 ` David Cohen
2011-04-06  8:04   ` Sakari Ailus
2011-04-12 19:31 ` Sung Hee Park
     [not found] ` <BANLkTik+xqCD7uiGUchsehoUy+gwM+Cjdg@mail.gmail.com>
2011-04-13 12:16   ` Sakari Ailus
2011-04-14 19:38     ` Laurent Pinchart
2011-04-15  5:27       ` 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=4D9B1AB6.8010202@nokia.com \
    --to=sakari.ailus@nokia.com \
    --cc=david.cohen@nokia.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=nkanchev@mm-sol.com \
    /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