[mythtv] Interface to HID remote devices

Clint Eaker ceaker at mindspring.com
Fri Jun 15 13:33:06 UTC 2007

>I'm trying to investigate using a HID remote control device (Logitech UltraX remote) with Mythtv.
>Basically, it appears to the system as a HID keyboard.  What I'm finding using EditKeys is that while
>many of the keys on the remote are recognized by Mythtv, many of the media remote oriented keys are
>not acknowledged by Mythtv at all (pressing the button on the remote to map the key/button within
>EditKeys simply does nothing).
>I have determined that support for the Logitech UltraX remote has been added to hid-input.c(http://lkml.org/lkml/2005/9/10/197).
>I'm assuming that what's going on is that Mythtv is listening for standard keyboard input.  It appears
>that somewhere along the line the remote buttons that don't map to a standard keyboard are getting
>dropped (buttons like 'DVD' or 'TV').  I don't know whether they are being ignored by the standard
>keyboard driver or ignored by Mythtv (I suspect the former, but that's just a guess).
>The biggest challenge I'm running into is simply finding any kind of description of how any of this works.
>I'm not familiar with the linux architecture for handling user input or how it is received by applications.
>My suspicion is that to get this to work, Mythtv would have to be modified to recognize and listen to
>a separate interface in the HID driver that provides the key presses that are not part of the standard
>keyboard.  But I don't know how to confirm this.
>Can anyone point me in the right direction for how I might be able to make some progress on this?
>Anything would be appreciated (suggestions on this forum, other forums that might be more suited to
>these questions, HOWTOs, documentation, anything).

Thanks for all the replies I've received on this.  After reading all the replies and other resources I've
found, I'm convinced that it should be possible to get all the buttons on this remote working with no
kernel hacking.  I'll post a more complete description of what I've found when I get it all figured out,
but I've run into one obstacle that I'm having trouble getting past.

As a preliminary summary, about 8 keys on the remote "just work" (arrows, enter, kp_enter, home, clear).

A significant set of keys seem to have scancode to keycode mappings in the kernel, but aren't recognized by
X.  These keycodes can be identified with xev and then the keycodes can be made known to X with xmodmap.
These keys are now working and are recognized by EditKeys in MythTV.

The problem keys are those that don't seem to have a scancode to keycode mapping in the kernel.  I have
confirmed that events are being generated in evdev for every key on the remote (both by hacking the evdev
module and adding printk statments and rebuilding the kernel with evbug enabled).  I've come across HOWTOs
that describe how to define these mappings to the kernel using setkeycodes
(http://gentoo-wiki.com/HOWTO_Use_Multimedia_Keys), but according to this HOWTO, events that have no mapping
to a keycode are logged in the syslog.  That is not happening on my Debian Etch system.

I don't know if there is something that is not enabled to allow this on my system or if HID keyboard devices
simply don't use the portions of the kernel input code that generates those logs.  At any rate, the info
produced by evbug doesn't seem to be the raw scancode and that's what I'm having trouble finding.

If I could simply determine the raw scancodes for the keys that aren't currently being mapped to keycodes in 
the kernel, then I could define those mappings using setkeycodes, define the new keycodes for X in .Xmodmad,
and I'd be golden.

I suppose I could simply sledgehammer this by defining all the unmapped scancodes to unused keycodes and use
xev to see which keycodes show up for the currently unmapped keys.  I'm hoping someone might be able to give
me a better way to determine the scancodes for the unmapped keys.  Any ideas?


More information about the mythtv-dev mailing list