Skip to contentSkip to conversation

Strange udev issue

DISCUSSION Derek Meek 1 participant 1 message Nov 16, 2006

lore
Share & tools
lore

Derek Meek

author
#0 lore raw

All my searching for help with udev got my directed here. I have a Fedora Core 5 system that I am running as a mythTv box. I am trying to setup udev rules to make symlinks to the various Hauppauge devices /dev/videoN head because occasionally they get swapped on boot up.

The strange part is udevtest /class/video4linux/videoN where N is either the 1st or 2nd head of my Hauppauge PVR-500 tells me that everything should work right. However upon bootup only the first head of the ivtv device has it's symlink's setup. I have to manually run udevstart two more times and then the second head has it's symlinks.

Here are my rules
[root@thorin ~]# cat /etc/udev/rules.d/55-ivtv.rules
# PVR-500 Head 1
DRIVER="ivtv", SYSFS{name}="ivtv? encoder MPEG", ID="0000:02:08.0", SYMLINK+="pvr_500_1"
DRIVER="ivtv", SYSFS{name}="ivtv? encoder PCM audio", ID="0000:02:08.0", SYMLINK+="pvr_500_1_audio"

# PVR-500 Head 2
DRIVER="ivtv", SYSFS{name}="ivtv? encoder MPEG", ID="0000:02:09.0", SYMLINK+="pvr_500_2"
DRIVER="ivtv", SYSFS{name}="ivtv? encoder PCM audio", ID="0000:02:09.0", SYMLINK+="pvr_500_2_audio"

here is the "lspci" for the two devices
02:08.0 Multimedia video controller: Internext Compression Inc iTVC16 (CX23416) MPEG-2 Encoder (rev 01)
02:09.0 Multimedia video controller: Internext Compression Inc iTVC16 (CX23416) MPEG-2 Encoder (rev 01)

and here is the udevinfo -a -p for the 1st and second MPEG encoders

[root@thorin ~]# udevinfo -a -p /class/video4linux/video1

udevinfo starts with the device the node belongs to and then walks up the device chain, to print for every device found, all possibly useful attributes
in the udev key format.
Only attributes within one device section may be used together in one rule, to match the device for which the node will be created.

looking at device '/class/video4linux/video1':

    KERNEL="video1"
    SUBSYSTEM="video4linux"
    SYSFS{name}="ivtv0 encoder MPEG"
    SYSFS{dev}="81:1"

looking at device '/devices/pci0000:00/0000:00:0a.0/0000:02:08.0':

    ID="0000:02:08.0"
    BUS="pci"
    DRIVER="ivtv"
    SYSFS{modalias}="pci:v00004444d00000016sv00000070sd0000E807bc04sc00i00"
    SYSFS{local_cpus}="1"
    SYSFS{irq}="20"
    SYSFS{class}="0x040000"
    SYSFS{subsystem_device}="0xe807"
    SYSFS{subsystem_vendor}="0x0070"
    SYSFS{device}="0x0016"
    SYSFS{vendor}="0x4444"

looking at device '/devices/pci0000:00/0000:00:0a.0':

    ID="0000:00:0a.0"
    BUS="pci"
    DRIVER=""
    SYSFS{modalias}="pci:v00003388d00000021sv00000000sd00000000bc06sc04i00"
    SYSFS{local_cpus}="1"
    SYSFS{irq}="0"
    SYSFS{class}="0x060400"
    SYSFS{subsystem_device}="0x0000"
    SYSFS{subsystem_vendor}="0x0000"
    SYSFS{device}="0x0021"
    SYSFS{vendor}="0x3388"

looking at device '/devices/pci0000:00':

    ID="pci0000:00"
    BUS=""
    DRIVER=""

[root@thorin ~]# udevinfo -a -p /class/video4linux/video2

udevinfo starts with the device the node belongs to and then walks up the device chain, to print for every device found, all possibly useful attributes
in the udev key format.
Only attributes within one device section may be used together in one rule, to match the device for which the node will be created.

looking at device '/class/video4linux/video2':

    KERNEL="video2"
    SUBSYSTEM="video4linux"
    SYSFS{name}="ivtv1 encoder MPEG"
    SYSFS{dev}="81:2"

looking at device '/devices/pci0000:00/0000:00:0a.0/0000:02:09.0':

    ID="0000:02:09.0"
    BUS="pci"
    DRIVER="ivtv"
    SYSFS{modalias}="pci:v00004444d00000016sv00000070sd0000E817bc04sc00i00"
    SYSFS{local_cpus}="1"
    SYSFS{irq}="21"
    SYSFS{class}="0x040000"
    SYSFS{subsystem_device}="0xe817"
    SYSFS{subsystem_vendor}="0x0070"
    SYSFS{device}="0x0016"
    SYSFS{vendor}="0x4444"

looking at device '/devices/pci0000:00/0000:00:0a.0':

    ID="0000:00:0a.0"
    BUS="pci"
    DRIVER=""
    SYSFS{modalias}="pci:v00003388d00000021sv00000000sd00000000bc06sc04i00"
    SYSFS{local_cpus}="1"
    SYSFS{irq}="0"
    SYSFS{class}="0x060400"
    SYSFS{subsystem_device}="0x0000"
    SYSFS{subsystem_vendor}="0x0000"
    SYSFS{device}="0x0021"
    SYSFS{vendor}="0x3388"

looking at device '/devices/pci0000:00':

    ID="pci0000:00"
    BUS=""
    DRIVER=""

udevtest output
[root@thorin ~]# udevtest /class/video4linux/video1
parse_file: line too long, rule skipped
/etc/udev/rules.d/60-libsane.rules, line 772
main: looking at device '/class/video4linux/video1' from subsystem
'video4linux'
udev_rules_get_name: add symlink 'pvr_500_1'
udev_rules_get_name: no node name set, will use kernel name 'video1'
create_node: creating device node '/dev/video1', major = '81', minor '1', mode = '0660', uid = '0', gid = '0'
create_node: creating symlink '/dev/pvr_500_1' to 'video1'
main: run: 'socket:/org/kernel/udev/monitor'
main: run: '/lib/udev/udev_run_devd'
main: run: 'socket:/org/freedesktop/hal/udev_event'
main: run: '/sbin/pam_console_apply /dev/video1 /dev/pvr_500_1'
[root@thorin ~]# udevtest /class/video4linux/video2
parse_file: line too long, rule skipped
/etc/udev/rules.d/60-libsane.rules, line 772
main: looking at device '/class/video4linux/video2' from subsystem
'video4linux'
udev_rules_get_name: add symlink 'pvr_500_2'
udev_rules_get_name: no node name set, will use kernel name 'video2'
create_node: creating device node '/dev/video2', major = '81', minor '2', mode = '0660', uid = '0', gid = '0'
create_node: creating symlink '/dev/pvr_500_2' to 'video2'
main: run: 'socket:/org/kernel/udev/monitor'
main: run: '/lib/udev/udev_run_devd'
main: run: 'socket:/org/freedesktop/hal/udev_event'
main: run: '/sbin/pam_console_apply /dev/video2 /dev/pvr_500_2'

(/dev/video0 is currently occupied by a BTTV device)

Signature · 14 lines
Derek "Kazan" Meek
----------------------------------------------------------------------------------------
“Is God willing to prevent evil, but not able? Then he is impotent. Is he able, but not willing? Then he is malevolent. Is he both able and willing? Whence then is evil?” - Epicurus


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID�VDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel