Code: Select all
/dev/dvb/adapter0 dvb T2
/dev/dvb/adapter1 dvb S2
Code: Select all
/dev/dvb/adapter0 dvb S2
/dev/dvb/adapter1 dvb T2
Code: Select all
/dev/dvb/adapterANYTHING -> /dev/dvb/adapterN
A long winded way of achieving this:
The first thing to note is that Mythtv 32 is aware of the /dev/dvb/adapterX naming scheme. The best (possibly correct) method I have found is to ensure that the 'permanent' or 'consistent' devices live in directory structures with that naming scheme. I chose to add new /dev/dvb/adapterXXXX names where I used alpha numerics which should prevent naming clashes.
Code: Select all
ls /dev/dvb/
adapter0 adapter1 adapter2 adapter3 adapterS960-1 adapterS960-2 adapterT2o adapterT2u
Code: Select all
root@i3nuc:/home/rshooter# ls -l /dev/dvb/
total 0
drwxr-xr-x 2 root root 120 Sep 5 21:26 adapter0
drwxr-xr-x 2 root root 120 Sep 5 21:26 adapter1
drwxr-xr-x 2 root root 120 Sep 5 21:26 adapter2
drwxr-xr-x 2 root root 120 Sep 5 21:26 adapter3
lrwxrwxrwx 1 root root 10 Sep 5 21:26 adapterS960-1 -> ./adapter2
lrwxrwxrwx 1 root root 10 Sep 5 21:26 adapterS960-2 -> ./adapter3
lrwxrwxrwx 1 root root 10 Sep 5 21:26 adapterT2o -> ./adapter1
lrwxrwxrwx 1 root root 10 Sep 5 21:26 adapterT2u -> ./adapter0
I created a script (/home/mythtv/createDVBDirLink.sh) which takes two arguments - an alias (UDEV SYMLINK) for the frontend0 of a device and the name of the /etc/dvb/adapterXXX to create based on that file. The frontend0 is in the /dev/dvb/adapterN I want.
Code: Select all
#!/bin/bash
# format is dvb/adapterX/frontend0
# we want adapterX
#
TGT=`readlink $1`
DR1=`dirname $TGT`
DR2=`basename $DR1`
ln -s ./${DR2} $2
Code: Select all
/home/mythtv/createDVBDirLink.sh /dev/otherDVBT2 /dev/dvb/adapterT2o
/home/mythtv/createDVBDirLink.sh /dev/uSoftDVBT2 /dev/dvb/adapterT2u
Taking this one step at a time, the first step is to create a UDEV rule to select your card, Start by creating a rule which creates a SYMLINK for one of the DVB device files (I used frontend0), for example using the udevadm command to get the information needed from the /sys/class/dvb/... devices
Code: Select all
rshooter@i3nuc:~$ udevadm info -a /sys/class/dvb/dvb0.frontend0
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/dvb/dvb0.frontend0':
KERNEL=="dvb0.frontend0"
SUBSYSTEM=="dvb"
DRIVER==""
ATTR{power/async}=="disabled"
ATTR{power/control}=="auto"
ATTR{power/runtime_active_kids}=="0"
ATTR{power/runtime_active_time}=="0"
ATTR{power/runtime_enabled}=="disabled"
ATTR{power/runtime_status}=="unsupported"
ATTR{power/runtime_suspended_time}=="0"
ATTR{power/runtime_usage}=="0"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1':
KERNELS=="2-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bMaxPower}=="500mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}=="0110"
ATTRS{bmAttributes}=="a0"
ATTRS{busnum}=="2"
ATTRS{configuration}==""
ATTRS{devnum}=="2"
ATTRS{devpath}=="1"
I USED THIS
ATTRS{idProduct}=="02d5"
I USED THIS
ATTRS{idVendor}=="045e"
ATTRS{ltm_capable}=="no"
I USED THIS
ATTRS{manufacturer}=="Microsoft Corp."
ATTRS{maxchild}=="0"
ATTRS{power/active_duration}=="5015496"
ATTRS{power/async}=="enabled"
ATTRS{power/autosuspend}=="2"
ATTRS{power/autosuspend_delay_ms}=="2000"
ATTRS{power/connected_duration}=="5015496"
ATTRS{power/control}=="on"
ATTRS{power/level}=="on"
ATTRS{power/persist}=="1"
ATTRS{power/runtime_active_kids}=="1"
ATTRS{power/runtime_active_time}=="5015218"
ATTRS{power/runtime_enabled}=="forbidden"
ATTRS{power/runtime_status}=="active"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{power/runtime_usage}=="1"
ATTRS{power/wakeup}=="disabled"
ATTRS{power/wakeup_abort_count}==""
ATTRS{power/wakeup_active}==""
ATTRS{power/wakeup_active_count}==""
ATTRS{power/wakeup_count}==""
ATTRS{power/wakeup_expire_count}==""
ATTRS{power/wakeup_last_time_ms}==""
ATTRS{power/wakeup_max_time_ms}==""
ATTRS{power/wakeup_total_time_ms}==""
ATTRS{product}=="Xbox USB Tuner"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="removable"
ATTRS{rx_lanes}=="1"
ATTRS{serial}=="002378290915"
ATTRS{speed}=="480"
ATTRS{tx_lanes}=="1"
ATTRS{urbnum}=="290523"
ATTRS{version}==" 2.00"
Code: Select all
KERNEL=="dvb?.frontend0", ATTRS{manufacturer}=="Microsoft Corp.", ATTRS{idProduct}=="02d5", ATTRS{idVendor}=="045e", SYMLINK+="uSoftDVBT2"
Code: Select all
KERNEL=="dvb?.frontend0", ATTRS{manufacturer}=="Microsoft Corp.", ATTRS{idProduct}=="02d5", ATTRS{idVendor}=="045e", SYMLINK+="uSoftDVBT2", RUN+="/home/mythtv/createDVBDirLink.sh /dev/uSoftDVBT2 /dev/dvb/adapterT2u"
Code: Select all
ls -l /dev/uSoftDVBT2
lrwxrwxrwx 1 root root 22 Sep 5 21:26 /dev/uSoftDVBT2 -> dvb/adapter0/frontend0
Code: Select all
ls -l /dev/dvb
lrwxrwxrwx 1 root root 10 Sep 5 21:26 adapterT2u -> ./adapter0
Code: Select all
KERNEL=="dvb?.frontend0", ATTRS{idProduct}=="c688", ATTRS{idVendor}=="0572", SYMLINK="otherDVBT2", RUN+="/home/mythtv/createDVBDirLink.sh /dev/otherDVBT2 /dev/dvb/adapterT2o"
This is the UDEV rules file I used, created at /etc/udev/rules.d/mythtv-devices.rules
Code: Select all
# udevadm info -a /sys/class/dvb/...
#
KERNEL=="dvb?.frontend0", ATTRS{idProduct}=="c688", ATTRS{idVendor}=="0572", SYMLINK="otherDVBT2", RUN+="/home/mythtv/createDVBDirLink.sh /dev/otherDVBT2 /dev/dvb/adapterT2o"
# uSoft
KERNEL=="dvb?.frontend0", ATTRS{manufacturer}=="Microsoft Corp.", ATTRS{idProduct}=="02d5", ATTRS{idVendor}=="045e", SYMLINK+="uSoftDVBT2", RUN+="/home/mythtv/createDVBDirLink.sh /dev/uSoftDVBT2 /dev/dvb/adapterT2u"
#
KERNEL=="dvb?.frontend0", ATTRS{product}=="S960", ATTRS{idProduct}=="6831", ATTRS{idVendor}=="0572", PROGRAM="/bin/sh -c ' K=%k; K=$${K#dvb}; N=$${K#*.}; if [ ! -e /dev/S960-1 ] ; then printf S960-1; else printf S960-2; fi ; exit 0'", SYMLINK+="%c", RUN+="/home/mythtv/createDVBDirLink.sh /dev/%c /dev/dvb/adapter%c"