Udev Rule to discern 2 identical webcams on Linux
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have 2 identical webcams plugged into my Raspberry Pi. I want discern which camera is which based on the USB port they are plugged in to.
This is the purpose of udev, so I wrote the following rule:
SUBSYSTEM=="usb", KERNEL=="1-1.3", ATTRidVendor=="05a3", ATTRidProduct=="9422", SYMLINK+="klastle/vlvid"
SUBSYSTEM=="usb", KERNEL=="1-1.5", ATTRidVendor=="05a3", ATTRidProduct=="9422", SYMLINK+="klastle/irvid"
Which on a reboot shows these devices:
root@raspberrypi:~# ls -rlt /dev/klastle/
total 0
lrwxrwxrwx 1 root root 18 Feb 18 01:24 irvid -> ../bus/usb/001/007
lrwxrwxrwx 1 root root 18 Feb 18 01:24 vlvid -> ../bus/usb/001/005
The problem is that these are not video for linux ( V4L2 ) devices and my application cannot open them.
How can I write my rule correctly to symlink the actual /dev/video0 and /dev/video1 to /dev/klastle/irvid and /dev/klastle/vlvid?
Thanks.
UPDATE: Here is the udevadm query output for both devices:
root@raspberrypi:~# udevadm info --query=all --name=/dev/video3
P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/video4linux/video3
N: video3
S: v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index1
S: v4l/by-path/platform-3f980000.usb-usb-0:1.5:1.0-video-index1
E: DEVLINKS=/dev/v4l/by-path/platform-3f980000.usb-usb-0:1.5:1.0-video-index1 /dev/v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index1
E: DEVNAME=/dev/video3
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/video4linux/video3
E: ID_BUS=usb
E: ID_FOR_SEAT=video4linux-platform-3f980000_usb-usb-0_1_5_1_0
E: ID_MODEL=USB_2.0_Camera
E: ID_MODEL_ENC=USBx202.0x20Camera
E: ID_MODEL_ID=9422
E: ID_PATH=platform-3f980000.usb-usb-0:1.5:1.0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_5_1_0
E: ID_REVISION=0100
E: ID_SERIAL=Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001
E: ID_SERIAL_SHORT=SN0001
E: ID_TYPE=video
E: ID_USB_DRIVER=uvcvideo
E: ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:
E: ID_USB_INTERFACE_NUM=00
E: ID_V4L_CAPABILITIES=:capture:
E: ID_V4L_PRODUCT=USB 2.0 Camera: H264 USB Camera
E: ID_V4L_VERSION=2
E: ID_VENDOR=Sonix_Technology_Co.__Ltd.
E: ID_VENDOR_ENC=Sonixx20Technologyx20Co.x2cx20Ltd.
E: ID_VENDOR_ID=05a3
E: MAJOR=81
E: MINOR=3
E: SUBSYSTEM=video4linux
E: TAGS=:uaccess:seat:
E: USEC_INITIALIZED=3298533
root@raspberrypi:~# udevadm info --query=all --name=/dev/video0
P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0
N: video0
S: v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index0
S: v4l/by-path/platform-3f980000.usb-usb-0:1.3:1.0-video-index0
E: DEVLINKS=/dev/v4l/by-path/platform-3f980000.usb-usb-0:1.3:1.0-video-index0 /dev/v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index0
E: DEVNAME=/dev/video0
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0
E: ID_BUS=usb
E: ID_FOR_SEAT=video4linux-platform-3f980000_usb-usb-0_1_3_1_0
E: ID_MODEL=USB_2.0_Camera
E: ID_MODEL_ENC=USBx202.0x20Camera
E: ID_MODEL_ID=9422
E: ID_PATH=platform-3f980000.usb-usb-0:1.3:1.0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_3_1_0
E: ID_REVISION=0100
E: ID_SERIAL=Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001
E: ID_SERIAL_SHORT=SN0001
E: ID_TYPE=video
E: ID_USB_DRIVER=uvcvideo
E: ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:
E: ID_USB_INTERFACE_NUM=00
E: ID_V4L_CAPABILITIES=:capture:
E: ID_V4L_PRODUCT=USB 2.0 Camera: H264 USB Camera
E: ID_V4L_VERSION=2
E: ID_VENDOR=Sonix_Technology_Co.__Ltd.
E: ID_VENDOR_ENC=Sonixx20Technologyx20Co.x2cx20Ltd.
E: ID_VENDOR_ID=05a3
E: MAJOR=81
E: MINOR=0
E: SUBSYSTEM=video4linux
E: TAGS=:seat:uaccess:
E: USEC_INITIALIZED=3289947
linux udev video
add a comment |Â
up vote
0
down vote
favorite
I have 2 identical webcams plugged into my Raspberry Pi. I want discern which camera is which based on the USB port they are plugged in to.
This is the purpose of udev, so I wrote the following rule:
SUBSYSTEM=="usb", KERNEL=="1-1.3", ATTRidVendor=="05a3", ATTRidProduct=="9422", SYMLINK+="klastle/vlvid"
SUBSYSTEM=="usb", KERNEL=="1-1.5", ATTRidVendor=="05a3", ATTRidProduct=="9422", SYMLINK+="klastle/irvid"
Which on a reboot shows these devices:
root@raspberrypi:~# ls -rlt /dev/klastle/
total 0
lrwxrwxrwx 1 root root 18 Feb 18 01:24 irvid -> ../bus/usb/001/007
lrwxrwxrwx 1 root root 18 Feb 18 01:24 vlvid -> ../bus/usb/001/005
The problem is that these are not video for linux ( V4L2 ) devices and my application cannot open them.
How can I write my rule correctly to symlink the actual /dev/video0 and /dev/video1 to /dev/klastle/irvid and /dev/klastle/vlvid?
Thanks.
UPDATE: Here is the udevadm query output for both devices:
root@raspberrypi:~# udevadm info --query=all --name=/dev/video3
P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/video4linux/video3
N: video3
S: v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index1
S: v4l/by-path/platform-3f980000.usb-usb-0:1.5:1.0-video-index1
E: DEVLINKS=/dev/v4l/by-path/platform-3f980000.usb-usb-0:1.5:1.0-video-index1 /dev/v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index1
E: DEVNAME=/dev/video3
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/video4linux/video3
E: ID_BUS=usb
E: ID_FOR_SEAT=video4linux-platform-3f980000_usb-usb-0_1_5_1_0
E: ID_MODEL=USB_2.0_Camera
E: ID_MODEL_ENC=USBx202.0x20Camera
E: ID_MODEL_ID=9422
E: ID_PATH=platform-3f980000.usb-usb-0:1.5:1.0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_5_1_0
E: ID_REVISION=0100
E: ID_SERIAL=Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001
E: ID_SERIAL_SHORT=SN0001
E: ID_TYPE=video
E: ID_USB_DRIVER=uvcvideo
E: ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:
E: ID_USB_INTERFACE_NUM=00
E: ID_V4L_CAPABILITIES=:capture:
E: ID_V4L_PRODUCT=USB 2.0 Camera: H264 USB Camera
E: ID_V4L_VERSION=2
E: ID_VENDOR=Sonix_Technology_Co.__Ltd.
E: ID_VENDOR_ENC=Sonixx20Technologyx20Co.x2cx20Ltd.
E: ID_VENDOR_ID=05a3
E: MAJOR=81
E: MINOR=3
E: SUBSYSTEM=video4linux
E: TAGS=:uaccess:seat:
E: USEC_INITIALIZED=3298533
root@raspberrypi:~# udevadm info --query=all --name=/dev/video0
P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0
N: video0
S: v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index0
S: v4l/by-path/platform-3f980000.usb-usb-0:1.3:1.0-video-index0
E: DEVLINKS=/dev/v4l/by-path/platform-3f980000.usb-usb-0:1.3:1.0-video-index0 /dev/v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index0
E: DEVNAME=/dev/video0
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0
E: ID_BUS=usb
E: ID_FOR_SEAT=video4linux-platform-3f980000_usb-usb-0_1_3_1_0
E: ID_MODEL=USB_2.0_Camera
E: ID_MODEL_ENC=USBx202.0x20Camera
E: ID_MODEL_ID=9422
E: ID_PATH=platform-3f980000.usb-usb-0:1.3:1.0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_3_1_0
E: ID_REVISION=0100
E: ID_SERIAL=Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001
E: ID_SERIAL_SHORT=SN0001
E: ID_TYPE=video
E: ID_USB_DRIVER=uvcvideo
E: ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:
E: ID_USB_INTERFACE_NUM=00
E: ID_V4L_CAPABILITIES=:capture:
E: ID_V4L_PRODUCT=USB 2.0 Camera: H264 USB Camera
E: ID_V4L_VERSION=2
E: ID_VENDOR=Sonix_Technology_Co.__Ltd.
E: ID_VENDOR_ENC=Sonixx20Technologyx20Co.x2cx20Ltd.
E: ID_VENDOR_ID=05a3
E: MAJOR=81
E: MINOR=0
E: SUBSYSTEM=video4linux
E: TAGS=:seat:uaccess:
E: USEC_INITIALIZED=3289947
linux udev video
Can you provide the output ofudevinfo -a
orudevadm info -a
against the appropriate device or sysfs entry?
â Ignacio Vazquez-Abrams
Feb 18 at 1:34
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have 2 identical webcams plugged into my Raspberry Pi. I want discern which camera is which based on the USB port they are plugged in to.
This is the purpose of udev, so I wrote the following rule:
SUBSYSTEM=="usb", KERNEL=="1-1.3", ATTRidVendor=="05a3", ATTRidProduct=="9422", SYMLINK+="klastle/vlvid"
SUBSYSTEM=="usb", KERNEL=="1-1.5", ATTRidVendor=="05a3", ATTRidProduct=="9422", SYMLINK+="klastle/irvid"
Which on a reboot shows these devices:
root@raspberrypi:~# ls -rlt /dev/klastle/
total 0
lrwxrwxrwx 1 root root 18 Feb 18 01:24 irvid -> ../bus/usb/001/007
lrwxrwxrwx 1 root root 18 Feb 18 01:24 vlvid -> ../bus/usb/001/005
The problem is that these are not video for linux ( V4L2 ) devices and my application cannot open them.
How can I write my rule correctly to symlink the actual /dev/video0 and /dev/video1 to /dev/klastle/irvid and /dev/klastle/vlvid?
Thanks.
UPDATE: Here is the udevadm query output for both devices:
root@raspberrypi:~# udevadm info --query=all --name=/dev/video3
P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/video4linux/video3
N: video3
S: v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index1
S: v4l/by-path/platform-3f980000.usb-usb-0:1.5:1.0-video-index1
E: DEVLINKS=/dev/v4l/by-path/platform-3f980000.usb-usb-0:1.5:1.0-video-index1 /dev/v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index1
E: DEVNAME=/dev/video3
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/video4linux/video3
E: ID_BUS=usb
E: ID_FOR_SEAT=video4linux-platform-3f980000_usb-usb-0_1_5_1_0
E: ID_MODEL=USB_2.0_Camera
E: ID_MODEL_ENC=USBx202.0x20Camera
E: ID_MODEL_ID=9422
E: ID_PATH=platform-3f980000.usb-usb-0:1.5:1.0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_5_1_0
E: ID_REVISION=0100
E: ID_SERIAL=Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001
E: ID_SERIAL_SHORT=SN0001
E: ID_TYPE=video
E: ID_USB_DRIVER=uvcvideo
E: ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:
E: ID_USB_INTERFACE_NUM=00
E: ID_V4L_CAPABILITIES=:capture:
E: ID_V4L_PRODUCT=USB 2.0 Camera: H264 USB Camera
E: ID_V4L_VERSION=2
E: ID_VENDOR=Sonix_Technology_Co.__Ltd.
E: ID_VENDOR_ENC=Sonixx20Technologyx20Co.x2cx20Ltd.
E: ID_VENDOR_ID=05a3
E: MAJOR=81
E: MINOR=3
E: SUBSYSTEM=video4linux
E: TAGS=:uaccess:seat:
E: USEC_INITIALIZED=3298533
root@raspberrypi:~# udevadm info --query=all --name=/dev/video0
P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0
N: video0
S: v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index0
S: v4l/by-path/platform-3f980000.usb-usb-0:1.3:1.0-video-index0
E: DEVLINKS=/dev/v4l/by-path/platform-3f980000.usb-usb-0:1.3:1.0-video-index0 /dev/v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index0
E: DEVNAME=/dev/video0
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0
E: ID_BUS=usb
E: ID_FOR_SEAT=video4linux-platform-3f980000_usb-usb-0_1_3_1_0
E: ID_MODEL=USB_2.0_Camera
E: ID_MODEL_ENC=USBx202.0x20Camera
E: ID_MODEL_ID=9422
E: ID_PATH=platform-3f980000.usb-usb-0:1.3:1.0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_3_1_0
E: ID_REVISION=0100
E: ID_SERIAL=Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001
E: ID_SERIAL_SHORT=SN0001
E: ID_TYPE=video
E: ID_USB_DRIVER=uvcvideo
E: ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:
E: ID_USB_INTERFACE_NUM=00
E: ID_V4L_CAPABILITIES=:capture:
E: ID_V4L_PRODUCT=USB 2.0 Camera: H264 USB Camera
E: ID_V4L_VERSION=2
E: ID_VENDOR=Sonix_Technology_Co.__Ltd.
E: ID_VENDOR_ENC=Sonixx20Technologyx20Co.x2cx20Ltd.
E: ID_VENDOR_ID=05a3
E: MAJOR=81
E: MINOR=0
E: SUBSYSTEM=video4linux
E: TAGS=:seat:uaccess:
E: USEC_INITIALIZED=3289947
linux udev video
I have 2 identical webcams plugged into my Raspberry Pi. I want discern which camera is which based on the USB port they are plugged in to.
This is the purpose of udev, so I wrote the following rule:
SUBSYSTEM=="usb", KERNEL=="1-1.3", ATTRidVendor=="05a3", ATTRidProduct=="9422", SYMLINK+="klastle/vlvid"
SUBSYSTEM=="usb", KERNEL=="1-1.5", ATTRidVendor=="05a3", ATTRidProduct=="9422", SYMLINK+="klastle/irvid"
Which on a reboot shows these devices:
root@raspberrypi:~# ls -rlt /dev/klastle/
total 0
lrwxrwxrwx 1 root root 18 Feb 18 01:24 irvid -> ../bus/usb/001/007
lrwxrwxrwx 1 root root 18 Feb 18 01:24 vlvid -> ../bus/usb/001/005
The problem is that these are not video for linux ( V4L2 ) devices and my application cannot open them.
How can I write my rule correctly to symlink the actual /dev/video0 and /dev/video1 to /dev/klastle/irvid and /dev/klastle/vlvid?
Thanks.
UPDATE: Here is the udevadm query output for both devices:
root@raspberrypi:~# udevadm info --query=all --name=/dev/video3
P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/video4linux/video3
N: video3
S: v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index1
S: v4l/by-path/platform-3f980000.usb-usb-0:1.5:1.0-video-index1
E: DEVLINKS=/dev/v4l/by-path/platform-3f980000.usb-usb-0:1.5:1.0-video-index1 /dev/v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index1
E: DEVNAME=/dev/video3
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/video4linux/video3
E: ID_BUS=usb
E: ID_FOR_SEAT=video4linux-platform-3f980000_usb-usb-0_1_5_1_0
E: ID_MODEL=USB_2.0_Camera
E: ID_MODEL_ENC=USBx202.0x20Camera
E: ID_MODEL_ID=9422
E: ID_PATH=platform-3f980000.usb-usb-0:1.5:1.0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_5_1_0
E: ID_REVISION=0100
E: ID_SERIAL=Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001
E: ID_SERIAL_SHORT=SN0001
E: ID_TYPE=video
E: ID_USB_DRIVER=uvcvideo
E: ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:
E: ID_USB_INTERFACE_NUM=00
E: ID_V4L_CAPABILITIES=:capture:
E: ID_V4L_PRODUCT=USB 2.0 Camera: H264 USB Camera
E: ID_V4L_VERSION=2
E: ID_VENDOR=Sonix_Technology_Co.__Ltd.
E: ID_VENDOR_ENC=Sonixx20Technologyx20Co.x2cx20Ltd.
E: ID_VENDOR_ID=05a3
E: MAJOR=81
E: MINOR=3
E: SUBSYSTEM=video4linux
E: TAGS=:uaccess:seat:
E: USEC_INITIALIZED=3298533
root@raspberrypi:~# udevadm info --query=all --name=/dev/video0
P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0
N: video0
S: v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index0
S: v4l/by-path/platform-3f980000.usb-usb-0:1.3:1.0-video-index0
E: DEVLINKS=/dev/v4l/by-path/platform-3f980000.usb-usb-0:1.3:1.0-video-index0 /dev/v4l/by-id/usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001-video-index0
E: DEVNAME=/dev/video0
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0
E: ID_BUS=usb
E: ID_FOR_SEAT=video4linux-platform-3f980000_usb-usb-0_1_3_1_0
E: ID_MODEL=USB_2.0_Camera
E: ID_MODEL_ENC=USBx202.0x20Camera
E: ID_MODEL_ID=9422
E: ID_PATH=platform-3f980000.usb-usb-0:1.3:1.0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_3_1_0
E: ID_REVISION=0100
E: ID_SERIAL=Sonix_Technology_Co.__Ltd._USB_2.0_Camera_SN0001
E: ID_SERIAL_SHORT=SN0001
E: ID_TYPE=video
E: ID_USB_DRIVER=uvcvideo
E: ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:
E: ID_USB_INTERFACE_NUM=00
E: ID_V4L_CAPABILITIES=:capture:
E: ID_V4L_PRODUCT=USB 2.0 Camera: H264 USB Camera
E: ID_V4L_VERSION=2
E: ID_VENDOR=Sonix_Technology_Co.__Ltd.
E: ID_VENDOR_ENC=Sonixx20Technologyx20Co.x2cx20Ltd.
E: ID_VENDOR_ID=05a3
E: MAJOR=81
E: MINOR=0
E: SUBSYSTEM=video4linux
E: TAGS=:seat:uaccess:
E: USEC_INITIALIZED=3289947
linux udev video
edited Feb 18 at 1:45
asked Feb 18 at 1:28
PhilBot
16315
16315
Can you provide the output ofudevinfo -a
orudevadm info -a
against the appropriate device or sysfs entry?
â Ignacio Vazquez-Abrams
Feb 18 at 1:34
add a comment |Â
Can you provide the output ofudevinfo -a
orudevadm info -a
against the appropriate device or sysfs entry?
â Ignacio Vazquez-Abrams
Feb 18 at 1:34
Can you provide the output of
udevinfo -a
or udevadm info -a
against the appropriate device or sysfs entry?â Ignacio Vazquez-Abrams
Feb 18 at 1:34
Can you provide the output of
udevinfo -a
or udevadm info -a
against the appropriate device or sysfs entry?â Ignacio Vazquez-Abrams
Feb 18 at 1:34
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Your rules are matching at the wrong level in the device tree: SUBSYSTEM=="usb"
says you want a symlink to something that represents the complete USB device, and not the video4linux layer. So you need SUBSYSTEM=video4linux
. You also need ATTRS
and KERNELS
(with extra S) instead of ATTR
and KERNEL
, because you want to much those further up in the tree. See man udev
for details.
The way to get this information is to get udevadm
to spit out the whole path up to the root of tree with attributes etc., with something like
udevadm info -a -p $(udevadm info -q path -n /dev/video3)
(you already did the inner part for the edit of your question).
So the rule should become something like
SUBSYSTEM=="video4linux", KERNELS=="1-1.3", ATTRSidVendor=="05a3", ATTRSidProduct=="9422", SYMLINK+="klastle/vlvid"
or similar, possibly depending on what you see in the device path.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Your rules are matching at the wrong level in the device tree: SUBSYSTEM=="usb"
says you want a symlink to something that represents the complete USB device, and not the video4linux layer. So you need SUBSYSTEM=video4linux
. You also need ATTRS
and KERNELS
(with extra S) instead of ATTR
and KERNEL
, because you want to much those further up in the tree. See man udev
for details.
The way to get this information is to get udevadm
to spit out the whole path up to the root of tree with attributes etc., with something like
udevadm info -a -p $(udevadm info -q path -n /dev/video3)
(you already did the inner part for the edit of your question).
So the rule should become something like
SUBSYSTEM=="video4linux", KERNELS=="1-1.3", ATTRSidVendor=="05a3", ATTRSidProduct=="9422", SYMLINK+="klastle/vlvid"
or similar, possibly depending on what you see in the device path.
add a comment |Â
up vote
1
down vote
accepted
Your rules are matching at the wrong level in the device tree: SUBSYSTEM=="usb"
says you want a symlink to something that represents the complete USB device, and not the video4linux layer. So you need SUBSYSTEM=video4linux
. You also need ATTRS
and KERNELS
(with extra S) instead of ATTR
and KERNEL
, because you want to much those further up in the tree. See man udev
for details.
The way to get this information is to get udevadm
to spit out the whole path up to the root of tree with attributes etc., with something like
udevadm info -a -p $(udevadm info -q path -n /dev/video3)
(you already did the inner part for the edit of your question).
So the rule should become something like
SUBSYSTEM=="video4linux", KERNELS=="1-1.3", ATTRSidVendor=="05a3", ATTRSidProduct=="9422", SYMLINK+="klastle/vlvid"
or similar, possibly depending on what you see in the device path.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Your rules are matching at the wrong level in the device tree: SUBSYSTEM=="usb"
says you want a symlink to something that represents the complete USB device, and not the video4linux layer. So you need SUBSYSTEM=video4linux
. You also need ATTRS
and KERNELS
(with extra S) instead of ATTR
and KERNEL
, because you want to much those further up in the tree. See man udev
for details.
The way to get this information is to get udevadm
to spit out the whole path up to the root of tree with attributes etc., with something like
udevadm info -a -p $(udevadm info -q path -n /dev/video3)
(you already did the inner part for the edit of your question).
So the rule should become something like
SUBSYSTEM=="video4linux", KERNELS=="1-1.3", ATTRSidVendor=="05a3", ATTRSidProduct=="9422", SYMLINK+="klastle/vlvid"
or similar, possibly depending on what you see in the device path.
Your rules are matching at the wrong level in the device tree: SUBSYSTEM=="usb"
says you want a symlink to something that represents the complete USB device, and not the video4linux layer. So you need SUBSYSTEM=video4linux
. You also need ATTRS
and KERNELS
(with extra S) instead of ATTR
and KERNEL
, because you want to much those further up in the tree. See man udev
for details.
The way to get this information is to get udevadm
to spit out the whole path up to the root of tree with attributes etc., with something like
udevadm info -a -p $(udevadm info -q path -n /dev/video3)
(you already did the inner part for the edit of your question).
So the rule should become something like
SUBSYSTEM=="video4linux", KERNELS=="1-1.3", ATTRSidVendor=="05a3", ATTRSidProduct=="9422", SYMLINK+="klastle/vlvid"
or similar, possibly depending on what you see in the device path.
answered Feb 18 at 9:31
dirkt
14.1k2930
14.1k2930
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424887%2fudev-rule-to-discern-2-identical-webcams-on-linux%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Can you provide the output of
udevinfo -a
orudevadm info -a
against the appropriate device or sysfs entry?â Ignacio Vazquez-Abrams
Feb 18 at 1:34