Help with plug and play - USB Webcam conflicts with Tv Tuner - fixed, sort of + udev question

Scott Allen scotta-cpI+UMyWUv9BDgjK7y7TUQ at public.gmane.org
Mon Apr 5 10:26:42 UTC 2010


On Sun Apr 04,2010 07:26:35 PM TeeCee wrote:
> I'm wondering; can udev evaluate conditions on its own in order to 
> set the tv capture card to symlink  /dev/video0
> to /dev/tv_capture when there is no webcam installed
> or symlink /dev/video1 to /dev/tv_capture when there is.

You request came out as sort of a run-on sentence on my mail reader, 
so it's difficult to understand exactly what you are saying.

If it's not a problem for you to have a device appear as multiple 
names at the same time, (e.g. as both /dev/video1 and 
/dev/tv_capture) then I think you can create udev rules for this.

If you want the name of a device to change based on some other 
factor, such as if another device name already exists, then I don't 
know if this is possible with just a simple rule (but it may be).

I'm pretty sure, though, that you can set a udev rule to execute a 
script or program for a given device. This script/program could do 
some evaluation and then set a symlink as appropriate.


Is this what you want? :

- webcam is always /dev/video0
(no matter when or how many times it's plugged in or unplugged)

- tv capture card is always /dev/video1 and also /dev/tv_capture
(whether the webcam is present or not)

If so, this is what udev rules were meant for. You need a rule to 
always set the webcam to /dev/video0, using its USB ID, name, or some 
other unique identifier. You need another rule for the tv capture 
card to set it to both /dev/video1 and /dev/tv_capture, again using 
some unique identifier for the card.

Note that you want to have your rules override the existing rules 
that create /dev/videoX when each of your devices are identified.

-- 
** Scott Allen   scotta-cpI+UMyWUv9BDgjK7y7TUQ at public.gmane.org **
**     Toronto, Ontario, Canada     **
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list