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

Razza ray at brambletree.net
Fri Apr 27 10:10:56 UTC 2007


Razza wrote on 25 April 2007 23:27:
> To: 'Discussion about mythtv'
> Subject: Re: [mythtv-users] OT advice on DVB card numbering
> 
> Michael T. Dean wrote on 25 April 2007 15:22:
> > On 04/25/2007 09:03 AM, Neil Bothwick wrote:
> > > On Wed, 25 Apr 2007 13:28:49 +0100, Razza wrote:
> > >> How can I pin a specific card to a specific /dev/dvb/adaptor
> address
> > >> and/or IRQ ?
> > > You can do this with a couple of udev rules. there's a good guide
> to
> > > writing them at http://www.reactivated.net/udevrules.php
> >
> > And search the list archives for "reactivated.net" (no quotes) to see
> > some of the rules users have posted once they figured it out.
> >
> > Mike
> 
> Thanks for the pointers, interesting reading but not a simple subject.
> 
> I assume that because I will be using numerous identical pci cards
> (i.e.
> same SYSFS{vendor}/SYSFS{device}/etc.), the best method to set up the
> udev
> rules would be based on the PCI addresses?
> "lspci -v" yields the following response for me -
> 
> 01:06.0 Multimedia controller: Philips Semiconductors SAA7146 (rev 01)
>         Subsystem: Technotrend Systemtechnik GmbH Unknown device 1017
>         Flags: bus master, medium devsel, latency 32, IRQ 20
>         Memory at e9000000 (32-bit, non-prefetchable) [size=512]
> 
> 01:08.0 Multimedia controller: Philips Semiconductors SAA7146 (rev 01)
>         Subsystem: Technotrend Systemtechnik GmbH Technotrend-Budget /
> Hauppauge WinTV-NOVA-T DVB card
>         Flags: bus master, medium devsel, latency 32, IRQ 22
>         Memory at e9001000 (32-bit, non-prefetchable) [size=512]
> 
> 01:09.0 Multimedia video controller: Internext Compression Inc iTVC16
> (CX23416) MPEG-2 Encoder (rev 01)
>         Subsystem: Hauppauge computer works Inc. Unknown device 8801
>         Flags: bus master, medium devsel, latency 64, IRQ 21
>         Memory at e0000000 (32-bit, prefetchable) [size=64M]
>         Capabilities: [44] Power Management version 2
> 
> Executing "udevinfo -a -p $(udevinfo -q path -n
> /dev/dvb/adapter0/frontend0)" yields -
> 
>   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"
> 
>   looking at device '/devices/pci0000:00':
>     ID=="pci0000:00"
>     BUS==""
>     DRIVER==""
> 
> 
> So I assume rules placed in "/etc/udev/rules.d/50-udev.rules" as
> follows,
> for each card would be the best approach -
> 
> ID=="0000:01:06.0", SYSFS{device}=="0x7146", SYSFS{vendor}=="0x1131",
> SYMLINK="/dev/dvb/adapter3/ca0"
> ID=="0000:01:06.0", SYSFS{device}=="0x7146", SYSFS{vendor}=="0x1131",
> SYMLINK="/dev/dvb/adapter3/demux0"
> ID=="0000:01:06.0", SYSFS{device}=="0x7146", SYSFS{vendor}=="0x1131",
> SYMLINK="/dev/dvb/adapter3/dvr0"
> ID=="0000:01:06.0", SYSFS{device}=="0x7146", SYSFS{vendor}=="0x1131",
> SYMLINK="/dev/dvb/adapter3/frontend0"
> ID=="0000:01:06.0", SYSFS{device}=="0x7146", SYSFS{vendor}=="0x1131",
> SYMLINK="/dev/dvb/adapter3/net0"
> 
> Apologies for being over cautious, but I managed to mess up my raid
> array
> over the weekend after loading all my media, and want to avoid another
> similar traumatic episode!

Ok the above rules failed, I ended up getting only one node created per
card, which was the last in the ruleset (e.g. /dev/dvb/adapter3/net0).

I have been playing with udev a little more but getting the (NAME) rule
right is confusing me. I am running Fedora Core 5 and have the following
standard rule in "/etc/udev/rules.d/50-udev.rules" -

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

The closest I got to getting things working was by substituting
"dvb/adapter%%i/" with "dvb/adapter5/", thus forcing the adapter to
/dev/dvb/adapter5, rule below -

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"

Unfortunately that changed the tree structure from -

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

To -

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

Can anyone please advise on what the rule should look like?

I have posted on the linux-dvb mailing list also, if/when I get this sorted
I will create a wiki entry.




















More information about the mythtv-users mailing list