[mythtv-users] Order of tuner cards
Indulis Bernsteins
indulis.b at au1.ibm.com
Sat Apr 17 02:20:48 UTC 2010
Rodd,
I also have one tuner (Pinnacle USB DVB-T Diversity stick) which stupidly
has both tuners absolutely identical. I also have a (nice) Dvico
FusionHDTV 4 Dual tuner PCI card where the 2 tuners actually have
different serial numbers.
These following rules work- udev is a tricky little beast to get working
properly!
I end up with (custom udev created entries first)
/dev/dvb/adapter100 -> /dev/dvb/adapter1 (DVICO 1st tuner)
/dev/dvb/adapter100 -> /dev/dvb/adapter2 (DVICO 2nd tuner)
/dev/dvb/adapter110 -> /dev/dvb/adapter0 (Pinnacle, which tuner- who
knows?)
/dev/dvb/adapter111 -> /dev/dvb/adapter3 (Pinnacle. which tuner- who
knows?)
Original adapter names (0, 1, 2 3) are allocated in "random" order during
boot, it seems that the tuner cards/USBs race each other to be first in.
For the DVICO, the 1st number allocated is always the 1st tuner, and the
2nd number is the 2nd. So, it may get adapters 0 and 3, or 1 and 2, or 0
and 2. I suspect it is the same for the DVICO but haven't had time to
experiment.
Anyway, here are my working udev rules- the ENV trickery in the wiki did
not work for me, and I think it has a logical flaw, as all the rules
continue to be evaluated for each device fed into udev, so with the
original udev rules using ENV{}, one pass would create 2 new devices. So,
instead I check to see if the 1st "custom" tuner (eg adapter110/frontend0)
has been created yet, it it has then I know we need to go to adapter111.
Easy! (but finicky to get right)
I have updated the wiki as well
http://mythtv.org/wiki/Device_Filenames_and_udev#Example_for_twin_tuner_cards_with_no_difference_in_udevinfo_output
udevadm test is your friend! Also you can put "set -xv ;" (no quotes!)
straight after ' before "K=%k;"
udevadm control --log-priority="debug-verbose"
udevadm test /class/dvb/dvb0.frontend0
Cheers,
Indulis
---------------------------------------X8 snip
snip----------------------------------------------------------
# /etc/udev/rules.d/10-local.rules
#
# To Ientify serial nos etc for a Device call
#
#
# Create a symlink /dev/dvb/adapter100 pointing to dvico tuner 0
SUBSYSTEM=="dvb", ATTRS{manufacturer}=="Dvico",
ATTRS{product}=="Bluebird", ATTRS{serial}=="0000d34b", PROGRAM="/bin/sh -c
'K=%k; K=$${K#dvb}; printf dvb/adapter100/%%s $${K#*.}'", SYMLINK+="%c"
# Create a symlink /dev/dvb/adapter101 pointing to dvico tuner 1
SUBSYSTEM=="dvb", ATTRS{manufacturer}=="Dvico",
ATTRS{product}=="Bluebird", ATTRS{serial}=="0000534b", PROGRAM="/bin/sh -c
'K=%k; K=$${K#dvb}; printf dvb/adapter101/%%s $${K#*.}'", SYMLINK+="%c"
# Create a symlink /dev/dvb/adapter110 pointing to pinnacle tuner 0, and
adapter111 for tuner 1
SUBSYSTEM=="dvb", ATTRS{manufacturer}=="PINNACLE", ATTRS{product}=="PCTV
2001e", ATTRS{serial}=="12026013", PROGRAM="/bin/sh -c ' K=%k;
K=$${K#dvb}; N=$${K#*.}; if [ ! -e /dev/dvb/adapter110/$N ] ; then printf
dvb/adapter110/%%s $${K#*.}; else printf dvb/adapter111/%%s $${K#*.}; fi ;
exit 0'", SYMLINK+="%c"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20100417/13709711/attachment.htm>
More information about the mythtv-users
mailing list