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 09-08-2012, 08:50 AM   #1
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 78

Rep: Reputation: 15
udev rule for naming multiple webcams


Debian Linux 2.6.32-5-486

I am trying to give persistant names for 2 cameras that are attached via usb but on each boot, they get assigned to /dev/video0 or /dev/video1

So udev seems to be the way but I have a massive headache now. TY minimal docu writers ;-)

Doing: find /dev -name usb*
Code:
/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
/dev/v4l/by-id/usb-046d_08b2-video-index0
/dev/v4l/by-id/usb-046d_08cc_0E0390B3-video-index0
/dev/snd/by-id/usb-046d_08cc_0E0390B3-02
/dev/snd/by-id/usb-046d_08b2-01
/dev/.udev/db/usb:2-2
/dev/.udev/db/usb:5-2
/dev/.udev/db/usb:7-2
/dev/.udev/db/usb:7-1
/dev/.udev/db/usb:usb2
/dev/.udev/db/usb:usb4
/dev/.udev/db/usb:usb3
/dev/.udev/db/usb:usb1
/dev/.udev/db/usb:usb7
/dev/.udev/db/usb:usb8
/dev/.udev/db/usb:usb5
/dev/.udev/db/usb:usb6
/dev/bus/usb
/dev/input/by-id/usb-046d_08cc_0E0390B3-event-if00
and doing:lsusb
Code:
lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 007 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 046d:08b2 Logitech, Inc. QuickCam Pro 4000
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 046d:08cc Logitech, Inc. Mic (PTZ)
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Goal: is to have '046d:08b2 Logitech, Inc. QuickCam Pro 4000' named 'cctv_north'
and '046d:08cc Logitech, Inc. Mic (PTZ)' named 'cctv_south'

In /etc/udev I created a file called: 50-udev.rules
which contained the following:

Code:
# MAW
#SUBSYSTEM=="devices", SUBSYSTEMS=="usb", ATTRS{idVendor}=="05e1", ATTRS{idProduct}=="0408", SYMLINK+="cctv_carport"
#SUBSYSTEM=="devices", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="08cc", SYMLINK+="cctv_south"
#SUBSYSTEM=="devices", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="08b2", SYMLINK+="cctv_north"

SYSFS{idVendor}=="046d", SYSFS{idProduct}=="08cc", SYMLINK+="cctv_south"
Various attempts have all failed, after editing the file I always do a udev restart: sudo /etc/init.d/udev restart

then search for the newly named cams: find /dev -name cc*

but no luck.
 
Old 09-08-2012, 12:58 PM   #2
tweezerhead
LQ Newbie
 
Registered: Sep 2006
Posts: 12

Rep: Reputation: 0
The udev rules in the example are commented out. Is this a typo?
 
Old 09-08-2012, 01:16 PM   #3
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 78

Original Poster
Rep: Reputation: 15
Hi tweezerhead, No, they are my previous failures ;-) The last line I have got rid of now too. This is my current attempt:
Code:
SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="08b2", SYMLINK+="cctv_north"
SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="08cc", SYMLINK+="cctv_south"
Just rebooting now, since this appears the only way a bafoon like myself can get it to re-do its self.

For some reason they appear to be pointing to one device even though you cann access each device seperately.

Code:
find /dev -name cctv*
/dev/cctv_north
/dev/cctv_south
/dev/.udev/links/cctv_north
/dev/.udev/links/cctv_south
jilldando:/home/worsdall#  find /dev -name vid*
/dev/video1
/dev/video0
/dev/.udev/tags/udev-acl/video4linux:video1
/dev/.udev/tags/udev-acl/video4linux:video0
/dev/.udev/db/video4linux:video1
/dev/.udev/db/video4linux:video0
jilldando:/home/worsdall#  find /dev -name usb*
/dev/v4l/by-id/usb-046d_08b2-video-index0
/dev/v4l/by-id/usb-046d_08cc_0E0390B3-video-index0
/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
/dev/snd/by-id/usb-046d_08b2-01
/dev/snd/by-id/usb-046d_08cc_0E0390B3-02
/dev/.udev/db/usb:6-2
/dev/.udev/db/usb:6-1
/dev/.udev/db/usb:4-2
/dev/.udev/db/usb:2-2
/dev/.udev/db/usb:usb8
/dev/.udev/db/usb:usb2
/dev/.udev/db/usb:usb3
/dev/.udev/db/usb:usb1
/dev/.udev/db/usb:usb7
/dev/.udev/db/usb:usb4
/dev/.udev/db/usb:usb5
/dev/.udev/db/usb:usb6
/dev/bus/usb
/dev/input/by-id/usb-046d_08cc_0E0390B3-event-if00

Last edited by wikapuki; 09-08-2012 at 01:34 PM.
 
Old 09-09-2012, 02:37 PM   #4
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 78

Original Poster
Rep: Reputation: 15
It turns out everything is being assigned correctly by udev. It is the software guvcview that was NOT accepting /dev/cctv_north or /dev/cctv_south --device= parameter and was using its own USB vide4linux lostings of available cameras.

When I went back to old faithful (VLC) and told it what to stream, bingO all is fine.

Thanks (Now where is that mark solved button???)
 
  


Reply

Tags
debian, udev rules, usb camera


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
RHEL6 - UDEV naming override chakkerz Linux - Server 4 04-23-2012 10:57 PM
Naming problem with udev zkab Debian 2 03-08-2012 04:25 AM
defining video* with 2 webcams in udev DebianUser Linux - Software 2 04-13-2011 02:43 PM
Help on naming iscsi devices with udev TheR_ Linux - Server 1 09-09-2009 08:46 AM
Hotswap and udev persisten naming Thure Linux - Server 3 01-26-2009 07:41 AM


All times are GMT -5. The time now is 08:17 AM.

Main Menu
Advertisement
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