[mythtv-users] lirc device load order changed - tidiest way to recover?

Stephen Worthington stephen_agent at jsw.gen.nz
Sun May 20 06:43:41 UTC 2018


On Sat, 19 May 2018 13:03:06 -0400, you wrote:

>Hi there,
>
>I applied updates to my system last week. We haven't watched much TV this
>week so it took a while to notice that the lirc config was unhappy.
>
>The frontend isn't listening to the remote control and the mceusb blaster
>isn't changing channels on the cable box before recordings start.
>
>Groping around in a few config files and logs my guess is that the HDPVR
>blaster has suddenly started showing up as lirc0 and moved the mceusb
>device up to lirc1. I could very easily be completely wrong! I don't use
>the blaster in the HDPVR.
>
>For years I let Mythbuntu Control Centre configure lirc so I don't remember
>all the configuration touch points.
>
>I'm hoping to get some advice from this list on the cleanest way to get
>things working again.
>
>I probably need to force my mceusb back to lirc0.  Maybe by blacklisting
>the lirc_zilog module or a UDEV rule? [I don't remember how to do either of
>those, but Google usually helps out...]
>
>Some background info is pasted in below. Just ask if more info is needed.
>
>Thanks in advance,
>Andrew

The usual way to make a lirc device that will not move around is to
create a udev rule to give it a specific device name.  Here is what I
have in my /etc/udev/10-local.rules file:

root at mypvr:/etc/udev/rules.d# cat 10-local.rules
# Hauppauge ("SMK Manufacturing, Inc. eHome Infrared Receiver") USB
MCE remote control IR receiver
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{idVendor}=="0609",
ATTRS{idProduct}=="031d", SYMLINK+="lirc-mce"

# Hauppauge WinTV Nova TD-500 remote control IR receiver
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{idVendor}=="2040",
ATTRS{idProduct}=="8400", SYMLINK+="lirc-nova-td-500"

# AverMedia AVerTV DVB-T Volar USB remote control IR receiver
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{idVendor}=="07ca",
ATTRS{idProduct}=="b808", SYMLINK+="lirc-volar"

# TBS QBox 5922 USB remote control IR receiver
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{idVendor}=="734c",
ATTRS{idProduct}=="5922", SYMLINK+="lirc-tbs-5922"

# Allow MythTV (mythtv group) access to the rtc hardware for
mythfrontend to use it for timing.
KERNEL=="rtc0", GROUP="mythtv", MODE="0660"

The first four rules there are for creating lirc devices for all the
IR receivers I have had in that box.  The only one I actually use is
the MCE remote (the first rule).  The MCE receiver is separate USB
hardware - the other IR receivers are built into some of my tuner
cards.  Each of the udev lines is all on one line - they may appear
wrapped due to the limitations of email.  The idVendor and idProduct
values you need for a rule like this can be found using lsusb:

root at mypvr:/etc/udev/rules.d# lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 002: ID 1b1c:1c0a Corsair
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 05e3:070e Genesys Logic, Inc. USB 2.0 Card
Reader
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 002: ID 0609:031d SMK Manufacturing, Inc. eHome
Infrared Receiver
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 003: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop
Laser
Bus 004 Device 002: ID 076b:3021 OmniKey AG CardMan 3121
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 011 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 010 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

My MCE remote shows as "SMK Manufacturing..." and has a USB ID of
0609:031d, so the vendor ID is 0609 and the product ID is 031d.  The
SYMLINK+="lirc-mce" part creates a device /dev/lirc-mce:

root at mypvr:/etc/udev/rules.d# ll /dev/lirc*
crw-rw---- 1 root video 243, 0 May 11 14:42 /dev/lirc0
lrwxrwxrwx 1 root root      15 May 11 14:42 /dev/lircd ->
/run/lirc/lircd=
lrwxrwxrwx 1 root root      13 May 11 14:42 /dev/lirc-mce ->
input/event17

And here are the /dev/input devices that are linked to:

root at mypvr:/etc/udev/rules.d# ll /dev/input/
total 0
drwxr-xr-x  4 root root     480 May 11 14:42 ./
drwxr-xr-x 22 root root    5600 May 11 16:37 ../
drwxr-xr-x  2 root root     120 May 11 14:42 by-id/
drwxr-xr-x  2 root root     140 May 11 14:42 by-path/
crw-rw----  1 root input 13, 64 May 11 14:42 event0
crw-rw----  1 root input 13, 65 May 11 14:42 event1
crw-rw----  1 root input 13, 74 May 11 14:42 event10
crw-rw----  1 root input 13, 75 May 11 14:42 event11
crw-rw----  1 root input 13, 76 May 11 14:42 event12
crw-rw----  1 root input 13, 77 May 11 14:42 event13
crw-rw----  1 root input 13, 78 May 11 14:42 event14
crw-rw----  1 root input 13, 79 May 11 14:42 event15
crw-rw----  1 root input 13, 80 May 11 14:42 event16
crw-rw----  1 root input 13, 81 May 11 14:42 event17
crw-rw----  1 root input 13, 66 May 11 14:42 event2
crw-rw----  1 root input 13, 67 May 11 14:42 event3
crw-rw----  1 root input 13, 68 May 11 14:42 event4
crw-rw----  1 root input 13, 69 May 11 14:42 event5
crw-rw----  1 root input 13, 70 May 11 14:42 event6
crw-rw----  1 root input 13, 71 May 11 14:42 event7
crw-rw----  1 root input 13, 72 May 11 14:42 event8
crw-rw----  1 root input 13, 73 May 11 14:42 event9
crw-rw----  1 root input 13, 63 May 11 14:42 mice
crw-rw----  1 root input 13, 32 May 11 14:42 mouse0


So once you have the correct udev rule working (after a reboot), you
would change the this line in /etc/lirc/hardware.conf:

REMOTE_DEVICE="/dev/lirc0"

to

REMOTE_DEVICE="/dev/lirc-mce"

and restart lirc.

Alternatively, if your system provides /dev/input/by-id, you can
directly use the correct device from there in the REMOTE_DEVICE
setting.  Here is my /dev/input/by-id:

root at mypvr:/etc/udev/rules.d# ll /dev/input/by-id/
total 0
drwxr-xr-x 2 root root 120 May 11 14:42 ./
drwxr-xr-x 4 root root 480 May 11 14:42 ../
lrwxrwxrwx 1 root root   9 May 11 14:42
usb-Logitech_USB_Receiver-event-kbd -> ../event2
lrwxrwxrwx 1 root root   9 May 11 14:42
usb-Logitech_USB_Receiver-if01-event-mouse -> ../event3
lrwxrwxrwx 1 root root   9 May 11 14:42
usb-Logitech_USB_Receiver-if01-mouse -> ../mouse0
lrwxrwxrwx 1 root root  10 May 11 14:42
usb-SMK_eHome_Infrared_Transceiver_SM005h4M-event-if00 -> ../event17

So I could use

REMOTE_DEVICE="/dev/input/by-id/usb-SMK_eHome_Infrared_Transceiver_SM005h4M-event-if00"

and avoid having a udev rule.  The by-id option is only available in
recent kernels, but has been available for at least a couple of years.


More information about the mythtv-users mailing list