View previous topic :: View next topic |
Author |
Message |
trumee Guru
Joined: 02 Mar 2003 Posts: 551 Location: London,UK
|
Posted: Fri Aug 09, 2013 10:00 pm Post subject: udev rule webcam |
|
|
Hi,
My laptop has an inbuilt webcam which points to /dev/video0, and an usb logitech webcam which appears at /dev/video1. I would like my logitech webcam to be at /dev/video5. Unfortunatelt, it didnt work as following messages show. any idea why?
Code: |
#lsusb
Bus 002 Device 014: ID 046d:081d Logitech, Inc. HD Webcam C510
|
Code: |
cat /etc/udev/rules.d/99-local.rules
KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ENV{ID_V4L_PRODUCT}=="UVC Camera (046d:081d)", NAME="video5", GROUP="video", OPTIONS="last_rule"
|
On plugging the webcam
Code: |
udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[5304.549787] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
KERNEL[5304.549846] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
KERNEL[5304.549885] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.1 (usb)
KERNEL[5304.549908] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.2 (usb)
KERNEL[5304.796437] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.2/video4linux/video1 (video4linux)
KERNEL[5304.796493] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.2/input/input19 (input)
KERNEL[5304.796514] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.2/input/input19/event10 (input)
KERNEL[5304.796561] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.3 (usb)
UDEV [5304.796876] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
UDEV [5304.797284] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
UDEV [5304.797745] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.2 (usb)
UDEV [5304.797769] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.3 (usb)
UDEV [5304.797781] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.1 (usb)
UDEV [5304.798497] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.2/input/input19 (input)
UDEV [5304.799113] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.2/input/input19/event10 (input)
UDEV [5304.801067] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.2/video4linux/video1 (video4linux)
|
Finally
Code: |
#ls /dev/video*
/dev/video0 /dev/video1
|
/dev/video5 is never created! |
|
Back to top |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1520
|
Posted: Fri Aug 09, 2013 11:44 pm Post subject: Re: udev rule webcam |
|
|
trumee wrote: | ...
Code: |
cat /etc/udev/rules.d/99-local.rules
KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ENV{ID_V4L_PRODUCT}=="UVC Camera (046d:081d)", NAME="video5", GROUP="video", OPTIONS="last_rule"
|
... |
You can't use NAME="foo" for naming your webcam. NAME is reserved for network interface names. Use this rule:
Code: | KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ENV{ID_V4L_PRODUCT}=="UVC Camera (046d:081d)", SYMLINK+="video5", GROUP="video", OPTIONS="last_rule" |
If it does work, try:
Code: | ACTION=="add", KERNEL=="video1", SUBSYSTEM=="video4linux", SYMLINK+="video5", GROUP="video", OPTIONS="last_rule" |
|
|
Back to top |
|
|
trumee Guru
Joined: 02 Mar 2003 Posts: 551 Location: London,UK
|
Posted: Sat Aug 10, 2013 5:50 am Post subject: Re: udev rule webcam |
|
|
quilosaq wrote: |
You can't use NAME="foo" for naming your webcam. NAME is reserved for network interface names. Use this rule:
Code: | KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ENV{ID_V4L_PRODUCT}=="UVC Camera (046d:081d)", SYMLINK+="video5", GROUP="video", OPTIONS="last_rule" |
If it does work, try:
Code: | ACTION=="add", KERNEL=="video1", SUBSYSTEM=="video4linux", SYMLINK+="video5", GROUP="video", OPTIONS="last_rule" |
|
Thanks, this did work. It created a /dev/video1 and a symlink /dev/video5.
Code: |
# ls -la /dev/video*
crw-rw---- 1 root video 81, 0 Aug 10 06:44 /dev/video0
crw-rw---- 1 root video 81, 1 Aug 10 06:46 /dev/video1
lrwxrwxrwx 1 root root 6 Aug 10 06:46 /dev/video5 -> video1
|
Is it possible not to have /dev/video1 at all, and rather than symlink have a webcam directly addressable at /dev/video5? |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Sat Aug 10, 2013 7:12 am Post subject: |
|
|
Why your attachment to "video5"? That's a name to be avoided, e.g. this situation:
You plug in 5 webcams
Then you plug in the webcam that becomes video5, so where does the previous video5 go?
You're supposed to use a symlink that uses a different naming convention, e.g. "mycam" or whatever. Anything but "video$n". |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|