You have to understand the mechanism first:
1. The xbmc recognizes lircd as a generic remote control.
2. lirc further can connect to various remotes based on configuration in /etc/lircd.conf and present them as lirc remote to xbmc.
Now, first of all, you have to know what is the name of your remote device in linux. For this, you need to install input-utils:
apt-get install input-utils
Now when you say:
it shows you all the input devices on your system. In my case, among other, I see:
bustype : BUS_PCI
vendor : 0x1043
product : 0x4876
version : 1
name : "saa7134 IR (ASUSTeK P7131 Hybri"
phys : "pci-0000:05:00.0/ir0"
bits ev : EV_SYN EV_KEY EV_REP
This shows that the remote is indeed connected to the system and recognized as /dev/input/event6 device. This device number may change among different boots. We shall fix it by a trick in the lirc configuration.
Now if you want to see whether the events from your remote are being received by the system or not, issue the following:
input-events -g -t5 6
This shows the events received from event6 device with a 6s timeout. Press the buttons on your remote and you should see the codes received on the console.
If you want to see how the remote is mapping keys to keycodes, then isssue the following command:
input-kbd 6 > keyMapIR.txt
where 6 indicates the device id. You might have a different one.
In case, you decide to change this encoding then you can change the keycodes in the keyMapIR.txt file and upload it back to the remote as:
input-kbd -f keyMapIR.txt 6
But normally this will not be required.
Now that you know that your device is connected and working properly, we can proceed to install lirc.
apt-get install lircd
During its installation, please choose the appropriate remote make. In my case, I chose ASUS MyCinema. That sets it. Now lirc waits for a connection on a given address. We do not go in this detail. If you look in the /etc/lirc/lircd.conf, you would see something like:
After tweaking, I have this file as following:
one 0 0
zero 0 0
Please note that the names of the buttons have been changed a bit to match with the xbmc configuration. Now after changing this file and having restarted lircd, you should issue irw command and press buttons on the remote to check the proper encoding of the keys by lirc. If everything is perfect, then we can now proceed to the xbmc configuration.
The file that we want to edit is /usr/share/xbmc/system/Lircmap.xml. Here you should add a section like the following:
The device name “lirc.conf” is the same that you see when you run irw command. You can see that the keys correspond to the keys in lircd config file.
Finally, we want lircd to always connect to the right device even if its device number changes after reboot. To this end, we need to change the /etc/init.d/lirc as follows:
#For remote only detection support, we need
#both REMOTE_DEVICE and TRANSMITTER_DEVICE undefined
if [ -z "$REMOTE_DEVICE" ] && [ -z "$TRANSMITTER_DEVICE" ] && [ -c $dev ]; then
#If we have a REMOTE_DEVICE or REMOTE_DRIVER defined (either because no devices
#were defined, OR if we explicitly did), then populate REMOTE_ARGS
if [ ! -z "$REMOTE_DEVICE" ] || [ ! -z "$REMOTE_DRIVER" ]; then
if [ -n "$REMOTE_DEVICE" ] && [ "$REMOTE_DEVICE" != "none" ]; then
if [ -n "$REMOTE_DRIVER" ] && [ "$REMOTE_DRIVER" != "none" ]; then
#Now, if we ALSO have a transmitter defined, add some args
#To make the first lircd listen up
if [ ! -z "$TRANSMITTER_DEVICE" ] || [ ! -z "$TRANSMITTER_DRIVER" ]; then
whereas $REMOTE_DEVICE is defined as REMOTE_DEVICE=’saa7134*’ in /etc/lirc/hardware.conf. This step makes sure that after a reboot, the lircd always connects to the IR device regardless of its device number assigned by linux kernel.
Just in case it is of help to someone, here is my /etc/lirc/hardware.conf file:
#Chosen Remote Control
REMOTE=”Asus MyCinema P7131″
#Chosen IR Transmitter
#Don’t start lircmd even if there seems to be a good config file
#Try to load appropriate kernel modules
# Default configuration files for your hardware if any
#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn’t have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to “false”