[mythtv-users] Infra-red Remote as keyboard

David Watkins watkinshome at gmail.com
Tue Nov 29 09:37:08 EST 2005


> David Watkins mentioned that you can use LIRC to change the keys of the
> remote.  I think he was referring to a ATI remote which uses the
> ati_remote.ko kernel module.  LIRC has its own kernel module for that remote.
> I'm not sure you can use LIRC with a usbhid device that thinks it is a
> keyboard.

No, I'm using a nova-t card.  The ir receiver plugs into the capture
card and is handled by one of the cx88 modules ( I forget which
exactly ), but it does end up thinking it's a keyboard.

In case it helps you, this is the way my nova-t works.

On loading the dvb module, a new device gets created for the remote

/dev/input/event0     (if I don't have any other input devices)
/dev/input/event1     (if I have a keyboard connected)
etc

and keypresses from both the standard keyboard and the remote control
are sent to the keyboard buffer. (eg pressing the '1' on the remote
control produces a '1 on the screen if I'm in a terminal window at the
input prompt).

So at this point the remote could be working with mythtv, all without
touching lirc.  However,  it wasn't working for me for two reason.

1)   Very few of the remote keys worked at all.  eg. the remote
keypresses were not mapped to valid keycodes (as defined in input.h),
and pressing them just produced an error in dmesg.  Of those that did
work, they weren't necessarily mapped to the key that mythtv expected.

2)   The key repeat rate was much too fast.  ie it was almost
impossible to send a single keypress, which made scrolling up and down
difficult to control and pressing enter a bit of a lottery as I dived
down through menu levels.

I solved (1) by editing cx88_input.c and recompiling the cx88 modules
(a BIG learning experience for me).

and I solved (2) by running lircd and connecting it to the correct
input/event device. This allows for more flexible key mapping and
control of the repeat rate.

So, if loading your usb module produces a /dev device, such that

$cat /dev/<device>

produces stuff on the screen when you press buttons on your remote
then maybe the same approach is usefull for you.


One gotcha is that if I don't have a keyboard then the ir device is on
/dev/input/event0, so I configure lircd to be automatically started,
attached to this device.

Adding a keyboard bumps the device numbers up, with the result that
neither the keyboard nor the remote work.  Someone on this list kindly
sent me a script that detects which device the nova-t remote is on,
and starts lircd accordingly.

(Search gossamer/threads/mythtv/users for 'nova-t repeat lirc')

Sorry for the rambling thread - hope this helps.


More information about the mythtv-users mailing list