[mythtv-users] Irratic PVR250 ivtv module load - Ubuntu
Andrew C. Stadt
acstadt at stadt.ca
Tue Jul 13 06:15:37 UTC 2010
On 13/07/2010 12:49 AM, Douglas Peale wrote:
> On 07/12/2010 08:56 PM, John Drescher wrote:
>
>>> It seems that everyone has their own opinion - some say udev rules
>>> aren't so good, others swear by them.
>>> I don't see any ivtv named files in: /lib/udev/rules.d I would have
>>> to figure out how it all works!
>>>
>>>
> I just spent a bunch of time trying to figure out how to get udev rules to work without success.
> I first looked at this: http://reactivated.net/writing_udev_rules.html
> Until I got to the instructions about udevinfo. udevinfo does not exist on Ubuntu, so these instructions are obsolete.
>
> I then looked at this: http://hackaday.com/2009/09/18/how-to-write-udev-rules/
> Not quite what I want, but they gave me the clue about udevadm.
>
> Combining the udevadm with the first document I got this data about a webcam and a TV tuner from my system:
> $ udevadm info -a -p $(udevadm info -q path -n /dev/video0)
>
> 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:1d.7/usb2/2-1/2-1.3/2-1.3:1.0/video4linux/video0':
> KERNEL=="video0"
> SUBSYSTEM=="video4linux"
> DRIVER==""
> ATTR{index}=="0"
>
> looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3:1.0':
> KERNELS=="2-1.3:1.0"
> SUBSYSTEMS=="usb"
> DRIVERS=="uvcvideo"
> ATTRS{bInterfaceNumber}=="00"
> ATTRS{bAlternateSetting}==" 0"
> ATTRS{bNumEndpoints}=="01"
> ATTRS{bInterfaceClass}=="0e"
> ATTRS{bInterfaceSubClass}=="01"
> ATTRS{bInterfaceProtocol}=="00"
> ATTRS{modalias}=="usb:v045Ep075Dd0105dcEFdsc02dp01ic0Eisc01ip00"
> ATTRS{supports_autosuspend}=="1"
> ATTRS{iad_bFirstInterface}=="00"
> ATTRS{iad_bInterfaceCount}=="02"
> ATTRS{iad_bFunctionClass}=="0e"
> ATTRS{iad_bFunctionSubClass}=="03"
> ATTRS{iad_bFunctionProtocol}=="00"
>
> looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3':
> KERNELS=="2-1.3"
> SUBSYSTEMS=="usb"
> DRIVERS=="usb"
> ATTRS{configuration}==""
> ATTRS{bNumInterfaces}==" 4"
> ATTRS{bConfigurationValue}=="1"
> ATTRS{bmAttributes}=="80"
> ATTRS{bMaxPower}=="500mA"
> ATTRS{urbnum}=="5839"
> ATTRS{idVendor}=="045e"
> ATTRS{idProduct}=="075d"
> ATTRS{bcdDevice}=="0105"
> ATTRS{bDeviceClass}=="ef"
> ATTRS{bDeviceSubClass}=="02"
> ATTRS{bDeviceProtocol}=="01"
> ATTRS{bNumConfigurations}=="1"
> ATTRS{bMaxPacketSize0}=="64"
> ATTRS{speed}=="480"
> ATTRS{busnum}=="2"
> ATTRS{devnum}=="5"
> ATTRS{version}==" 2.00"
> ATTRS{maxchild}=="0"
> ATTRS{quirks}=="0x0"
> ATTRS{authorized}=="1"
> ATTRS{manufacturer}=="Microsoft"
>
> looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-1':
> KERNELS=="2-1"
> SUBSYSTEMS=="usb"
> DRIVERS=="usb"
> ATTRS{configuration}==""
> ATTRS{bNumInterfaces}==" 1"
> ATTRS{bConfigurationValue}=="1"
> ATTRS{bmAttributes}=="e0"
> ATTRS{bMaxPower}==" 2mA"
> ATTRS{urbnum}=="37"
> ATTRS{idVendor}=="0424"
> ATTRS{idProduct}=="2514"
> ATTRS{bcdDevice}=="0000"
> ATTRS{bDeviceClass}=="09"
> ATTRS{bDeviceSubClass}=="00"
> ATTRS{bDeviceProtocol}=="02"
> ATTRS{bNumConfigurations}=="1"
> ATTRS{bMaxPacketSize0}=="64"
> ATTRS{speed}=="480"
> ATTRS{busnum}=="2"
> ATTRS{devnum}=="2"
> ATTRS{version}==" 2.00"
> ATTRS{maxchild}=="4"
> ATTRS{quirks}=="0x0"
> ATTRS{authorized}=="1"
>
> looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2':
> KERNELS=="usb2"
> SUBSYSTEMS=="usb"
> DRIVERS=="usb"
> ATTRS{configuration}==""
> ATTRS{bNumInterfaces}==" 1"
> ATTRS{bConfigurationValue}=="1"
> ATTRS{bmAttributes}=="e0"
> ATTRS{bMaxPower}==" 0mA"
> ATTRS{urbnum}=="40"
> ATTRS{idVendor}=="1d6b"
> ATTRS{idProduct}=="0002"
> ATTRS{bcdDevice}=="0206"
> ATTRS{bDeviceClass}=="09"
> ATTRS{bDeviceSubClass}=="00"
> ATTRS{bDeviceProtocol}=="00"
> ATTRS{bNumConfigurations}=="1"
> ATTRS{bMaxPacketSize0}=="64"
> ATTRS{speed}=="480"
> ATTRS{busnum}=="2"
> ATTRS{devnum}=="1"
> ATTRS{version}==" 2.00"
> ATTRS{maxchild}=="6"
> ATTRS{quirks}=="0x0"
> ATTRS{authorized}=="1"
> ATTRS{manufacturer}=="Linux 2.6.32-24-generic ehci_hcd"
> ATTRS{product}=="EHCI Host Controller"
> ATTRS{serial}=="0000:00:1d.7"
> ATTRS{authorized_default}=="1"
>
> looking at parent device '/devices/pci0000:00/0000:00:1d.7':
> KERNELS=="0000:00:1d.7"
> SUBSYSTEMS=="pci"
> DRIVERS=="ehci_hcd"
> ATTRS{vendor}=="0x8086"
> ATTRS{device}=="0x3a3a"
> ATTRS{subsystem_vendor}=="0x1043"
> ATTRS{subsystem_device}=="0x82d4"
> ATTRS{class}=="0x0c0320"
> ATTRS{irq}=="23"
> ATTRS{local_cpus}=="00000000,000000ff"
> ATTRS{local_cpulist}=="0-7"
> ATTRS{modalias}=="pci:v00008086d00003A3Asv00001043sd000082D4bc0Csc03i20"
> ATTRS{numa_node}=="-1"
> ATTRS{broken_parity_status}=="0"
> ATTRS{msi_bus}==""
> ATTRS{companion}==""
>
> looking at parent device '/devices/pci0000:00':
> KERNELS=="pci0000:00"
> SUBSYSTEMS==""
> DRIVERS==""
>
>
> $ 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:1e.0/0000:07:01.0/video4linux/video1':
> KERNEL=="video1"
> SUBSYSTEM=="video4linux"
> DRIVER==""
> ATTR{name}=="cx88[0] video (ATI HDTV Wonder)"
> ATTR{index}=="0"
>
> looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:07:01.0':
> KERNELS=="0000:07:01.0"
> SUBSYSTEMS=="pci"
> DRIVERS=="cx8800"
> ATTRS{vendor}=="0x14f1"
> ATTRS{device}=="0x8800"
> ATTRS{subsystem_vendor}=="0x1002"
> ATTRS{subsystem_device}=="0xa101"
> ATTRS{class}=="0x040000"
> ATTRS{irq}=="17"
> ATTRS{local_cpus}=="00000000,000000ff"
> ATTRS{local_cpulist}=="0-7"
> ATTRS{modalias}=="pci:v000014F1d00008800sv00001002sd0000A101bc04sc00i00"
> ATTRS{numa_node}=="-1"
> 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}=="00000000,000000ff"
> ATTRS{local_cpulist}=="0-7"
> ATTRS{modalias}=="pci:v00008086d0000244Esv00000000sd00000000bc06sc04i01"
> ATTRS{numa_node}=="-1"
> ATTRS{broken_parity_status}=="0"
> ATTRS{msi_bus}=="1"
>
> looking at parent device '/devices/pci0000:00':
> KERNELS=="pci0000:00"
> SUBSYSTEMS==""
> DRIVERS==""
>
>
> > From that I created a file /etc/udev/rules.d/video-devices.rules that contains:
>
> #An attempt to get fixed names for video devices
> KERNEL=="video*", ATTR{name}=="cx88[0] video (ATI HDTV Wonder)", SYMLINK+="AnalogTuner"
> KERNEL=="video*", ATTRS{idVendor}=="1d6bi", ATTRS{idProduct}=="0002", ATTRS{bcdDevice}=="0206", SYMLINK+="WebCam"
>
> The two symbolic links it is intended to create never show up. I have no idea what I am doing wrong.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>
>
I had a similar issue and ended up just using the subsystem/kernels
addressing in udev, e.g.: in one system I have two pvr150's, the first
is at the kernel device address of 0000:04:01.0 and the other at
0000:04:02.0, so my udev rules look like:
SUBSYSTEM=="video4linux", ATTR{name}=="ivtv? encoder MPG",
KERNELS=="0000:04:01.0", SYMLINK+="pvr_150_0"
SUBSYSTEM=="video4linux", ATTR{name}=="ivtv? encoder MPG",
KERNELS=="0000:04:02.0", SYMLINK+="pvr_150_1"
Don't forget you'll need to restart udev (or reboot) for these changes
to take effect. If you're using any of the other device nodes (
video24/32 ) you'll also need to check for the appropriate ATTR{name}
and adjust accordingly.
The unfortunate side effect of my method is that if I shift one of the
cards to another pci slot, and 'KERNELS' value will change accordingly.
Cheers,
Andrew.
More information about the mythtv-users
mailing list