[mythtv-users] Can't get lirc or irw to work, but mode2 works
Nick Morrott
knowledgejunkie at gmail.com
Sun Jun 28 00:27:16 UTC 2015
On 27 June 2015 at 21:43, Jerry Rubinow <jerrymr at gmail.com> wrote:
> On Sat, Jun 27, 2015 at 3:19 PM, Stephen Worthington
> <stephen_agent at jsw.gen.nz> wrote:
>> Yes, I had the same thing. The default Mythbuntu lirc config did not
>> work for using the devinput driver (that was in 12.04, IIRC, when I
>> had to update for the kernel driver). But I never had bad keycodes
>> like you are getting. That suggests that the wrong keymap file is
>> being used to translate them. Or even the wrong protocol (RC-5, RC-6
>> etc) has been selected, so it is using the wrong wordsize for decoding
>> the bit patterns.
>>
>
> When I used ir-keytable, I had it configured for RC6, which as far as I can
> tell is what mce uses. Part of the difficulty I'm having is I don't really
> understand the relationship between lirc, ir-keytables, and the IR kernel
> drivers.
If you are using LIRC with a recent 3.x kernel and with the common
config of an MCE USB receiver, an RC6 MCE remote control, and want to
use in-kernel IR decoding using the devinput driver it is quite
straightforward to setup in my experience.
This is my testing workflow:
* stop the lirc service if running
* run `ir-keytable` to check whether the kernel has identified your
device as a /dev/input device using the mceusb driver, and has set the
protocols to include RC6 and loaded the appropriate keymap
(rc-rc6-mce). This should all be done automatically when you plug in
the receiver or boot the machine.
* run `ir-keytable -t` to check if all button scancodes are being
converted into keycodes. If not, run `ir-keytable -r` to check that
there are scancode->keycode mappings for all buttons and the enabled
protocol (last line of output) is RC-6.
You might need to manually load another keymap or correct the protocol
and retest before proceeding.
* configure /etc/lirc/hardware.conf to use the devinput driver with
the correct /dev/input/ device for your IR receiver.
Instead of using a /dev/input/eventX node (which can change order
between reboots), I always use the linked device node in
/dev/input/by-id/ - which should exist for supported MCE USB devices -
and, more importantly, will not change name if you plug/unplug other
input devices).
For example, I configure LIRC with:
DEVICE="/dev/input/by-id/usb-Topseed_Technology_Corp._eHome_Infrared_Transceiver_EID0137AG-8-0000063002-event-if00"
NOTE
You do NOT want to specify a /dev/lirc device when using devinput. You
should specify the correct /dev/input/ device which takes advantage of
the in-kernel IR decoding.
Alternatively, if you want LIRC to do ALL of the IR decoding itself,
specify the correct /dev/lirc device and the default driver for LIRC,
and configure ir-keytable with the lirc protocol. You then need to
find the correct lircd.conf for your remote, or create your own using
irrecord.
* copy the LIRC devinput example config file
(/usr/share/lirc/remotes/devinput/lircd.conf.devinput) as
/etc/lirc/lircd.conf
* restart LIRC
* test with irw
* if all looks good, you can proceed to configure your lircrc file if required
> Looking over your readme, it seems like the udev rules map a particular
> usb-connected hardware device to a node in /dev, and that's where the raw
> bit stream from the device ends up. Then there's some magic which controls
> which driver is used to interpret the bits and produce scancodes - I don't
> really know how that happens. Then rc_maps.cfg associates a driver with a
> keymap file. Then the keymap controls how the scancodes are converted to
> keys.
You shouldn't need to use udev rules at all if using a supported USB
MCE IR receiver.
> I don't really follow the all the comments in rc_maps.cfg about uevent.
You shouldn't need to worry about any of this either if using an MCE
receiver/remote control, as the correct RC6 keymap is loaded by
default for the mceusb driver.
> I also don't understand why one would need lirc at all if ir-keytable is
> working.
You don't need to use LIRC if all of your applications will work with
the standard key mapping.
Taking the time to configure LIRC enables you to configure a lircrc
file which can give each application (e.g. MythTV, VLC) a specific
keymap.
Read http://lirc.org/html/configuration-guide.html for reasons why you
might or might not need LIRC, and more background information on the
above.
Cheers,
Nick
--
Nick Morrott
MythTV Official wiki: http://mythtv.org/wiki/
MythTV users list archive: http://www.gossamer-threads.com/lists/mythtv/users
"An investment in knowledge always pays the best interest." - Benjamin Franklin
More information about the mythtv-users
mailing list