On Wed, Dec 10, 2008 at 11:38 PM, Laurent Pinchart
<[EMAIL PROTECTED]> wrote:
> On Wednesday 10 December 2008, Alessandro Soro wrote:
>> Any ideas?
>>
>> If not, a way to fix the assignment of /dev/video# entries to a usb
>> bus/port would also do the trick for me.
>
> The order in which the /dev/videoX nodes are created depends on the
> enumeration order on USB. This probably varies between reboots, hence your
> problems.
>
> First of all, please note that not all cameras have a serial number, and
> serial numbers are not always unique. Logitech cameras behave nicely here so
> it won't be an issue for your application, but beware of this if you decided
> to switch to other cameras.
>
> The serial number is available through sysfs:
>
> $ cat /sys/bus/usb/devices/5-1/serial
> C2D14EDB
>
> You can control how device nodes are created through udev rules. I'm no udev
> expert, but copying your video device rule with an additional
>
> ATTRS{serial}=="xxxxxxxx"
>
> option should let you give persistant names to the device nodes.

Hi Alessandro,
If you want it to be independent from the current udev rules and you
have HAL running on your setup you could try using libhal.

You can call libhal_find_device_by_capability to query video4linux
capable devices.
It will give you an array of unique udis, one per device. Then you can
call libhal_device_get_property_string on each udi to get the
"video4linux.device" property (/dev/videoX).

It's probably not worth if you have a minimal setup and cannot depend
on hal but surely more portable if you don't want to edit udev rules
in each system you're going to run the app into.

Best Regards,

Filippo
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to