[mythtv-users] UDEV rules for tuner numbering consistency

Andrew Gallatin gallatin at cs.duke.edu
Thu Jan 17 18:18:00 UTC 2008


Brian Jameson [tech at jameson.co.uk] wrote:
> My Fedora 8, kernel 2.6.23.9-85.fc8 running version 0.20.2-171 of MythTV has
> a Nova T 500 twin tuner and a Nova S tuner card in it. So all DVB based.
> Like other users on this list I have suffered from the tuner cards changing
> their numbering/identification depending on cold starts/re-boots and now
> software updates. After much googling, reading and trying my hand at
> creating some UDEV rules I have totally failed to make any progress in

Do the Nova T DVB cards have unique MAC addresses when
configured with dvbnet?  

I have a script I use to create unique links based on the unique MAC
addresses of my different DVB cards.  I run it from the mythbackend.sh
startup script, and use /dev/dvb/adapter[456] in myth, rather than the
real adaptors.  No udev mucking required.

I've appended an edited version in case it helps.

Drew

#!/bin/bash

#
# This script will make links in /dev/dvb/adaptorN such that
# /dev/dvb/adaptor4 == dvico fusion hdtv5 gold 
# /dev/dvb/adaptor5 == air2pc hd5000
# /dev/dvb/adaptor6 == air2pc airstar 2

HD5000_MAC="00:D0:D7:0X:XX:XX"
FUSION_MAC="00:00:00:00:00:00"
AIRSTAR_MAC="00:D0:D7:0Y:YY:YY"

# remove old links
i=0
while [ $i -lt 9 ]; do
    dev="/dev/dvb/adapter"$i
    if [ -L $dev ] ; then
	rm -f $dev
    fi
    let i=i+1
done


# sort out cards

i=0
while [ $i -lt 4 ]; do
    dev="/dev/dvb/adapter"$i
    if [ -d $dev ] ; then
	dvbnet -a $i -p 1 > /dev/null 2>&1
	if `ifconfig -a | grep dvb | grep -q $FUSION_MAC` ; then
	    ln -s $dev /dev/dvb/adapter4
	fi
	if `ifconfig -a | grep dvb | grep -q $HD5000_MAC` ; then
	    ln -s $dev /dev/dvb/adapter5
	fi
	if `ifconfig -a | grep dvb | grep -q $AIRSTAR_MAC` ; then
	    ln -s $dev /dev/dvb/adapter6
	fi
	dvbnet -a $i -d 0 > /dev/null 2>&1
    fi
    let i=i+1
done




More information about the mythtv-users mailing list