[mythtv-users] Fix lirc devices to desired names

Hika van den Hoven hikavdh at gmail.com
Sun Aug 31 20:25:26 UTC 2014


Hoi Josu,

Sunday, August 31, 2014, 9:37:26 PM, you wrote:

> 2014-08-31 13:10 GMT+02:00 Hika van den Hoven <hikavdh at gmail.com>:
>>
>> Give the output off:
>>
>> udevadm info --attribute-walk --path $(udevadm info --query path --name=/dev/lirc0)
>> and
>> udevadm info --attribute-walk --path $(udevadm info --query path --name=/dev/lirc1)
>>
>> and I'll give you an udev rule for both.
>>
>> Tot mails,
>>   Hika                            mailto:hikavdh at gmail.com
>>
>> "Zonder hoop kun je niet leven
>> Zonder leven is er geen hoop
>> Het eeuwige dilemma
>> Zeker als je hoop moet vernietigen om te kunnen overleven!"
>>
>> De lerende Mens

> Thanks Hika,

> Here is the outputs:

> # udevadm info --attribute-walk --path $(udevadm info --query path
> --name=/dev/lirc0)

> 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/pnp0/00:0c/rc/rc0/lirc0':
>     KERNEL=="lirc0"
>     SUBSYSTEM=="lirc"
>     DRIVER==""

>   looking at parent device '/devices/pnp0/00:0c/rc/rc0':
>     KERNELS=="rc0"
>     SUBSYSTEMS=="rc"
>     DRIVERS==""
>     ATTRS{protocols}=="[rc-5] [nec] [rc-6] [jvc] [sony] [mce_kbd] [lirc]"

>   looking at parent device '/devices/pnp0/00:0c':
>     KERNELS=="00:0c"
>     SUBSYSTEMS=="pnp"
>     DRIVERS=="nuvoton-cir"
>     ATTRS{options}==""
>     ATTRS{id}=="NTN0530"

>   looking at parent device '/devices/pnp0':
>     KERNELS=="pnp0"
>     SUBSYSTEMS==""
>     DRIVERS==""

> # udevadm info --attribute-walk --path $(udevadm info --query path
> --name=/dev/lirc1)

> 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:1c.2/0000:03:00.0/usb6/6-2/6-2:1.0/rc/rc1/lirc1':
>     KERNEL=="lirc1"
>     SUBSYSTEM=="lirc"
>     DRIVER==""

>   looking at parent device
> '/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/usb6/6-2/6-2:1.0/rc/rc1':
>     KERNELS=="rc1"
>     SUBSYSTEMS=="rc"
>     DRIVERS==""
>     ATTRS{protocols}=="[rc-5] [nec] [rc-6] [jvc] [sony] [mce_kbd] [lirc]"

>   looking at parent device
> '/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/usb6/6-2/6-2:1.0':
>     KERNELS=="6-2:1.0"
>     SUBSYSTEMS=="usb"
>     DRIVERS=="mceusb"
>     ATTRS{bInterfaceNumber}=="00"
>     ATTRS{bAlternateSetting}==" 0"
>     ATTRS{bNumEndpoints}=="02"
>     ATTRS{bInterfaceClass}=="ff"
>     ATTRS{bInterfaceSubClass}=="ff"
>     ATTRS{bInterfaceProtocol}=="ff"
>     ATTRS{supports_autosuspend}=="0"

>   looking at parent device
> '/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/usb6/6-2':
>     KERNELS=="6-2"
>     SUBSYSTEMS=="usb"
>     DRIVERS=="usb"
>     ATTRS{configuration}==""
>     ATTRS{bNumInterfaces}==" 1"
>     ATTRS{bConfigurationValue}=="1"
>     ATTRS{bmAttributes}=="a0"
>     ATTRS{bMaxPower}=="100mA"
>     ATTRS{urbnum}=="27"
>     ATTRS{idVendor}=="0471"
>     ATTRS{idProduct}=="0815"
>     ATTRS{bcdDevice}=="0000"
>     ATTRS{bDeviceClass}=="00"
>     ATTRS{bDeviceSubClass}=="00"
>     ATTRS{bDeviceProtocol}=="00"
>     ATTRS{bNumConfigurations}=="1"
>     ATTRS{bMaxPacketSize0}=="16"
>     ATTRS{speed}=="12"
>     ATTRS{busnum}=="6"
>     ATTRS{devnum}=="3"
>     ATTRS{devpath}=="2"
>     ATTRS{version}==" 1.10"
>     ATTRS{maxchild}=="0"
>     ATTRS{quirks}=="0x0"
>     ATTRS{avoid_reset_quirk}=="0"
>     ATTRS{authorized}=="1"
>     ATTRS{manufacturer}=="Philips"
>     ATTRS{product}=="eHome Infrared Transceiver"
>     ATTRS{serial}=="PH00W3Up"

>   looking at parent device
> '/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/usb6':
>     KERNELS=="usb6"
>     SUBSYSTEMS=="usb"
>     DRIVERS=="usb"
>     ATTRS{configuration}==""
>     ATTRS{bNumInterfaces}==" 1"
>     ATTRS{bConfigurationValue}=="1"
>     ATTRS{bmAttributes}=="e0"
>     ATTRS{bMaxPower}=="  0mA"
>     ATTRS{urbnum}=="26"
>     ATTRS{idVendor}=="1d6b"
>     ATTRS{idProduct}=="0002"
>     ATTRS{bcdDevice}=="0302"
>     ATTRS{bDeviceClass}=="09"
>     ATTRS{bDeviceSubClass}=="00"
>     ATTRS{bDeviceProtocol}=="01"
>     ATTRS{bNumConfigurations}=="1"
>     ATTRS{bMaxPacketSize0}=="64"
>     ATTRS{speed}=="480"
>     ATTRS{busnum}=="6"
>     ATTRS{devnum}=="1"
>     ATTRS{devpath}=="0"
>     ATTRS{version}==" 2.00"
>     ATTRS{maxchild}=="2"
>     ATTRS{quirks}=="0x0"
>     ATTRS{avoid_reset_quirk}=="0"
>     ATTRS{authorized}=="1"
>     ATTRS{manufacturer}=="Linux 3.2.0-4-amd64 xhci_hcd"
>     ATTRS{product}=="xHCI Host Controller"
>     ATTRS{serial}=="0000:03:00.0"
>     ATTRS{authorized_default}=="1"

>   looking at parent device
> '/devices/pci0000:00/0000:00:1c.2/0000:03:00.0':
>     KERNELS=="0000:03:00.0"
>     SUBSYSTEMS=="pci"
>     DRIVERS=="xhci_hcd"
>     ATTRS{vendor}=="0x1b6f"
>     ATTRS{device}=="0x7023"
>     ATTRS{subsystem_vendor}=="0x1b6f"
>     ATTRS{subsystem_device}=="0x7023"
>     ATTRS{class}=="0x0c0330"
>     ATTRS{irq}=="45"
>    
> ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f"
>     ATTRS{local_cpulist}=="0-3"
>     ATTRS{numa_node}=="-1"
>     ATTRS{dma_mask_bits}=="64"
>     ATTRS{consistent_dma_mask_bits}=="32"
>     ATTRS{enable}=="1"
>     ATTRS{broken_parity_status}=="0"
>     ATTRS{msi_bus}==""

>   looking at parent device '/devices/pci0000:00/0000:00:1c.2':
>     KERNELS=="0000:00:1c.2"
>     SUBSYSTEMS=="pci"
>     DRIVERS=="pcieport"
>     ATTRS{vendor}=="0x8086"
>     ATTRS{device}=="0x27d4"
>     ATTRS{subsystem_vendor}=="0x8086"
>     ATTRS{subsystem_device}=="0x7270"
>     ATTRS{class}=="0x060400"
>     ATTRS{irq}=="42"
>    
> ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f"
>     ATTRS{local_cpulist}=="0-3"
>     ATTRS{numa_node}=="-1"
>     ATTRS{dma_mask_bits}=="32"
>     ATTRS{consistent_dma_mask_bits}=="32"
>     ATTRS{enable}=="2"
>     ATTRS{broken_parity_status}=="0"
>     ATTRS{msi_bus}=="1"

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

> Thanks for your great help.

> Best regards.


SUBSYSTEM=="lirc", \
        KERNEL=="lirc*", \
        DRIVERS=="nuvoton-cir", \
        SYMLINK+="lirc_cir"
        
SUBSYSTEM=="lirc", \
        KERNEL=="lirc*", \
        DRIVERS=="mceusb", \
        SYMLINK+="lirc_mce"
        
Both rules are one line. The "\" at the end of each line tells to
ignore the EOL and continue on the next line as if it is the same
line. This is just for readability.
SUBSYSTEM and KERNEL make these rules exclusive for lirc devices.
DRIVERS distinguishes on the driver used further up the tree. Unless
you have two similar devices this is enough.

Place the two lines in a file named something like
'61-private-lirc.rules'. The number at the start rules the processing
order. On my system the default v4l rules are numbered 60 so this one
has to have a higher number. But not to high.

Place this file in your udev rule directory in /etc. On my system this
is '/etc/udev/rules.d'


Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens



More information about the mythtv-users mailing list