<---- template headericclude ----->
Persistent DVB node - udev? HELP
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Persistent DVB node - udev? HELP

    I have a problem whereby I need to pin a specific DVB PCI card by PCI slot/PCI address to a dvb node (/dev/dvb/adaptor*), at the moment my system has two (almost identical) cards from the same manufacturer (TechnoTrend/Hauppauge), however one is DVB-T and one is DVB-S.
    As far as udev is concerned they report similarly, so things get really messed up when on one boot, the DVB-T is /dev/dvb/adaptor0 and the DVB-S is /dev/dvb/adaptor1 on the next boot they are reversed (the DVB-T is /dev/dvb/adaptor1 and the DVB-S is /dev/dvb/adaptor0).

    I am really not passionate about whether I use UDEV or load modules manually to achieve my objective of persistent mapping of PCI Slots/PCI addresses to DVB node’s. The latter is probably preferable, as I have been bugging guys on the UDEV mailing list for months, and I just can’t get things to play nice in Fedora, although I am assured things work in Gentoo.

    If I allow the standard UDEV rules to run, and execute "udevinfo -a -p $(udevinfo -q path -n /dev/dvb/adapter0/frontend0)" the response is -
    looking at device '/class/dvb/dvb0.frontend0':
    KERNEL=="dvb0.frontend0"
    SUBSYSTEM=="dvb"
    DRIVER==""
    ATTR{dev}=="212:3"

    looking at parent device '/devices/pci0000:00/0000:00:10.0/0000:01:06.0':
    KERNELS=="0000:01:06.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="budget_ci dvb"
    ATTRS{msi_bus}==""
    ATTRS{broken_parity_status}=="0"
    ATTRS{enable}=="1"
    ATTRS{modalias}=="pci:v00001131d00007146sv000013C2 sd00001017bc04sc80i00"
    ATTRS{local_cpus}=="ffffffff"
    ATTRS{irq}=="20"
    ATTRS{class}=="0x048000"
    ATTRS{subsystem_device}=="0x1017"
    ATTRS{subsystem_vendor}=="0x13c2"
    ATTRS{device}=="0x7146"
    ATTRS{vendor}=="0x1131"

    looking at parent device '/devices/pci0000:00/0000:00:10.0':
    KERNELS=="0000:00:10.0"
    SUBSYSTEMS=="pci"
    DRIVERS==""
    ATTRS{msi_bus}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{enable}=="1"
    ATTRS{modalias}=="pci:v000010DEd0000026Fsv00000000 sd00000000bc06sc04i01"
    ATTRS{local_cpus}=="ffffffff"
    ATTRS{irq}=="0"
    ATTRS{class}=="0x060401"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{device}=="0x026f"
    ATTRS{vendor}=="0x10de"

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

    looking at device '/class/dvb/dvb1.frontend0':
    KERNEL=="dvb1.frontend0"
    SUBSYSTEM=="dvb"
    DRIVER==""
    ATTR{dev}=="212:67"

    The other adaptor yields the following response (to "udevinfo -a -p $(udevinfo -q path -n /dev/dvb/adapter1/frontend0)")-
    looking at parent device '/devices/pci0000:00/0000:00:10.0/0000:01:08.0':
    KERNELS=="0000:01:08.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="budget dvb"
    ATTRS{msi_bus}==""
    ATTRS{broken_parity_status}=="0"
    ATTRS{enable}=="1"
    ATTRS{modalias}=="pci:v00001131d00007146sv000013C2 sd00001005bc04sc80i00"
    ATTRS{local_cpus}=="ffffffff"
    ATTRS{irq}=="21"
    ATTRS{class}=="0x048000"
    ATTRS{subsystem_device}=="0x1005"
    ATTRS{subsystem_vendor}=="0x13c2"
    ATTRS{device}=="0x7146"
    ATTRS{vendor}=="0x1131"

    looking at parent device '/devices/pci0000:00/0000:00:10.0':
    KERNELS=="0000:00:10.0"
    SUBSYSTEMS=="pci"
    DRIVERS==""
    ATTRS{msi_bus}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{enable}=="1"
    ATTRS{modalias}=="pci:v000010DEd0000026Fsv00000000 sd00000000bc06sc04i01"
    ATTRS{local_cpus}=="ffffffff"
    ATTRS{irq}=="0"
    ATTRS{class}=="0x060401"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{device}=="0x026f"
    ATTRS{vendor}=="0x10de"

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

    For those interested the following config apparently should work according to peeps off the UDEV list –

    My DVB section of /etc/udev/rules.d/50-udev.rules is as follows -

    # DVB
    KERNEL=="dvb", MODE="0660"
    SUBSYSTEM!="dvb", GOTO="dvb_end"
    ACTION!="add", GOTO="dvb_end"

    GROUP="video"
    import{PROGRAM}="/bin/sh -c 'K=%k; K=$${K#dvb}; echo ID_DVB_ADAPTER_KERNEL=$${K%%%%.*}; echo ID_DVB_DEVICE=$${K#*.}'"

    IMPORT{program}="path_id %p"

    #Here set ID_DVB_ADAPTER to be persistent # example:
    ENV{ID_PATH}=="pci-0000:01:08.0", ENV{ID_DVB_ADAPTER}="3"
    ENV{ID_PATH}=="pci-0000:01:06.0", ENV{ID_DVB_ADAPTER}="2"

    # fallback-number
    ENV{ID_DVB_ADAPTER_KERNEL}=="?*", ENV{ID_DVB_ADAPTER}!="?*", ENV{ID_DVB_ADAPTER}="$env{ID_DVB_ADAPTER_KERNEL}"

    # Create device
    ENV{ID_DVB_ADAPTER}=="?*", ENV{ID_DVB_DEVICE}=="?*", NAME="dvb/adapter$env{ID_DVB_ADAPTER}/$env{ID_DVB_DEVICE}"

    LABEL="dvb_end"

    I have updated the final section of /sbin/path_id (when I was playing with FC5) to -

    case "$TYPE" in
    block)
    handle_block
    ;;
    dvb)
    handle_device
    echo "ID_PATH=$d"
    ;;
    *)
    RESULT=1
    ;;
    esac


    or more recently /lib/udev/path_id in F7, to -

    case "$TYPE" in
    block)
    handle_device
    echo "ID_PATH=$d"
    ;;
    dvb)
    handle_device
    echo "ID_PATH=$d"
    ;;
    scsi_tape)
    handle_device
    echo "ID_PATH=$d"
    ;;
    input)
    handle_device
    echo "ID_PATH=$d"
    ;;
    *)
    RESULT=1
    ;;
    esac


    Unfortunately the dvb adaptors still load as 0 and 1 as opposed to 2 and 3 as expected.

    HELP!!

  2. #2
    Join Date
    Nov 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    create file '/etc/udev/rules.d/51-persistent-dvb.rules' with strings:

    Code:
    # DVB persistent number according to PCI number
    SUBSYSTEM=="dvb", ACTION=="add", ENV{PHYSDEVPATH}=="*03:00.0", NAME="dvb/adapter$env{DVB_ADAPTER_NUM}/$env{DVB_DEVICE_TYPE}$env{DVB_DEVICE_NUM}"
    SUBSYSTEM=="dvb", ACTION=="add", ENV{PHYSDEVPATH}=="*04:00.0", NAME="dvb/adapter1$env{DVB_ADAPTER_NUM}/$env{DVB_DEVICE_TYPE}$env{DVB_DEVICE_NUM}"

    Change 03:00.0 and 04:00.0 to your PCI numbers. You can check it using command 'lspci'.

    reboot.

Similar Threads

  1. Persistent Layer..not so much persistent
    By LDC in forum Using Fedora
    Replies: 5
    Last Post: 14th October 2008, 07:52 PM
  2. re-create udev persistent rules, how?
    By Paavo in forum Installation, Upgrades and Live Media
    Replies: 3
    Last Post: 13th October 2008, 07:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]