cant get udev rule to work... ?

Fred Schaer fred.schaer at wanadoo.fr
Mon Nov 3 19:00:31 UTC 2008


Hi,

I followed this tutorial :
http://reactivated.net/writing_udev_rules.html

I have 2 TV cards : one pinnacle PCTV, and one Leadtek hybrid DVB/BTTV,
and what I need is to have the /dev/videoX device be made persistent
because the Leatek bttv part doesn't work. And even if it did, I don't
want to switch composite cable every time I restart.
Currently, when I start, the PCTV card can either be /dev/video0 or
/dev/video1

Si I wrote this udev rule :

$ cat /etc/udev/rules.d/10-local.rules
ATTR{name}=="*video _WinFast DTV2000*",NAME="video0"
ATTR{name}=="*vbi _WinFast DTV2000*",NAME="vbi0"
ATTR{name}=="*video _Pinnacle
PCTV*",ATTR{card}=="39",NAME="video1",SYMLINK+="pctvvideo"
ATTR{name}=="*vbi _Pinnacle PCTV*",NAME="vbi1",SYMLINK+="pctvvbi"

I tried setting the name to whatever (video1, vide0, video2), and same
with the vbi device... but NOTHING works. There's no symlink, nothing.
When I try udevtest, I always have this output :

$ udevtest /sys/class/video4linux/video1
(... cut here ...)
parse_file: reading '/etc/udev/rules.d/10-local.rules' as rules
file        
(... cut here ...)
import_uevent_var: import into environment: 'MAJOR=81'
import_uevent_var: import into environment: 'MINOR=1'
udevtest: looking at device
'/devices/pci0000:00/0000:00:1e.0/0000:05:01.0/video4linux/video1' from
subsystem 'video4linux'
udev_rules_get_name: no node name set, will use kernel name 'video1'
udev_db_get_device: found a symlink as db file
udev_device_event: device
'/devices/pci0000:00/0000:00:1e.0/0000:05:01.0/video4linux/video1'
already in database, cleanup
udev_node_add: creating device node '/dev/video1', major=81, minor=1,
mode=0660, uid=0, gid=44
udevtest: run: 'socket:/org/freedesktop/hal/udev_event'
udevtest: run: 'socket:/org/kernel/udev/monitor

same output with
$ udevtest /class/video4linux/video1

And of course, when I reboot, there's no symlink, I can't be sure of the
device name, and tvtime has one chance out of two of working...
So I'm stuck.
I don't understand what's wrong with this udev rule. Would anyone have
any idea ?
Any help would be greatly appreciated !

Thanks

P.S : the PCTV udevinfo details are :
$ udevinfo -a -p
/sys/class/video4linux/video1                                                            


Udevinfo 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:1e.0/0000:05:01.0/video4linux/video1':
   
KERNEL=="video1"                                                                  

   
SUBSYSTEM=="video4linux"                                                          

   
DRIVER==""                                                                        

   
ATTR{dev}=="81:1"                                                                 

    ATTR{name}=="BT878 video _Pinnacle PCTV
Stud"                                     
   
ATTR{card}=="39"                                                                  


  looking at parent device
'/devices/pci0000:00/0000:00:1e.0/0000:05:01.0/video4linux':
   
KERNELS=="video4linux"                                                            

   
SUBSYSTEMS==""                                                                    

   
DRIVERS==""                                                                       


  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:05:01.0':
    KERNELS=="0000:05:01.0"                                               
    SUBSYSTEMS=="pci"                                                     
    DRIVERS=="bttv"                                                       
    ATTRS{vendor}=="0x109e"                                               
    ATTRS{device}=="0x036e"                                               
    ATTRS{subsystem_vendor}=="0xbd11"                                     
    ATTRS{subsystem_device}=="0x1200"
    ATTRS{class}=="0x040000"
    ATTRS{irq}=="22"
    ATTRS{local_cpus}=="ff"
    ATTRS{modalias}=="pci:v0000109Ed0000036Esv0000BD11sd00001200bc04sc00i00"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00/0000:00:1e.0':
    KERNELS=="0000:00:1e.0"
    SUBSYSTEMS=="pci"
    DRIVERS==""
    ATTRS{vendor}=="0x8086"
    ATTRS{device}=="0x244e"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{class}=="0x060401"
    ATTRS{irq}=="0"
    ATTRS{local_cpus}=="ff"
    ATTRS{modalias}=="pci:v00008086d0000244Esv00000000sd00000000bc06sc04i01"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}=="1"

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






More information about the kubuntu-users mailing list