linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* v4l2 ioctls
@ 2014-09-12  1:26 Shuah Khan
  2014-09-12  8:07 ` Hans Verkuil
  0 siblings, 1 reply; 9+ messages in thread
From: Shuah Khan @ 2014-09-12  1:26 UTC (permalink / raw)
  To: mauro Carvalho Chehab (m.chehab@samsung.com), hverkuil; +Cc: linux-media

Hi Mauro/Hans,

I am working on adding sharing construct to dvb-core and v4l2-core.
In the case of dvb I have clean start and stop points to acquire the
tuner and release it. Tuner is acquired from dvb_frontend_start() and
released from dvb_frontend_thread() when thread exits. This works very
well.

The problem with analog case is there are no clear entry and exit
points. Instead of changing ioctls, it will be cleaner to change
the main ioctl entry routine __video_do_ioctl(). Is there an easy
way to tell which ioctls are query only and which are set?

So far I changed the following to check check for tuner token
before they invoke v4l2_ioctl_ops:

v4l_g_tuner()
v4l_s_tuner()
v4l_s_modulator()
v4l_s_frequency()
v4l_s_hw_freq_seek()

This isn't enough looks like, since I see tuner_s_std() getting
invoked and cutting off the dvb stream. I am currently releasing
the tuner from v4l2_fh_exit(), but I don't think that is a good
idea since all these ioctls are independent control paths. Each
ioctl might have to acquire and release it at the end. More on
this below.

For example, xawtv makes several ioctls before it even touches the
tuner to set frequency and starting the stream. What I am looking
for is an ioctl that would signal the intent to hold the tuner.
Is that possible?

The question is can we identify a clean start and stop points
for analog case for tuner ownership??

Would it make sense to treat all these ioctls as independent and
make them acquire and release lock or hold the tuner in shared
mode? Shared doesn't really make sense to me since two user-space
analog apps can interfere with each other.

I am trying avoid changing tuner-core and if at all possible.

I can send the code I have now for review if you like. I have the
locking construct in a good state at the moment. dvb is in good
shape.

-- Shuah

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-09-16  0:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12  1:26 v4l2 ioctls Shuah Khan
2014-09-12  8:07 ` Hans Verkuil
2014-09-12 15:19   ` Mauro Carvalho Chehab
2014-09-13  0:37     ` Shuah Khan
2014-09-13  8:49       ` Hans Verkuil
2014-09-15 11:54       ` Mauro Carvalho Chehab
2014-09-15 23:15         ` Shuah Khan
2014-09-15 23:53           ` Mauro Carvalho Chehab
2014-09-16  0:23             ` Shuah Khan

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).