From: Hans de Goede <hdegoede@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media <linux-media@vger.kernel.org>, workshop-2011@linuxtv.org
Subject: Re: [Workshop-2011] RFC: V4L2 API ambiguities
Date: Mon, 13 Aug 2012 16:58:27 +0200 [thread overview]
Message-ID: <50291613.1090101@redhat.com> (raw)
In-Reply-To: <201208131652.11182.hverkuil@xs4all.nl>
Hi,
On 08/13/2012 04:52 PM, Hans Verkuil wrote:
> On Mon August 13 2012 15:13:34 Hans de Goede wrote:
>> Hi,
>>
>> <snip>
>>
>>> 5) How to handle tuner ownership if both a video and radio node share the same
>>> tuner?
>>>
>>> Obvious rules:
>>>
>>> - Calling S_FREQ, S_TUNER, S_MODULATOR or S_HW_FREQ_SEEK will change owner
>>> or return EBUSY if streaming is in progress.
>>
>> That won't work, as there is no such thing as streaming from a radio node,
>
> There is, actually: read() for RDS data and alsa streaming (although that might
> be hard to detect in the case of USB audio).
>
>> I suggest we go with the simple approach we discussed at our last meeting in
>> your Dutch House: Calling S_FREQ, S_TUNER, S_MODULATOR or S_HW_FREQ_SEEK will
>> make an app the tuner-owner, and *closing* the device handle makes an app
>> release its tuner ownership. If an other app already is the tuner owner
>> -EBUSY is returned.
>
> So the ownership is associated with a filehandle?
Yes, that is how it works for videobuf streams too, right? The only difference
being that with videobuf streams there is an expilict way to release the ownership,
where as for tuner ownership there is none, so the ownership is released on device
close.
>
>>
>>> - Ditto for STREAMON, read/write and polling for read/write.
>>
>> No, streaming and tuning are 2 different things, if an app does both, it
>> will likely tune before streaming, but in some cases a user may use a streaming
>> only app together with say v4l2-ctl to do the actual tuning. I think keeping
>> things simple here is key. Lets just treat the "tuner" and "stream" as 2 separate
>> entities with a separate ownership.
>
> That would work provided the ownership is associated with a filehandle.
Right.
>
>>
>>> - Ditto for ioctls that expect a valid tuner configuration like QUERYSTD.
>>
>> QUERY is a read only ioctl, so it should not be influenced by any ownership, nor
>> imply ownership.
>
> It is definitely influenced by ownership, since if the tuner is in radio mode,
> then it can't detect a standard. Neither is this necessarily a passive call as
> some (mostly older) drivers need to switch the receiver to different modes in
> order to try and detect the current standard.
Hmm, then I guess that this call should fail with EBUSY if:
The tuner is owned by another app *and*
1) The tuner is in radio mode; or
2) The tuner is in tv mode *and* doing QUERYSTD requires "prodding" the device
<snip>
Regards,
Hans
next prev parent reply other threads:[~2012-08-13 14:57 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-13 12:27 RFC: V4L2 API ambiguities Hans Verkuil
2012-08-13 13:13 ` [Workshop-2011] " Hans de Goede
2012-08-13 14:52 ` Hans Verkuil
2012-08-13 14:58 ` Hans de Goede [this message]
2012-08-13 15:09 ` Ilyes Gouta
2012-08-13 19:15 ` Sylwester Nawrocki
2012-08-14 8:13 ` Hans de Goede
2012-08-14 0:00 ` Laurent Pinchart
2012-08-14 8:15 ` Hans de Goede
2012-08-13 16:09 ` Rémi Denis-Courmont
2012-08-13 20:27 ` Walter Van Eetvelt
2012-08-13 21:31 ` Devin Heitmueller
2012-08-13 21:39 ` Mauro Carvalho Chehab
2012-08-13 21:42 ` Devin Heitmueller
2012-08-13 21:55 ` Mauro Carvalho Chehab
2012-08-13 23:54 ` [Workshop-2011] " Laurent Pinchart
2012-08-14 10:54 ` Hans Verkuil
2012-08-14 11:06 ` Laurent Pinchart
2012-08-14 11:11 ` Hans Verkuil
2012-08-14 11:15 ` Laurent Pinchart
2012-08-14 11:32 ` Hans Verkuil
2012-08-14 11:42 ` Laurent Pinchart
2012-08-14 21:14 ` Guennadi Liakhovetski
2012-08-14 22:10 ` Laurent Pinchart
2012-08-14 12:43 ` Hans de Goede
2012-08-14 12:44 ` Chinmay V S
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=50291613.1090101@redhat.com \
--to=hdegoede@redhat.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=workshop-2011@linuxtv.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).