[mythtv-users] UDEV rules

Daryl McDonald darylangela at gmail.com
Wed Jan 22 15:54:50 UTC 2014


On Wed, Jan 22, 2014 at 8:51 AM, George Nassas <gnassas at mac.com> wrote:
> On Jan 22, 2014, at 1:59 AM, Yianni <yiannividalis at hotmail.com> wrote:
>
>>> Do you think I should create further rules for the other cards in my box?
>>>
>> I'd recommend it, because it is worth the time you'll spend setting it up. Once you get your rules working you won't have to worry about device naming anymore.
>
> You're going to need a rule for your other analog card if you intend to use its analog side as well.
>
> Besides what Yanni has said there are two helpful udevadm options when developing rules.
>
> One is:
>
>         udevadm test $(udevadm info -q path -n /dev/video0)
>
> which will show you which rules files are getting considered and what actions are taken. Look for an output line beginning with DEVLINKS to see if your rule is matching and firing.
>
> The other is:
>
>         udevadm trigger $(udevadm info -q path -n /dev/video0)
>
> which will execute the rules for real. Together they save a lot of rebooting while experimenting.
>
> - George
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users

With the following rules edited in and rebooted, the terminal shows the next:

KERNEL=="video?",SUBSYSTEM=="video4linux",ATTRS{subsystem_vendor}=="0x0070",ATTRS{device}=="0x0016",SYMLINK+="videopvr150",GROUP="video"
KERNEL=="video?",SUBSYSTEM=="video4linux",ATTRS{subsystem_vendor}=="0x0070",ATTRS{device}=="0x8852",SYMLINK+="digital1250",GROUP="video"
KERNEL=="video?",SUBSYSTEM=="video4linux",ATTRS{subsystem_vendor}=="0x17de",ATTRS{device}=="0x1733",SYMLINK+="videoKworld",GROUP="video"

daryl at daryl-A780L3C:~$ ls -lah /dev/video*
crw-rw----+ 1 root video 81, 0 Jan 22 10:26 /dev/video0
crw-rw----+ 1 root video 81, 5 Jan 22 10:26 /dev/video1
crw-rw----+ 1 root video 81, 7 Jan 22 10:27 /dev/video2
crw-rw----+ 1 root video 81, 3 Jan 22 10:26 /dev/video24
crw-rw----+ 1 root video 81, 1 Jan 22 10:26 /dev/video32
lrwxrwxrwx  1 root root      6 Jan 22 10:26 /dev/videopvr150 -> video0
daryl at daryl-A780L3C:~$ ls -lah /dev/dvb*
total 0
drwxr-xr-x  4 root root   80 Jan 22 10:27 .
drwxr-xr-x 16 root root 4.6K Jan 22 10:27 ..
drwxr-xr-x  2 root root  120 Jan 22 10:26 adapter0
drwxr-xr-x  2 root root  120 Jan 22 10:27 adapter1
daryl at daryl-A780L3C:~$ udevadm trigger $(udevadm info -q path -n /dev/video0)
daryl at daryl-A780L3C:~$ udevadm info -a -p $(udevadm info -q path -n /dev/video1)

Apparently I still don't get writing UDEV rules. I have three cards
which support five recording formats; video0, video1, video2,
adapter0, and adapter1. Because video0 has a working rule, info from
the terminal is for the four remaining formats:

daryl at daryl-A780L3C:~$ udevadm info -a -p $(udevadm info -q path -n /dev/video1)

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:04.0/0000:02:00.0/video4linux/video1':
    KERNEL=="video1"
    SUBSYSTEM=="video4linux"
    DRIVER==""
    ATTR{name}=="Hauppauge WinTV-HVR1250 (video)"
    ATTR{index}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:04.0/0000:02:00.0':
    KERNELS=="0000:02:00.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="cx23885"
    ATTRS{irq}=="16"
    ATTRS{subsystem_vendor}=="0x0070"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x040000"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000007"
    ATTRS{device}=="0x8852"
    ATTRS{msi_bus}==""
    ATTRS{local_cpulist}=="0-2"
    ATTRS{vendor}=="0x14f1"
    ATTRS{subsystem_device}=="0x7911"
    ATTRS{numa_node}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:04.0':
    KERNELS=="0000:00:04.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="pcieport"
    ATTRS{irq}=="41"
    ATTRS{subsystem_vendor}=="0x1019"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x060400"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000007"
    ATTRS{device}=="0x9604"
    ATTRS{msi_bus}=="1"
    ATTRS{local_cpulist}=="0-2"
    ATTRS{vendor}=="0x1022"
    ATTRS{subsystem_device}=="0x2285"
    ATTRS{numa_node}=="0"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

