All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Kilgore <kilgota@banach.math.auburn.edu>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Adam Baker <linux@baker-net.org.uk>,
	Jean-Francois Moine <moinejf@free.fr>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	linux-usb@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>
Subject: Re: [Workshop-2011] Media Subsystem Workshop 2011
Date: Mon, 8 Aug 2011 14:58:40 -0500 (CDT)	[thread overview]
Message-ID: <alpine.LNX.2.00.1108081435340.21636@banach.math.auburn.edu> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1108081411460.1944-100000@iolanthe.rowland.org>



On Mon, 8 Aug 2011, Alan Stern wrote:

> On Mon, 8 Aug 2011, Theodore Kilgore wrote:
> 
> > On Mon, 8 Aug 2011, Alan Stern wrote:
> > 
> > > On Sun, 7 Aug 2011, Theodore Kilgore wrote:
> > > 
> > > > This indirectly answers my question, above, about whatever device there 
> > > > may or may not be. What I get from this, and also from a bit of snooping 
> > > > around, is that there is not any dev that gets created in order to be 
> > > > accessed by libusb. Just an entry under /proc/bus/usb, which AFAICT is at 
> > > > most a pseudo-device. Thanks.
> > > 
> > > Nowadays, most distributions create device nodes under /dev/bus/usb.  A 
> > > few also support the old /proc/bus/usb files.
> > 
> > What does this mean, exactly, in practice? You are right that I have the 
> > /dev/bus/usb/ files but does everybody have them, these days?
> 
> Pretty much everybody using udev should have them, which means pretty 
> much every desktop system.

OK, so far so good.

> 
> ...
> 
> > > Maybe a good compromise would be to create a kind of stub driver that
> > > could negotiate the device access while still delegating most of the
> > > real work to userspace.
> > 
> > Hooray. This appears to me to be a very good solution.
> 
> I'm not so sure.  It would require vast changes to the userspace
> program, for example.

Such as?

> 
> > I agree approximately 120% with this. Let's think of a more clever way. If 
> > we get the basic idea right, it really ought not to be too terribly 
> > difficult.
> 
> The method Hans suggested was rather clunky.  

If it involves moving practically all of the gory details of the support 
of stillcam mode for individual dual-mode cameras into the kernel, then it 
certainly appears clunky to me, too. 

