← Back to team overview

mythbuntu-bugs team mailing list archive

Re: [Bug 310820]

 

i do not have two tuners anymore, but here is the solution i was using back
then. 'by the way - it is my post from the bugtrack

this is how i do it, because i have a tv card and two (cheap :) webcams.
i use udev rules to create symlinks.

connect all devices. they will create /dev/video0 and /dev/video1
/dev/video2 (or something similar). write down which is which.

now, for each device type:

1.
udevinfo -a -p $(udevinfo -q path -n /dev/video0)
2.
udevinfo -a -p $(udevinfo -q path -n /dev/video1)
3.
udevinfo -a -p $(udevinfo -q path -n /dev/video2)

you will get a very loooong list of attributes. you must find something that
differs your devices and is also easy to identify. it might be the vendor,
model or numeric ID.

in my case i select (to give you some idea):

1.
ATTR{model}=="Labtec Webcam Elch2 "

2.
ATTR{card}=="36"
(there were probably some better options, but i found my particular card
with this number on google, so it seems to be quite unique ;)

3.
ATTR{model}=="Qtec Webcam 100"

once you define these, you go to the /etc/udev/rules.d

you create 3 files, respectively:
11-labtec-webcam.rules
11-qtec-webcam.rules
11-tv-card.rules

an easy method is to copy one of existing files to a new name. inside you
paste (or modify) one line (you may get it from other files from this
directory) which will be as follows, respectively:

1.
ATTR{model}=="Labtec Webcam Elch2 ", SYMLINK+=labtec-cam

2.
ATTR{card}=="36", SYMLINK+=tv-card

3.
ATTR{model}=="Qtec Webcam 100", SYMLINK+=qtec-cam

after rebooting your system, you will find 3 symlinks in your /dev/
directory. they will be pointing to right devices, no matter if they are
temporarily named video0, 1 or 2. in my case these are

/dev/labtec-cam, /dev/qtec-cam and /dev/tv-card

then you reconfigure your programs (tvtime, motion, xawtv - whatever you
use) to use /dev/symlink instead of /dev/videoN. this means for instance
that i run tvtime with this command:

tvtime -d /dev/tv-card

enjoy.

-- 
You received this bug notification because you are a member of Mythbuntu
Bug Team, which is subscribed to Mythbuntu.
https://bugs.launchpad.net/bugs/310820

Title:
  MythTV should use the static device names in /dev/v4l/by-path/* to
  stop video devices changing on boot

Status in Mythbuntu, Ubuntu derivative focused upon MythTV:
  Triaged

Bug description:
  I am using Mythbuntu 8.04 fully updated.

  I have two tuner cards, a Hauppauge PVR-150 (MPEG2 hardware encoder)
  and a bttv WinFast 2000XP (V4L software encoder).

  Every few reboots, the two cards will switch device nodes.  Earlier
  today, the Hauppauge was /dev/video0 and the bttv was /dev/video1.
  Now, they have switched so that the Hauppauge is /dev/video1 and the
  bttv is /dev/video0.  I will attach an lshal from before and after.

  Every time that this happens, it causes me real issues.  The cards do
  not work until I switch the setup  as the MPEG2 card will be setup as
  a V4L card and vice-versa, with the wrong input selected (one uses
  "Tuner 1" and the other uses "Television").  Even worse, when I switch
  the device nodes in the setup, it often seems to break my scheduled
  recordings in unexpected ways.  I have set it up as if I were moving
  everything to new hardware a few times, but it takes an age.

  If I can be of any further help, please let me know.



References