[mythtv-users] OT UDEV advice on DVB card numbering

Razza ray at brambletree.net
Fri Apr 27 21:26:04 UTC 2007


Rod Smith wrote on 27 April 2007 16:33:
> Sorry I missed your first posting and subsequent discussion. You might
> want to check out a wiki entry I created on using udev:
> 
> http://www.mythtv.org/wiki/index.php/Device_Filenames_and_udev
> 
> I confess I haven't tried any of this with DVB devices, but the
> principles should still apply. The trick is that you'll need to locate
UNIQUE keys
> for each card and device. This might be impossible if you've got two or
> more identical cards, although you might be able to use an IRQ, PCI ID, or
> the like.

Cheers Rod, i'm sure i'm moving forward, with the various references I have
found and been pointed too?!
I think the problem I am now having, is the original rule I tried to modify
was written for a different layer in the hardware/kernel stack. My "udevinfo
-a -p $(udevinfo -q path -n /dev/dvb/adapter0/frontend0)" response is -

  looking at device '/class/dvb/dvb0.frontend0':
    KERNEL=="dvb0.frontend0"
    SUBSYSTEM=="dvb"
    SYSFS{dev}=="212:3"

  looking at device '/devices/pci0000:00/0000:00:10.0/0000:01:06.0':
    ID=="0000:01:06.0"
    BUS=="pci"
    DRIVER=="budget_ci dvb"
    SYSFS{msi_bus}==""
    SYSFS{broken_parity_status}=="0"
    SYSFS{enable}=="1"
    SYSFS{modalias}=="pci:v00001131d00007146sv000013C2sd00001017bc04sc80i00"
    SYSFS{local_cpus}=="1"
    SYSFS{irq}=="18"
    SYSFS{class}=="0x048000"
    SYSFS{subsystem_device}=="0x1017"
    SYSFS{subsystem_vendor}=="0x13c2"
    SYSFS{device}=="0x7146"
    SYSFS{vendor}=="0x1131"

  looking at device '/devices/pci0000:00/0000:00:10.0':
    ID=="0000:00:10.0"
    BUS=="pci"
    DRIVER==""
    SYSFS{msi_bus}=="1"
    SYSFS{broken_parity_status}=="0"
    SYSFS{enable}=="1"
    SYSFS{modalias}=="pci:v000010DEd0000026Fsv00000000sd00000000bc06sc04i01"
    SYSFS{local_cpus}=="1"
    SYSFS{irq}=="0"
    SYSFS{class}=="0x060401"
    SYSFS{subsystem_device}=="0x0000"
    SYSFS{subsystem_vendor}=="0x0000"
    SYSFS{device}=="0x026f"
    SYSFS{vendor}=="0x10de"

The standard rule in my "/etc/udev/rules.d/50-udev.rules" is -

SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf
dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0660"

Which appears to be pertinent to the top section of the response above, the
rule I am using - 

BUS=="pci", ID=="0000:01:06.0", SYSFS{device}=="0x7146",
SYSFS{vendor}=="0x1131", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf
dvb/adapter5/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0660"

is based on the second block of the response (as I can only identify my
cards accurately by PCI slot/ID) which I think is deeper in the hardware
stack, hence the additional levels in the (/dev/dvb) tree created by my rule
-

/dev/dvb/
`-- adapter5
    |-- 0dvb
    |   `-- adapter5
    |       |-- ca0
    |       |-- demux0
    |       |-- dvr0
    |       |-- frontend0
    |       `-- net0
    `-- event3dvb
        `-- adapter5
            `-- event3

I think, I need to work out exactly what is going on in my modified rule,
section by section, then filter out the information/layers which are of no
use.
I am not a linux expert, so the following comments are based on googling and
assumption! If I look at the 'action' part of my rule - 

PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter5/%%s $${K%%%%.*}
$${K#*.}'"

I can see that it is running a shell script....
K=%k ....means variable K is being set as the kernel name for the device?
K=$${K#dvb} .... can't understand this bit at all!

What I need to see is what being returned at each stage (above), but I can't
seem to push any info into a text file for analysis when the rules run.

Any help/guidance/guesswork/prayers greatly appreciated!







More information about the mythtv-users mailing list