From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: subash.rp@gmail.com
Cc: Pawel Osciak <pawel@osciak.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: [Query] VIDIOC_QBUF and VIDIOC_STREAMON order
Date: Tue, 15 Mar 2011 11:52:49 +0100 [thread overview]
Message-ID: <4D7F4501.2010009@samsung.com> (raw)
In-Reply-To: <AANLkTikBkPjy4jui1EjGULPFbUZxKK_ydaUqk7niFDxQ@mail.gmail.com>
Hi Subash,
thanks for your comments.
On 03/14/2011 11:44 AM, Subash Patel wrote:
> VIDIOC_STREAMON expects buffers to be queued before hardware part of
> image/video pipe is enabled. From my experience of V4L2 user space, I have
> always QBUFfed before invoking the STREAMON. Below is the API specification
> which also speaks something same:
>
> http://linuxtv.org/downloads/v4l-dvb-apis/vidioc-streamon.html
>
It seems pretty reasonable thing to do in the application, i.e. queue buffer(s)
first. If the device needs buffers to work what STREAMON before QBUF would be
supposed to mean? The application must be aware then that real start of data flow
in the hardware pipeline is being done at the first QBUF. This is not obvious at
all from the current specification.
> I think its better to return EINVAL if there are no queued buffers
> when VIDIOC_STREAMON is invoked.
Unfortunately, as Pawel pointed out the are are some further logic implications
of such approach. Anyway we can handle both QBUF, STREAMON orders in the kernel,
it just makes life a bit harder.
Adhering exactly to current videobuf2 rules it is not possible to return EINVAL
if there is no buffers QBUFed when invoking STREAMON. And we are going to need
to be able to return an error in buf_queue which could be then propagated up
to the STREAMON caller. This has already been raised in
"[RFC/PATCH 1/2] v4l: videobuf2: Handle buf_queue errors" from Laurent.
Regards,
Sylwester
>
> Regards,
> Subash
>
> On Mon, Mar 14, 2011 at 3:44 PM, Sylwester Nawrocki <s.nawrocki@samsung.com
> <mailto:s.nawrocki@samsung.com>> wrote:
>
> Hello,
>
> As far as I know V4L2 applications are allowed to call VIDIOC_STREAMON before
> queuing buffers with VIDIOC_QBUF.
>
> This leads to situation that a H/W is attempted to be enabled by the driver
> when it has no any buffer ownership.
>
> Effectively actual activation of the data pipeline has to be deferred
> until first buffer arrived in the driver. Which makes it difficult
> to signal any errors to user during enabling the data pipeline.
>
> Is this allowed to force applications to queue some buffers before calling
> STREAMON, by returning an error in vidioc_streamon from the driver, when
> no buffers have been queued at this time?
>
> I suppose this could render some applications to stop working if this kind
> of restriction is applied e.g. in camera capture driver.
>
> What the applications really expect?
>
> With the above I refer mostly to a snapshot mode where we have to be careful
> not to lose any frame, as there could be only one..
>
>
> Please share you opinions.
prev parent reply other threads:[~2011-03-15 10:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-14 10:14 [Query] VIDIOC_QBUF and VIDIOC_STREAMON order Sylwester Nawrocki
2011-03-14 10:49 ` Subash Patel
2011-03-15 3:21 ` Pawel Osciak
2011-03-15 4:26 ` Subash Patel
2011-03-15 7:50 ` Hans Verkuil
2011-03-22 10:53 ` Laurent Pinchart
2011-03-22 23:58 ` Jonghun Han
[not found] ` <AANLkTikBkPjy4jui1EjGULPFbUZxKK_ydaUqk7niFDxQ@mail.gmail.com>
2011-03-15 10:52 ` Sylwester Nawrocki [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=4D7F4501.2010009@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=pawel@osciak.com \
--cc=subash.rp@gmail.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