OK, so I'm going to burn a
little midnight oil after all.
I powered up my ASRock ION 330HT and merged v4l-utils (it's not in Entropy, so I had to use Portage). The utility ir-keytable has the following command set:
- Code: Select all
# ir-keytable --help
Usage: ir-keytable [OPTION...] --device [/dev/input/event* device]
or: ir-keytable [OPTION...] --sysdev [ir class (f. ex. rc0)]
or: ir-keytable [OPTION...] [for using the rc0 sysdev]
Allows get/set IR keycode/scancode tables
You need to have read permissions on /dev/input for the program to work
On the options bellow, the arguments are:
DEV - the /dev/input/event* device to control
SYSDEV - the ir class as found at /sys/class/rc
TABLE - a file wit a set of scancode=keycode value pairs
SCANKEY - a set of scancode1=keycode1,scancode2=keycode2.. value pairs
PROTOCOL - protocol name (nec, rc-5, rc-6, other) to be enabled
DELAY - Delay before repeating a keystroke
PERIOD - Period to repeat a keystroke
CFGFILE - configuration file that associates a driver/table name with a
keymap file
Options can be combined together.
-a, --auto-load=CFGFILE Auto-load a table, based on a configuration file.
Only works with sysdev.
-c, --clear clears the old table
-d, --device=DEV ir device to control
-D, --delay=DELAY Sets the delay before repeating a keystroke
-k, --set-key=SCANKEY Change scan/key pairs
-p, --protocol=PROTOCOL Protocol to enable (the other ones will be
disabled). To enable more than one, use the option
more than one time
-P, --period=PERIOD Sets the period to repeat a keystroke
-r, --read reads the current scancode/keycode table
-s, --sysdev=SYSDEV ir class device to control
-t, --test test if IR is generating events
-v, --verbose enables debug messages
-w, --write=TABLE write (adds) the scancodes to the device
scancode/keycode table from an specified file
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
Report bugs to Mauro Carvalho Chehab <mchehab@redhat.com>.
Reading through that Arch Linux thread I referenced earlier, it is for a MCEUSB IR receiver, not the ASRock's Nuvotron IR receiver, and most of the Arch Linux users who posted in that thread 'solve' the problem by blacklisting or removing the ir-core mceusb module and re-instating the old LIRC lirc_mceusb module. Which is not a solution, really, it's a 'work-around'.
Anyway, one of the things in that thread that caught my eye was the
showkey command. I tried it in a Konsole, and it displays a key code for every key I press on the ASRock remote. And it seems that some (all?) of the keys on the remote are being interpreted as if I am pressing a key or keys on my keyboard. For example, if I press the ON/OFF key at the top right of the remote, KDE pops up its logout window ('the one which prompts the user to click on 'Logout', 'Turn Off Computer' or 'Restart Computer'). If I press ENTER on the remote then I get five carriage returns in a KWrite window. If I press the ^ key on the remote then the cursor moves up five lines in a KWrite window. And so on.
The command
cat /proc/bus/input/devices shows the following:
- Code: Select all
I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=PNP0C0C/button/input0
S: Sysfs=/devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input0
U: Uniq=
H: Handlers=kbd event0
B: EV=3
B: KEY=100000 0 0 0
I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=LNXPWRBN/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1
U: Uniq=
H: Handlers=kbd event1
B: EV=3
B: KEY=100000 0 0 0
I: Bus=0003 Vendor=0603 Product=00f2 Version=0110
N: Name="NOVATEK USB Keyboard"
P: Phys=usb-0000:00:04.0-3/input0
S: Sysfs=/devices/pci0000:00/0000:00:04.0/usb2/2-3/2-3:1.0/input/input2
U: Uniq=
H: Handlers=sysrq kbd event2
B: EV=120013
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=1f
I: Bus=0003 Vendor=0603 Product=00f2 Version=0110
N: Name="NOVATEK USB Keyboard"
P: Phys=usb-0000:00:04.0-3/input1
S: Sysfs=/devices/pci0000:00/0000:00:04.0/usb2/2-3/2-3:1.1/input/input3
U: Uniq=
H: Handlers=kbd event3
B: EV=13
B: KEY=7fff8000 0 2000000 3878 d801d001 1e0000 0 0 0
B: MSC=10
I: Bus=0003 Vendor=045e Product=00d1 Version=0111
N: Name="Microsoft Microsoft Optical Mouse with Tilt Wheel"
P: Phys=usb-0000:00:04.0-4/input0
S: Sysfs=/devices/pci0000:00/0000:00:04.0/usb2/2-4/2-4:1.0/input/input4
U: Uniq=
H: Handlers=mouse0 event4
B: EV=17
B: KEY=170000 0 0 0 0 0 0 0 0
B: REL=1c3
B: MSC=10
I: Bus=0010 Vendor=001f Product=0001 Version=0100
N: Name="PC Speaker"
P: Phys=isa0061/input0
S: Sysfs=/devices/platform/pcspkr/input/input5
U: Uniq=
H: Handlers=kbd event5
B: EV=40001
B: SND=6
I: Bus=0019 Vendor=1050 Product=00b4 Version=0073
N: Name="Nuvoton w836x7hg Infrared Remote Transceiver"
P: Phys=
S: Sysfs=/devices/virtual/rc/rc0/input6
U: Uniq=
H: Handlers=kbd event6
B: EV=100013
B: KEY=fff 0 0 0 108fc326 2176051 0 0 0 7 158000 4190 100001 9e9680 0 0 10000000
B: MSC=10
I: Bus=0001 Vendor=10ec Product=0885 Version=0001
N: Name="HDA Digital PCBeep"
P: Phys=card0/codec#0/beep0
S: Sysfs=/devices/pci0000:00/0000:00:08.0/input/input7
U: Uniq=
H: Handlers=kbd event7
B: EV=40001
B: SND=6
You can see from the above output that the remote is being seen as a normal input device by the kernel.
Also, to reiterate, in my case the lirc daemon is not running (no /etc/init.d/lircd initscript exists and the daemon is definitely not running).
So my conclusions (which may be wrong!) are as follows:
a) No LIRC daemon is needed to use the ir-core modules. I'm not sure
what, if anything, of the app-misc/lirc package is actually needed when using the nuvotron-cir module.
b) Only the ir-core modules are needed. In my case I think the only ones I need loaded to enable me to use the ASRock remote are the following (I used rmmod -f to remove the others, and the remote is still driving XBMC):
- Code: Select all
# lsmod | grep lirc
ir_lirc_codec 2716 0
lirc_dev 6598 1 ir_lirc_codec
ir_core 10387 4 ir_lirc_codec,ir_rc6_decoder,nuvoton_cir
c) I need to find a way to map the keys on the remote to the keys and mouse clicks that XBMC understands. How to do that is the $64,000 question.
