[mythtv-users] Lirc enumeration?

Paul Bender pebender at san.rr.com
Sat Jan 23 15:39:17 UTC 2010


On 1/23/2010 4:23 AM, Jan Johansson wrote:
> Again, this may be more approprate for the LIRC-list, but I know that
> there is plenty of expertise here, and that quite a few are familiar
> with the hardware at hand.
>
> I have a Antec Fusion (silver, VFD 2x16 no IR-receiver) and I have a
> USB-MCE.
>
> Now, I learned a while back (thanks Jarod) that I needed to set my FE up
> to listen to /dev/lirc1 instead of /dev/lircd .
>
> I just have one problem. Some times the IMON VFD goes nuts and “locks
> up” with garbage on the display. (If anyone know how to re-set it
> without completely killing power to the chassi, let me know please).
>
> If the display is in this state when the PC starts up, it does not get a
> /dev/lirc0 association. In that case my mce-usb becomes /dev/lirc0 and I
> have no remote, which is annoying.
>
> So, I figured I would create some udev rukles to straighten this out.
> But they have the exact same udev data it would appear?
>
> I used make “make-static-udev.py” to create the rules, and it came up with
>
> # generated by make-udev-static script
>
> KERNEL=="lirc*", ATTRS{vendor}=="0x10de", SYMLINK+="lirc-imon"
>
> #
>
> # generated by make-udev-static script
>
> KERNEL=="lirc*", ATTRS{vendor}=="0x10de", SYMLINK+="lirc-usb-mce"
>
> So, is there any other way I can force the mce-usb to always grab
> /dev/lirc1 ?

I am suprised by ATTRS{vendor}=="0x10de", For USB, the sysfs attribute 
is idVendor. The sysfs attribute vendor is used by PCI (and others). For 
PCI, 0x10de is Nvidia, so I would assume you have a motherboard with an 
Nvidia chipset. This means that the make-static-udev.py is picking up 
the vendor of the PCI bus to which the USB host controller is connected 
rather than the vendor of the USB device connected to the USB host 
controller.

Following the rule above, it would look like

KERNEL=="lirc[0-9]*", \
   ATTRS{idVendor}=="15c2", \
   ATTRS{idProduct}=="0034", \
   SYMLINK+="lirc-imon"

KERNEL=="lirc[0-9]*", \
   ATTRS{idVendor}=="0471", \
   ATTRS{idProduct}=="0815", \
   SYMLINK+="lirc-usb-mce"

You will need to plug in the correct values for idVendor and idProduct, 
which you can find using lsusb.

Having said all that, you might want to make use of udev's usb_id helper 
to add the USB ID information to the environment rather than looking at 
sysfs atributes. To do this, you would do something like

KERNEL=="lirc[0-9]*", \
   SUBSYSTEMS=="usb", \
   ENV{ID_USB_INTERFACES}=="", \
   IMPORT{program}="usb_id --export %p"
KERNEL=="lirc[0-9]*", \
   SUBSYSTEMS=="usb", \
   ENV{ID_VENDOR_ID}=="15c2", \
   ENV{ID_MODEL_ID}=="0034", \
   SYMLINK+="lirc-imon"
KERNEL=="lirc[0-9]*", \
   SUBSYSTEMS=="usb", \
   ENV{ID_VENDOR_ID}=="0471", \
   ENV{ID_MODEL_ID}=="0815", \
   SYMLINK+="lirc-mce-usb"

Also, when vendor and product/model are not enough, there is other 
information such as bInterfaceNumber (ID_USB_INTERFACE_NUM) and serial 
(ID_SERIAL) that can be used.



More information about the mythtv-users mailing list