LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-13-2011, 09:14 AM   #1
DebianUser
Member
 
Registered: Apr 2010
Posts: 78

Rep: Reputation: 15
defining video* with 2 webcams in udev


I have two identical webcams and I want to assign video0 and video1 to a particular one. I understand I can do this using udev but a bit stuck as being both the same they have the same attributes.

video0
Code:
  looking at device '/class/video4linux/video0':
    KERNEL=="video0"
    SUBSYSTEM=="video4linux"
    DRIVER==""
    ATTR{name}=="OV51x USB Camera"

  looking at parent device '/devices/pci0000:00/0000:00:01.0/usb2/2-2':
    KERNELS=="2-2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 3"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="80"
    ATTRS{bMaxPower}=="500mA"
    ATTRS{urbnum}=="174995"
    ATTRS{idVendor}=="054c"
    ATTRS{idProduct}=="0155"
    ATTRS{bcdDevice}=="0100"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="2"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Sony corporation"
    ATTRS{product}=="EyeToy USB camera Namtai"

  looking at parent device '/devices/pci0000:00/0000:00:01.0/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="36"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0001"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="3"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.26-2-ixp4xx ohci_hcd"
    ATTRS{product}=="OHCI Host Controller"
    ATTRS{serial}=="0000:00:01.0"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:01.0':
    KERNELS=="0000:00:01.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="ohci_hcd"
    ATTRS{vendor}=="0x1033"
    ATTRS{device}=="0x0035"
    ATTRS{subsystem_vendor}=="0x1033"
    ATTRS{subsystem_device}=="0x0035"
    ATTRS{class}=="0x0c0310"
    ATTRS{irq}=="28"
    ATTRS{local_cpus}=="1"
    ATTRS{local_cpulist}=="0"
    ATTRS{modalias}=="pci:v00001033d00000035sv00001033sd00000035bc0Csc03i10"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
video1
Code:
  looking at device '/class/video4linux/video1':
    KERNEL=="video1"
    SUBSYSTEM=="video4linux"
    DRIVER==""
    ATTR{name}=="OV51x USB Camera"

  looking at parent device '/devices/pci0000:00/0000:00:01.1/usb3/3-2':
    KERNELS=="3-2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 3"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="80"
    ATTRS{bMaxPower}=="500mA"
    ATTRS{urbnum}=="168"
    ATTRS{idVendor}=="054c"
    ATTRS{idProduct}=="0155"
    ATTRS{bcdDevice}=="0100"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="3"
    ATTRS{devnum}=="3"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Sony corporation"
    ATTRS{product}=="EyeToy USB camera Namtai"

  looking at parent device '/devices/pci0000:00/0000:00:01.1/usb3':
    KERNELS=="usb3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="56"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0001"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="3"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="2"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.26-2-ixp4xx ohci_hcd"
    ATTRS{product}=="OHCI Host Controller"
    ATTRS{serial}=="0000:00:01.1"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:01.1':
    KERNELS=="0000:00:01.1"
    SUBSYSTEMS=="pci"
    DRIVERS=="ohci_hcd"
    ATTRS{vendor}=="0x1033"
    ATTRS{device}=="0x0035"
    ATTRS{subsystem_vendor}=="0x1033"
    ATTRS{subsystem_device}=="0x0035"
    ATTRS{class}=="0x0c0310"
    ATTRS{irq}=="27"
    ATTRS{local_cpus}=="1"
    ATTRS{local_cpulist}=="0"
    ATTRS{modalias}=="pci:v00001033d00000035sv00001033sd00000035bc0Csc03i10"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
I've created webcam.rules in /etc/udev and I understand i'd have to put something like this in

Code:
SUBSYSTEM=="video4linux", \
ATTR????
SYMLINK+="video0"

SUBSYSTEM=="video4linux", \
ATTR????
SYMLINK+="video1"
but not sure what to use for the ATTR entry, also do I need to do anything extra with this file?
 
Old 04-13-2011, 11:58 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,008

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
If their attributes are both identical, you can differentiate them by which USB port they are plugged into.

See here (although the OP never came back, so I do not know if it worked for him).
 
Old 04-13-2011, 01:43 PM   #3
DebianUser
Member
 
Registered: Apr 2010
Posts: 78

Original Poster
Rep: Reputation: 15
I've grepped out BUS and got

ATTRS{busnum}=="2"
ATTRS{busnum}=="2"
ATTRS{msi_bus}==""

ATTRS{busnum}=="3"
ATTRS{busnum}=="3"
ATTRS{msi_bus}==""

should I use

KERNELS=="2-2"
KERNELS=="3-2"

or

BUS="usb", ID=="2-2"
BUS="usb", ID=="3-2"

what would I put in my webcam.rules?

Last edited by DebianUser; 04-13-2011 at 02:06 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using 4 same type webcams at the same time to stream video/audio to uStream Dafydd Linux - Hardware 2 05-24-2010 10:56 AM
pipe screen to video device (udev) 2ck Linux - General 4 03-21-2010 08:52 PM
udev brokes my S3Virge/GX2 video card igadoter Slackware 7 02-20-2009 11:13 AM
Running two USB webcams/Linux compatible IR sensitive webcams doctorelectron Linux - Hardware 1 06-07-2006 08:30 AM
Uninstalled udev and now my video drivers don't work... Shafted Debian 1 07-01-2004 03:01 PM


All times are GMT -5. The time now is 04:32 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration