[mythtv-users] Joy and pain

Yianni yiannividalis at hotmail.com
Wed Feb 12 08:53:14 UTC 2014


Hi, Daryl. 

I can see this turning into another udev-rules marathon!


> None of the cards are blaster capable, so I use a serial port IR
> blaster. The new card is a PCTV 800i, I suppose pulling it would test
> if it is having an adverse effect on the IR baster, is there an easier
> way?

I think Hika is right, most analog cards have ir (even without the blasting capability)
and your /dev/input/ devices must have changed their numbering, possibly creating more than one /dev/lirc device
(ls -lah /dev/lirc* ????????)

I can tell you how I solved my same problem and I will provide my setup, udev and lirc files but
I use OpenSUSE, not ubuntu. The main difference in lirc is that in my distro there is no hardware.conf
file which I think controls blasting in *buntu, the only service config file for lirc is /etc/sysconfig/lirc.conf
I hope this won't confuse matters much. (There is a /etc/lirc/lircd.conf file, but it's used to define the remotes/protocols.)

Anyway, I have a "Hauppauge Media Center Ed. eHome Infrared Remote Transceiver (0609:0334)", which I used
to have setup in lirc using the "devinput" driver, but that doesn't support blasting and I switched to the "default"
driver that does. It uses the mceusb kernel module, yours could be using a different one.

I found the device name in /dev/input/by-id: (it's the last one)

al2kpro:~ # la /dev/input/by-id/
σύνολο 0
drwxr-xr-x 2 root root 160 Νοέ   5 08:21 .
drwxr-xr-x 4 root root 560 Ιαν  24 14:21 ..
lrwxrwxrwx 1 root root   9 Ιαν  24 14:21 usb-05af_Rx504B_Ver:3.03-event-kbd -> ../event0
lrwxrwxrwx 1 root root   9 Ιαν  24 14:21 usb-05af_Rx504B_Ver:3.03-event-mouse -> ../event1
lrwxrwxrwx 1 root root   9 Ιαν  24 14:21 usb-05af_Rx504B_Ver:3.03-if01-event-mouse -> ../event1
lrwxrwxrwx 1 root root   9 Ιαν  24 14:21 usb-05af_Rx504B_Ver:3.03-if01-mouse -> ../mouse0
lrwxrwxrwx 1 root root   9 Ιαν  24 14:21 usb-05af_Rx504B_Ver:3.03-mouse -> ../mouse0
lrwxrwxrwx 1 root root   9 Ιαν  24 14:21 usb-SMK_CORPORATION_MCE_TRANCEIVR_Emulator_Device_2006_PA100707131807G-event-if00 -> ../event4

then I found the udev info for the device:

al2kpro:~ # udevadm info -a -p $(udevadm info -q path -n /dev/input/by-id/usb-SMK_CORPORATION_MCE_TRANCEIVR_Emulator_Device_2006_PA100707131807G-event-if00)
##############################
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:02.0/usb2/2-3/2-3:1.0/rc/rc4/input21/event4':
    KERNEL=="event4"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0/rc/rc4/input21':
    KERNELS=="input21"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="Media Center Ed. eHome Infrared Remote Transceiver (0609:0334)"
    ATTRS{phys}=="usb-0000:00:02.0-3"
    ATTRS{uniq}==""
    ATTRS{properties}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0/rc/rc4':
    KERNELS=="rc4"
    SUBSYSTEMS=="rc"
    DRIVERS==""
    ATTRS{protocols}=="rc-5 nec rc-6 jvc sony mce_kbd [lirc]"

  looking at parent device '/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0':
    KERNELS=="2-3:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="mceusb"
    ATTRS{bInterfaceClass}=="ff"
    ATTRS{bInterfaceSubClass}=="ff"
    ATTRS{bInterfaceProtocol}=="ff"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{supports_autosuspend}=="0"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceNumber}=="00"

  looking at parent device '/devices/pci0000:00/0000:00:02.0/usb2/2-3':
    KERNELS=="2-3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{devpath}=="3"
    ATTRS{idVendor}=="0609"
    ATTRS{speed}=="12"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="2"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}=="100mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="a0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="0"
    ATTRS{bcdDevice}=="0100"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{serial}=="PA100707131807G"
    ATTRS{version}==" 2.00"
    ATTRS{urbnum}=="2029912"
    ATTRS{manufacturer}=="SMK CORPORATION"
    ATTRS{removable}=="unknown"
    ATTRS{idProduct}=="0334"
    ATTRS{bDeviceClass}=="00"
    ATTRS{product}=="MCE TRANCEIVR Emulator Device 2006"

  looking at parent device '/devices/pci0000:00/0000:00:02.0/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{devpath}=="0"
    ATTRS{idVendor}=="1d6b"
    ATTRS{speed}=="12"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{authorized_default}=="1"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="1"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="10"
    ATTRS{bcdDevice}=="0304"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{serial}=="0000:00:02.0"
    ATTRS{version}==" 1.10"
    ATTRS{urbnum}=="119"
    ATTRS{manufacturer}=="Linux 3.4.11-2.16-dvb-mutex-desktop ohci_hcd"
    ATTRS{removable}=="unknown"
    ATTRS{idProduct}=="0001"
    ATTRS{bDeviceClass}=="09"
    ATTRS{product}=="OHCI Host Controller"

  looking at parent device '/devices/pci0000:00/0000:00:02.0':
    KERNELS=="0000:00:02.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="ohci_hcd"
    ATTRS{irq}=="23"
    ATTRS{subsystem_vendor}=="0x1458"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x0c0310"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003"
    ATTRS{device}=="0x0454"
    ATTRS{enable}=="1"
    ATTRS{msi_bus}==""
    ATTRS{local_cpulist}=="0-1"
    ATTRS{vendor}=="0x10de"
    ATTRS{subsystem_device}=="0x5004"
    ATTRS{numa_node}=="0"

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

Using the above info and after a very exhaustive google search, I created the following udev rule file:
##############################
al2kpro:~ # cat /etc/udev/rules.d/10-lirc-mceusb.rules
# 5/11/2013
# This is for using lirc mceusb device
# As per https://bbs.archlinux.org/viewtopic.php?id=136834
# lirc_mceusb
# then in /etc/sysconfig/lirc we point the device to /dev/lirc_mceusb
# for my hauppauge
KERNEL=="lirc[0-9]*", ATTRS{idVendor}=="0609", SYMLINK+="lirc_mceusb"
SUBSYSTEM=="rc", ATTRS{protocols}=="*lirc*" RUN+="/bin/sh -c 'echo lirc> /sys$env{DEVPATH}/protocols'"
##############################

The ATTRS{idVendor}=="0609" line is in the "looking at parent device '/devices/pci0000:00/0000:00:02.0/usb2/2-3':" section

Basically, the rule creates a symlink called lirc_mceusb for the lirc* device that has the specified vendor in /dev, and the last line ensures the lirc device is using the lirc protocol

Then I feel the above info to the lirc config file:
I'm providing the file as-is, with the previously used variables commented out for reference.

##############################
al2kpro:~ # cat /etc/sysconfig/lirc
## Path:           Hardware/Lirc
## Description:    lirc (infrared remote control) configuration
## Type:           string
## Default:        "660"
## ServiceRestart: lirc
#
# permissions for /dev/lircd
#
LIRCD_DEV_PERMISSIONS="666"

## Type:        string
## Default:     "root:video"
#
# owner and group for /dev/lircd
#
LIRCD_DEV_OWNER="root:video"

## Type:        string
## Default:     ""
#
# use given driver

################## For devinput setup #################
# devinput works perfectly with mceusb but it cannot transmit, only receive
#LIRCD_DRIVER="devinput"

## Type:        string
## Default:     ""
#
# read from given device
#
#LIRCD_DEVICE="/dev/input/by-id/usb-SMK_CORPORATION_MCE_TRANCEIVR_Emulator_Device_2006_PA100707131807G-event-if00"

################ for lirc setup #######################
LIRCD_DRIVER="default"

## Type:        string
## Default:     ""
#
# read from given device
#
#LIRCD_DEVICE="/dev/lirc1"
LIRCD_DEVICE="/dev/lirc_mceusb"
#######################################################

## Type:        string(lirc_bt829,lirc_gpio,lirc_i2c,lirc_it87,lirc_parallel,lirc_sir,ir-kbd-i2c,ir-kbd-gpio)
## Default:     ""
#
# load given lirc driver module
#
LIRC_MODULE="mceusb"

## Type:        string
## Default:     ""
#
# listen for network connections on specified port.
# WARNING: don't use this on a machine with an internet
# connection as lircd is running as root!
#
LIRCD_LISTENPORT=

## Type:        string
## Default:     ""
#
# connect lircd to specified host
#
LIRCD_CONNECT=

##############################


I am providing the above with the hope you'll be able to adopt them to your needs. Maybe some other ubuntu/mythbuntu user has some suggestions / observations for that?

Good luck on your new endeavour, ;)

Yianni. 		 	   		  


More information about the mythtv-users mailing list