Hi Moritz, On Monday 24 March 2008, Moritz Barsnick wrote: > Hi Laurent, UVCers, > > I have a small suggestion for the linux-uvc driver. Currently, the > driver lets V4L2 automatically select the device node (/dev/videoX). > But we all know that order of loading modules, init times, et.al. may > influence the order, therefore I thought it might by practical to > introduce a module option to request a specific device node. > > Caveat: My implementation is by all means incomplete. It will only work > for one device (and actually fail for any subsequent ones AFAICT, > unless you reset the parameter in /sys/), and is totally unflexible. On > the other hand. it doesn't intrude if you don't provide a parameter. > > I forsee flexible functionality as you can find e.g. in the pwc webcam > driver[*]. Their implementation also fails if the requested node is not > available, but it provides a type and serial number dependant > selection.
This should be done using udev rules. You can then assign a device node to a camera based on various parameters such as the device serial number, its VID/PID or the module name. This is much more flexible than forcing a specific minor with a module parameter. > Furthermore, while quick-hacking this code, I noticed that linux-uvc > a) doesn't report its version -> use macro MODULE_VERSION() > b) doesn't provide parameter descriptions (which can be queried with > "modinfo uvcvideo") -> use macro MODULE_PARM_DESC() I've committed a fix for a) and b). Thanks for reporting them. > c) doesn't report which device node it actually assigns to the device, > which is very useful in dmesg (and which other drivers tend to do). The device minor can be useful, but the message in your patch can be misleading as well. The video0 device node doesn't have to be called /dev/video0. Some distributions name the device node /dev/v4l/video0. The allocated device minor can easily be found using sysfs and I'm a bit scared an incorrect /dev/videoX reference in the kernel log messages might confuse users. > So please consider the attached patch two seperate suggestions: > - general messaging and API documentation improvements > - a stub for requesting a particular device node. > > Please let me know if you consider it useful, or have something better > to suggest. As stated above, I think device node naming should be handled by udev. > Thanks for listening, and thanks for the ever so valuable driver! > > Patch is against SVN r195. > I've tested with Logitech QuickCam Fusion on two machines. > > Kind regards, > Moritz > > [*] called device hints in pwc-if.c Best regards, Laurent Pinchart _______________________________________________ Linux-uvc-devel mailing list [email protected] https://lists.berlios.de/mailman/listinfo/linux-uvc-devel
