From: Hans de Goede <j.w.r.degoede@hhs.nl>
To: kilgota@banach.math.auburn.edu
Cc: Hans de Goede <hdegoede@redhat.com>,
video4linux-list@redhat.com, sqcam-devel@lists.sourceforge.net
Subject: Re: [sqcam-devel] Advice wanted on producing an in kernel sq905 driver
Date: Tue, 25 Nov 2008 09:03:39 +0100 [thread overview]
Message-ID: <492BB15B.7030202@hhs.nl> (raw)
In-Reply-To: <Pine.LNX.4.64.0811241446210.6862@banach.math.auburn.edu>
kilgota@banach.math.auburn.edu wrote:
>
>
> On Mon, 24 Nov 2008, Hans de Goede wrote:
<snip>
>> I've been thinking along similar lines (keeping /dev/videoX present
>> when using the still image function). But thinking about this some
>> more I don't think this is worth the trouble. A camera which can do
>> both still images and function as webcam really is a multifunction
>> device, with one function active at a time, this is just like any usb
>> device with multiple usb configurations,
>
> Ah, but the problem is that USB devices which are "good citizens"
> usually have a different Product number when running in different modes.
>
Well, that would make things consistent then with my proposal for cams who hide
multiple functions behind one ID, if one function is used, the other
disappears, including the /dev/videoX device.
>> and when you change the configuration certain functionality becomes
>> not available and other becomes available. If this cam would be
>> correctly using usb configuaration profiles for this, the /dev/videoX
>> would also disappear.
>>
>> Also by just unloading the driver removing /dev/videoX things stay KISS.
>
> Well, I am not sure that this is simpler, actually, which is why I
> brought the subject up for discussion.
>
Well, drivers need to handle disconnect anyways, so this requires no additional
code from the driver, how simple do you want it to be ?
>>
>> Last it is not that strange for the webcam not to show up as a webcam
>> to choose from for use in a webcam app, when you've got a photo app
>> open for importing photo's (and when the import dialog is closed the
>> device should be given back to the /dev/videoX driver).
>>
>> So all in all I believe that having some mechanism:
>> -to unload the driver when libusb wants access *AND*
>> -reload it when libusb is done
>
> This does not address the question of whether the owner of the machine
> wants the kernel module installed, or not. I can imagine that the owner
> might not be interested at all in loading the module if said owner is
> not interested in running the camera as a webcam. I can also imagine
> that the outcome is
>
If you look at any up2date Linux distro, all drivers for all available hardware
will get loaded. This is just how things work now a days, and this is the right
thing todo for 99.99 % of all users. And I really don't care about that other
0.01 %
> 1. owner gets still photos off the camera.
> 2. owner exits from photo-getting app
> 3. libgphoto2 releases the camera, and libusb loads the kernel module --
> which was, prior to (1), *not* loaded.
No, as Adam explained libgphoto would trigger a rescanning of the usb bus, if
the driver was not loaded at plugin / boot because it was blacklisted for
example, the rescan wont load it either.
But this is a corner case. One should never design / optimize for corner case.
Design / optimize for the straight path / normal expected use scenario and then
see what needs and can be done for special cases.
>
>>
>> Is enough, and is nice and KISS, which I like.
>
>
> Yeah. I just love to have modules installed to support hardware which I
> do not intend to use. Don't we all? ;)
Erm, yes we do all love that, because then when I do decide to buy a bluetooth
gizmo, even though I did not have any use for the entire bluetooth stack being
loaded on my desktop before, now all of a sudden it works out of the box.
I'm sorry but not loading modules is something from a recent past, we just
don't do that anymore. Just like almost no one builds its own kernels now.
> What is "simple" about that?
That if I decide to change my mind and use the functionality after all things
will just work.
> If I
> am running some low-powered piece of hardware, why would I want all
> kinds of support for devices X, Y, and Z installed in the kernel unless
> and until I am actually going to use one of them?
>
If you run on a low-powered piece of hardware, you will need a custom distro
anyways.
> The ideal solution probably can not work for ten thousand good reasons,
> but what ought to happen is that a libgphoto2-based app could turn off
> or remove the module (unless the module is in use), and an app requiring
> the kernel module could cause it to be installed, unless the device is
> in use by some app already. This would actually be most ideal and would
> make it unnecessary for libusb to install kernel modules which, perhaps,
> no one is going to use during the next week after installation.
>
No, that will never work, because now a days we have a model where drivers gets
loaded when hardware is detected, not when apps need the functionality. This
allows applications to ask the system which devices are present. Since
applications now ask the system which devices are present, they cannot tell it
to load the driver, otherwise we get a classic chicken and egg problem.
> So in other words the ability of libusb to load up a kernel module is
> another trick which may alleviate the problem for some people, but does
> not solve the problem. Not yet.
I disagree, it is not a trick, it is a nice and very *simple* solution. Maybe
I'm wring, time will tell then and then we can start thinking about more
complex solutions, for now this seems the way forward to me.
Regards,
Hans
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
prev parent reply other threads:[~2008-11-25 7:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.208512.1227000563.24145.sqcam-devel@lists.sourceforge.net>
[not found] ` <Pine.LNX.4.64.0811181216270.2778@banach.math.auburn.edu>
2008-11-19 0:20 ` [sqcam-devel] Advice wanted on producing an in kernel sq905 driver Adam Baker
2008-11-19 7:46 ` Antonio Ospite
2008-11-19 8:42 ` Hans de Goede
[not found] ` <alpine.LNX.1.10.0811192005020.2980@banach.math.auburn.edu>
2008-11-20 9:38 ` Hans de Goede
[not found] ` <Pine.LNX.4.64.0811201130410.3570@banach.math.auburn.edu>
2008-11-20 19:37 ` Hans de Goede
[not found] ` <Pine.LNX.4.64.0811201657020.3763@banach.math.auburn.edu>
2008-11-21 8:37 ` Hans de Goede
[not found] ` <Pine.LNX.4.64.0811202306360.3930@banach.math.auburn.edu>
2008-11-21 10:54 ` Hans de Goede
[not found] ` <Pine.LNX.4.64.0811211244120.4475@banach.math.auburn.edu>
2008-11-21 21:25 ` Hans de Goede
[not found] ` <Pine.LNX.4.64.0811211929220.4832@banach.math.auburn.edu>
2008-11-23 9:36 ` Report on time needed for completing v4l Bayer interpolation Hans de Goede
[not found] ` <Pine.LNX.4.64.0811231522510.6135@banach.math.auburn.edu>
2008-11-24 8:15 ` Apparent inconsistency in the labels of Bayer tilings Hans de Goede
2008-11-21 21:57 ` [sqcam-devel] Advice wanted on producing an in kernel sq905 driver Adam Baker
2008-11-21 23:39 ` Adam Baker
[not found] ` <Pine.LNX.4.64.0811211658290.4727@banach.math.auburn.edu>
2008-11-22 0:05 ` Adam Baker
[not found] ` <Pine.LNX.4.64.0811211955490.4832@banach.math.auburn.edu>
2008-11-22 21:55 ` The userspace-kernelspace thing. Continuation of sq905 driver discussion Adam Baker
2008-11-24 11:26 ` [sqcam-devel] Advice wanted on producing an in kernel sq905 driver Hans de Goede
[not found] ` <alpine.LNX.1.10.0811191937370.2980@banach.math.auburn.edu>
2008-11-20 7:48 ` Hans de Goede
[not found] ` <492A8E76.3070701@redhat.com>
[not found] ` <Pine.LNX.4.64.0811241446210.6862@banach.math.auburn.edu>
2008-11-25 0:02 ` Adam Baker
[not found] ` <Pine.LNX.4.64.0811241929420.7049@banach.math.auburn.edu>
2008-11-25 20:57 ` Adam Baker
2008-11-25 8:03 ` Hans de Goede [this message]
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=492BB15B.7030202@hhs.nl \
--to=j.w.r.degoede@hhs.nl \
--cc=hdegoede@redhat.com \
--cc=kilgota@banach.math.auburn.edu \
--cc=sqcam-devel@lists.sourceforge.net \
--cc=video4linux-list@redhat.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