linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <shuahkh@osg.samsung.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Antti Palosaari <crope@iki.fi>,
	Mauro Carvalho Chehab <m.chehab@samsung.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	sakari.ailus@linux.intel.com, ramakrmu@cisco.com,
	Devin Heitmueller <dheitmueller@kernellabs.co>,
	olebowle@gmx.com, Andrew Morton <akpm@linux-foundation.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Shuah Khan <shuahkh@osg.samsung.com>
Subject: Re: [PATCH 2/5] media: v4l2-core changes to use media tuner token api
Date: Wed, 24 Sep 2014 09:57:49 -0600	[thread overview]
Message-ID: <5422E9FD.9050303@osg.samsung.com> (raw)
In-Reply-To: <5422B857.9020007@xs4all.nl>

On 09/24/2014 06:25 AM, Hans Verkuil wrote:
> Hi Shuah,
> 
> 
> Let's be realistic: if an application doesn't test for error codes,
> then that's the problem of the application. Also, EBUSY will only be
> returned if someone else is holding the tuner in a different mode.
> And that didn't work anyway (and probably in worse ways too if the
> driver would forcefully change the tuner mode).
> 
> So I really don't see a problem with this.
> 

I didn't have high hopes you would agree to the simpler approach. :)

>>
>> Compared to the current approach, holding lock in open and releasing
>> it in close is cleaner with predictable failure conditions. It is lot
>> easier to maintain. In addition, this approach keeps it same as the
>> dvb core token hold approach as outlined below.
> 
> Absolutely not an option for v4l2. You should always be able to open
> a v4l2 device, regardless of the tuner mode or any other mode.
> 
> The only exception is a radio tuner device: that should take the tuner
> on open. I think this is a very unfortunate design and I wish that that
> could be dropped.

Right this is another problem that needs to be addressed in the
user-space.

> 
> One thing that we haven't looked at at all is what should be done if
> the current input is not a tuner but a composite or S-Video input.
> 
> It is likely (I would have to test this to be sure) that you can capture
> from a DVB tuner and at the same time from an S-Video input without any
> problems. By taking the tuner token unconditionally this would become
> impossible. But doing this right will require more work.
> 
> BTW, what happens if the analog video part of a hybrid board doesn't have
> a tuner but only S-Video/Composite inputs? I think I've seen such boards
> actually. I would have to dig through my collection though.
> 

I would recommend trying to bound the problems that need to be solved
for the first phase of this media token feature. If we don't we will
never be done with it. :)

I would propose the first step as addressing dvb and v4l2 conflicts
and include snd-usb-audio so there is confidence that the media token
approach can span non-media drivers.

I am currently testing with tvtime, xawtv, vlc, and kaffeine. I am
planning to add kradio for snd-usb-audio work for the next round of
patches.

> 
> S_PRIORITY has nothing to do with tuner ownership. If there is a real need
> to release the token at another time than on close (and I don't see
> such a need), then make a new ioctl. Let's not overload S_PRIO with an
> unrelated action.

This is not an issue for fine grained approach since simpler approach
is nacked. i.e Mauro suggested changing S_PRIORITY as another place
to release it if we were to go with simple appraoch (open/close).

> 
>>
>> Devin recommended testing on devices that have an encoder to cover
>> the cases where there are multiple /dev/videoX nodes tied to the
>> same tuner.
> 
> Good examples are cx23885 (already vb2) and cx88 (the vb2 patches have
> been posted, but not yet merged). It shouldn't be too hard to find
> hardware based on those chipsets.
> 

Please see my bounding the problem comment. Can these devices wait until
the second phase. We have multiple combinations with hardware features,
applications. The way I am designing the media token is if driver
doesn't create the token, no change in the dvb-core, v4l2-core behavior.
It is not required that driver must create a token to allow evolving
driver support and hardware support as we go.

thanks,
-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

  reply	other threads:[~2014-09-24 15:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 15:00 [PATCH 0/5] media token resource framework Shuah Khan
2014-09-22 15:00 ` [PATCH 1/5] media: add media token device " Shuah Khan
2014-09-24 11:26   ` Hans Verkuil
2014-09-24 13:56     ` Shuah Khan
2014-09-22 15:00 ` [PATCH 2/5] media: v4l2-core changes to use media tuner token api Shuah Khan
     [not found]   ` <CAGoCfizUWx-RrRbtuv7ctTqZskmDPK-w9bRTnEwjwn6oJ=V48g@mail.gmail.com>
2014-09-22 20:43     ` Shuah Khan
2014-09-23 14:17       ` Devin Heitmueller
2014-09-23 20:46         ` Shuah Khan
2014-09-24 12:25           ` Hans Verkuil
2014-09-24 15:57             ` Shuah Khan [this message]
2014-09-25  7:15               ` Hans Verkuil
2014-10-06 12:29             ` Laurent Pinchart
2014-09-24 11:57   ` Hans Verkuil
2014-09-24 14:24     ` Shuah Khan
2014-09-24 15:30     ` Shuah Khan
2014-09-22 15:00 ` [PATCH 3/5] media: au0828-video " Shuah Khan
2014-09-22 15:00 ` [PATCH 4/5] media: dvb-core " Shuah Khan
2014-09-22 15:00 ` [PATCH 5/5] media: au0828-core changes to create and destroy media token res Shuah Khan

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=5422E9FD.9050303@osg.samsung.com \
    --to=shuahkh@osg.samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=crope@iki.fi \
    --cc=dheitmueller@kernellabs.co \
    --cc=dheitmueller@kernellabs.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=olebowle@gmx.com \
    --cc=ramakrmu@cisco.com \
    --cc=sakari.ailus@linux.intel.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;
as well as URLs for NNTP newsgroup(s).