daryl at daryl-A780L3C:~$ udevadm info -a -p $(udevadm info -q path -n /dev/video2)

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.4/0000:04:00.0/video4linux/video2':
    KERNEL=="video2"
    SUBSYSTEM=="video4linux"
    DRIVER==""
    ATTR{name}=="saa7133[0] video (Kworld PC150-"
    ATTR{index}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:14.4/0000:04:00.0':
    KERNELS=="0000:04:00.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="saa7134"
    ATTRS{irq}=="20"
    ATTRS{subsystem_vendor}=="0x17de"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x048000"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000007"
    ATTRS{device}=="0x7133"
    ATTRS{msi_bus}==""
    ATTRS{local_cpulist}=="0-2"
    ATTRS{vendor}=="0x1131"
    ATTRS{subsystem_device}=="0xa135"
    ATTRS{numa_node}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:14.4':
    KERNELS=="0000:00:14.4"
    SUBSYSTEMS=="pci"
    DRIVERS==""
    ATTRS{irq}=="0"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x060401"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000007"
    ATTRS{device}=="0x4384"
    ATTRS{msi_bus}=="1"
    ATTRS{local_cpulist}=="0-2"
    ATTRS{vendor}=="0x1002"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{numa_node}=="0"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

daryl at daryl-A780L3C:~$ udevadm info -a -p $(udevadm info -q path -n
/dev/dvb/adapter0/dvr0)

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:04.0/0000:02:00.0/dvb/dvb0.dvr0':
    KERNEL=="dvb0.dvr0"
    SUBSYSTEM=="dvb"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:04.0/0000:02:00.0':
    KERNELS=="0000:02:00.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="cx23885"
    ATTRS{irq}=="16"
    ATTRS{subsystem_vendor}=="0x0070"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x040000"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000007"
    ATTRS{device}=="0x8852"
    ATTRS{msi_bus}==""
    ATTRS{local_cpulist}=="0-2"
    ATTRS{vendor}=="0x14f1"
    ATTRS{subsystem_device}=="0x7911"
    ATTRS{numa_node}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:04.0':
    KERNELS=="0000:00:04.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="pcieport"
    ATTRS{irq}=="41"
    ATTRS{subsystem_vendor}=="0x1019"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x060400"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000007"
    ATTRS{device}=="0x9604"
    ATTRS{msi_bus}=="1"
    ATTRS{local_cpulist}=="0-2"
    ATTRS{vendor}=="0x1022"
    ATTRS{subsystem_device}=="0x2285"
    ATTRS{numa_node}=="0"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

daryl at daryl-A780L3C:~$ udevadm info -a -p $(udevadm info -q path -n
/dev/dvb/adapter1/dvr0)

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.4/0000:04:00.0/dvb/dvb1.dvr0':
    KERNEL=="dvb1.dvr0"
    SUBSYSTEM=="dvb"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:14.4/0000:04:00.0':
    KERNELS=="0000:04:00.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="saa7134"
    ATTRS{irq}=="20"
    ATTRS{subsystem_vendor}=="0x17de"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x048000"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000007"
    ATTRS{device}=="0x7133"
    ATTRS{msi_bus}==""
    ATTRS{local_cpulist}=="0-2"
    ATTRS{vendor}=="0x1131"
    ATTRS{subsystem_device}=="0xa135"
    ATTRS{numa_node}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:14.4':
    KERNELS=="0000:00:14.4"
    SUBSYSTEMS=="pci"
    DRIVERS==""
    ATTRS{irq}=="0"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x060401"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000007"
    ATTRS{device}=="0x4384"
    ATTRS{msi_bus}=="1"
    ATTRS{local_cpulist}=="0-2"
    ATTRS{vendor}=="0x1002"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{numa_node}=="0"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

daryl at daryl-A780L3C:~$

Further, I didn't do very well with your test George:

daryl at daryl-A780L3C:~$ udevadm trigger $(udevadm info -q path -n /dev/video0)
daryl at daryl-A780L3C:~$

Thanks Daryl


More information about the mythtv-users mailing list