It also required drivers
> to know when the device was in use, which may be okay for a video
> driver but is not so practical for usb-storage (although to be fair, I
> suspect usb-storage wouldn't need to be involved).  

Yes, I can see that. Usb-storage is, essentially, "in use" while the 
device is attached, and that has to be true because the device is a 
storage device. And alas, not all storage devices even get mounted, so one 
cannot decide whether the device is "in use" just by checking whether or 
not something on it is mounted ...

And it required
> kernel drivers to inform user programs somehow when they want to get
> control of the device back, 

Why, exactly? I mean, fundamentally we have two functionalities of the 
device which are accessed, at the user level, by two userspace programs. 
One of them gets the still photos off the camera, and the other one gets 
the video stream. Perhaps we just need a method for saying "No!" to either 
one of those apps if the other one is using the camera?

> which is not the sort of thing drivers
> normally have to do.
> 
> Even if we could come up with a way to let the video driver somehow 
> "share" ownership of the device with usbfs, we'd still have to set up a 
> protocol for deciding who was in charge at any given time.  Would it be 
> okay for the userspace program simply to say "I want control now" and 
> "I'm done, you can have control back"?

Actually, I would expect that if one program is accessing the device then 
the other one can't, and this works the same in both directions. Unless 
you think that what you described is better?

> 
> For that matter, what should the video driver do if the user program 
> crashes or hangs while in charge of the device?

Good one. Commit seppuku?

Seriously, though, what should it do if a video streaming userspace 
program crashes or hangs? Probably, the same thing should happen as it 
should if a photo-getting program crashes or hangs. Namely whatever needs 
to be done in order to prevent some kind of catastrophe ought to be 
implemented.

Incidentally, I think that in some respects the fact that webcam support 
is in the kernel and stillcam support is in userspace is a red herring. 
The fundamental problem is a piece of hardware which does two different 
kinds of things which require two different kinds of support. Further to 
narrow this, though, it is hardware which needs to be usable for either 
function at any time, which does distinguish it from such things as a 
one-shot loading of firmware as happens with mass storage USB modems.

Theodore Kilgore

  reply	other threads:[~2011-08-08 19:53 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 17:21 Media Subsystem Workshop 2011 Mauro Carvalho Chehab
2011-08-03 17:45 ` Mauro Carvalho Chehab
2011-08-08  6:22   ` Hans Verkuil
2011-08-08 13:25     ` Mauro Carvalho Chehab
2011-08-08 15:25       ` Hans Verkuil
2011-08-11 17:49       ` Rémi Denis-Courmont
2011-08-11 19:00         ` Mauro Carvalho Chehab
2011-08-03 19:53 ` Theodore Kilgore
2011-08-03 20:36   ` Mauro Carvalho Chehab
2011-08-03 23:20     ` Theodore Kilgore
2011-08-04 12:34       ` Mauro Carvalho Chehab
2011-08-04 18:37         ` Theodore Kilgore
2011-08-04 19:11           ` Mauro Carvalho Chehab
2011-08-04 21:16             ` Theodore Kilgore
2011-08-04 21:58               ` Mauro Carvalho Chehab
2011-08-04 22:57                 ` Theodore Kilgore
2011-08-05  7:02         ` [Workshop-2011] " Hans de Goede
2011-08-05 17:13           ` Theodore Kilgore
2011-08-07 22:53           ` Adam Baker
2011-08-08  2:26             ` Theodore Kilgore
2011-08-08 13:45               ` Mauro Carvalho Chehab
2011-08-08 17:39                 ` Theodore Kilgore
2011-08-08 18:39                   ` Mauro Carvalho Chehab
2011-08-08 19:32                     ` Theodore Kilgore
2011-08-08 20:07                       ` Mauro Carvalho Chehab
2011-08-08 20:24                         ` Adam Baker
2011-08-08 20:43                           ` Theodore Kilgore
2011-08-09  7:30                   ` Hans de Goede
2011-08-09 17:10                     ` Theodore Kilgore
2011-08-09 20:30                       ` Hans de Goede
2011-08-10  0:34                         ` Theodore Kilgore
2011-08-10  7:02                           ` Hans de Goede
2011-08-08 20:33                 ` Adam Baker
2011-08-08 21:06                   ` Theodore Kilgore
2011-08-09  7:37                     ` Hans de Goede
2011-08-09 19:06                       ` Theodore Kilgore
2011-08-08  2:56             ` Theodore Kilgore
2011-08-08  7:53             ` Hans de Goede
2011-08-04 11:39     ` Hans de Goede
2011-08-04 12:40       ` Mauro Carvalho Chehab
2011-08-04 16:40         ` Jean-Francois Moine
2011-08-04 19:02           ` Guennadi Liakhovetski
2011-08-04 20:33             ` Mauro Carvalho Chehab
2011-08-04 21:38               ` Adam Baker
2011-08-04 21:49                 ` Mauro Carvalho Chehab
2011-08-04 22:30                 ` Theodore Kilgore
2011-08-04 19:05           ` Theodore Kilgore
2011-08-04 20:35             ` Adam Baker
2011-08-04 21:55               ` Theodore Kilgore
2011-08-04 23:04                 ` Adam Baker
2011-08-05  0:01                   ` Theodore Kilgore
2011-08-07 22:30                     ` Adam Baker
2011-08-07 23:19                       ` Alan Stern
2011-08-08  0:30                         ` Adam Baker
2011-08-08 14:38                           ` Alan Stern
2011-08-08  3:33                         ` Theodore Kilgore
2011-08-08 14:55                           ` Alan Stern
2011-08-08 18:14                             ` Theodore Kilgore
2011-08-08 19:22                               ` Alan Stern
2011-08-08 19:58                                 ` Theodore Kilgore [this message]
2011-08-08 20:33                                   ` Alan Stern
2011-08-04 18:55         ` Theodore Kilgore
2011-08-11 10:16 ` Sakari Ailus
2011-08-11 11:03   ` Mauro Carvalho Chehab

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=alpine.LNX.2.00.1108081435340.21636@banach.math.auburn.edu \
    --to=kilgota@banach.math.auburn.edu \
    --cc=hdegoede@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@baker-net.org.uk \
    --cc=moinejf@free.fr \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.