Re: Coordinating concurrent users of v4l2 devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Tom Zoerner <tomzo@xxxxxxxxxx> writes:

> Basically I proposed to add an ioctl that defines begin and end of a
> critical section:  The begin operation only succeeds if the caller is
> the only user of the device. Any ioctl (except the crit.sect. control)
> between begin and end will fail with EBUSY as soon as another user opens
> the device.  The caller can then end the critical section and try again
> later.  Would that be hard to implement in the driver?

i.e. something which does kind of "fcntl(fd, F_SETFL, oldflags | O_EXCL)"?
This is illegal according to the manual page, but you get the idea ...

Should be easy to do, as long as this applies to _all_ ioctls.  If so
this can easily be catched at the top of the ioctl handler with just a
few lines of code.  There is a difference to the open(O_EXCL) way: It
will not affect other users, i.e. setting some exclusive flag via
ioctl can make sure that _your_ app can do ioctls only if it is the
only user of the device, but it wouldn't lock out _other_ users of the
device.  For nxtvepg it should work through I think.

But it might have some intresting side effects.  Not as long as you
capture via read(), but if it is done via streaming capture (which
needs ioctls).  Switching to exclusive mode temporarely for tuning
affects the vbi capture thread too ...

  Gerd

-- 
Weil die späten Diskussionen nicht mal mehr den Rotwein lohnen.
				-- Wacholder in "Melanie"





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux