[LINUX] HOW-TO use all custom buttons of your remote control with LIRC
#31
here are my config files:

~/.xbmc/userdata/Keymap.xml
copy of /usr/share/xbmc/system/keymaps/remote.xml

~/.xbmc/userdata/keymaps/remote.xml
copy of /usr/share/xbmc/system/keymaps/remote.xml

~/.xbmc/userdata/Lircmap.xml
Code:
<!-- This file contains the mapping of LIRC keys to XBMC keys used in Keymap.xml  -->
<!--                                                                              -->
<!-- How to add remotes                                                           -->
<!-- <remote device="name_Lirc_calls_the_remote">                                 -->
<!--                                                                              -->
<!-- For the commands the layout following layout is used                         -->
<!-- <XBMC_COMMAND>LircButtonName</XBMC_COMMAND>                                  -->
<!--                                                                              -->
<!-- For a list of XBMC_COMMAND's check out the <remote> sections of keymap.xml   -->

<lircmap>
    <remote device="thomson_roc4507">
        <play>play</play>
        <pause>pause</pause>
        <stop>stop</stop>
        <forward>forward</forward>
        <reverse>rewind</reverse>
        <left>left</left>
        <right>right</right>
        <up>up</up>
        <down>down</down>
        <select>select</select>
        <pageplus>ch+</pageplus>
        <pageminus>ch-</pageminus>
        <back>exit</back>
        <menu>menu</menu>
        <title>l1</title>
        <info>l2</info>
        <skipplus>l3</skipplus>
        <skipminus>l4</skipminus>
        <display>text</display>
        <start>play</start>
        <record>rec</record>
        <volumeplus>vol+</volumeplus>
        <volumeminus>vol-</volumeminus>
        <mute>mute</mute>
        <power>power</power>
        <one>1</one>
        <two>2</two>
        <three>3</three>
        <four>4</four>
        <five>5</five>
        <six>6</six>
        <seven>7</seven>
        <eight>8</eight>
        <nine>9</nine>
        <zero>0</zero>
        <enter>select</enter>
        <red>red</red>
        <green>green</green>
    </remote>    
</lircmap>

remote.conf
Code:
# Please make this file available to others
# by sending it to <[email protected]>
#
# this config file was automatically generated
# using lirc-0.8.6(default) on Tue Nov 10 22:07:17 2009
#
# contributed by SkaveRat
#
# brand: Thomson
# model no. of remote control: Scenium ROC4507
# devices being controlled by this remote: TV DVD STB AMP
#

begin remote

  name  thomson_roc4507
  bits           12
  flags SPACE_ENC
  eps            30
  aeps          100

  one           502  4549
  zero          502  2021
  ptrail        499
  gap           41146
  min_repeat      0
#  toggle_bit_mask 0x80
  toggle_bit 5

      begin codes
          power                 0x31D
          1                     0x300
          2                     0x308
          3                     0x310
          4                     0x301
          5                     0x309
          6                     0x311
          7                     0x302
          8                     0x30A
          9                     0x312
          0                     0x30E
          av                    0x318
          mute                  0x305
          169                   0x317
          vol+                  0x329
          vol-                  0x32A
          ch+                 0x325
          ch-                 0x327
          left                  0x336
          right                 0x337
          up                    0x30B
          down                  0x30D
          select                    0x30C
          menu                  0x331
          exit                  0x33E
          l1                    0x316
          l2                    0x307
          l3                    0x315
          l4                    0x328
          text                  0x31E
          zoom                  0x304
          showchannel           0x338
          halftext              0x31C
          resettext             0x33E
          red                   0x339
          green                 0x33B
          purple                0x31E
          yellow                0x338
          blue                  0x315
          rewind                0x41F
          play                  0x420
          forward               0x421
          stop                  0x424
          rec                   0x43E
          pause                 0x418
      end codes

end remote
Reply
#32
great support, guys
Reply
#33
Thanks for the tutorial, it helped alot.

But i still have a problem. I'm on linux and i'm trying to use Apple Remote (6 buttons) with XBMC. The buttons are reconized by XBMC, but i can't figure how to enable "long presses", to make it work like this mapping : http://wiki.xbmc.org/index.php?title=Glo...ple_Remote
But on this page, they use the remote as a Joystick (on Mac), but here i use Lirc.

Someone know how to do that ?
Reply
#34
Great tutorial thx a lot, but i just don't seem to get it working as it should. My remote does work, at least irw command gives me the expected output and names of the buttons. But xbmc just does not seem do care if i put a Lirmap.xml, Keymap.xml or whatever into the userdata folder. It just treats the remote as a mouse (its the iMON-PAD) so it only detects mouse movement using the stick and left and right click buttons. Nothing else works. I tried every possible combination of files and though i initially thought i understood how the various config files are supposed to work, xbmc just won't mind at all Sad

What could be wrong with my config?

i have put the following content into my .xbmc/userdata/Lircmap.xml
[HTML]
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file contains the mapping of LIRC keys to XBMC keys used in Keymap.xml -->
<lircmap>
<remote device="iMON-PAD">
<pause>Pause</pause>
<stop>Stop</stop>
<forward>FastForward</forward>
<reverse>Rewind</reverse>
<left>Left</left>
<right>Right</right>
<up>Up</up>
<down>Down</down>
<select>Enter</select>
<pageplus>Chan+</pageplus>
<pageminus>Chan-</pageminus>
<back>Backspace</back>
<menu>LeftMenu</menu>
<title>RightMenu</title>
<info>RightClick</info>
<skipplus>NextChapter</skipplus>
<skipminus>PrevChapter</skipminus>
<display>AspectRatio</display>
<start>MultiMon</start>
<record>Record</record>
<volumeplus>Vol+</volumeplus>
<volumeminus>Vol-</volumeminus>
<mute>Mute</mute>
<power>Power</power>
<myvideo>MyVideo</myvideo>
<mymusic>MyMusic</mymusic>
<mypictures>MyPhoto</mypictures>
<mytv>MyTV</mytv>
<one>1</one>
<two>2</two>
<three>3</three>
<four>4</four>
<five>5</five>
<six>6</six>
<seven>7</seven>
<eight>8</eight>
<nine>9</nine>
<zero>0</zero>
</remote>
</lircmap>[/HTML]


My .xbmc/userdata/Keymap.xml and .xbmc/userdata/keymaps/remote.xml contain the following:
[HTML]
<keymap>
<global>
<remote>
<play>Play</play>
<pause>Pause</pause>
<stop>Stop</stop>
<forward>FastForward</forward>
<reverse>Rewind</reverse>
<left>Left</left>
<right>Right</right>
<up>Up</up>
<down>Down</down>
<select>Select</select>
<pageplus>PageUp</pageplus>
<pageminus>PageDown</pageminus>
<back>ParentDir</back>
<menu>PreviousMenu</menu>
<title>ContextMenu</title>
<info>Info</info>
<skipplus>SkipNext</skipplus>
<skipminus>SkipPrevious</skipminus>
<display>FullScreen</display>
<start>PreviousMenu</start>
<record>Screenshot</record>
<volumeplus>VolumeUp</volumeplus>
<volumeminus>VolumeDown</volumeminus>
<mute>Mute</mute>
<power>XBMC.ShutDown()</power>
<myvideo>XBMC.ActivateWindow(MyVideos)</myvideo>
<mymusic>XBMC.ActivateWindow(MyMusic)</mymusic>
<mypictures>XBMC.ActivateWindow(MyPictures)</mypictures>
<mytv>XBMC.ActivateWindow(Home)</mytv>
<red>XBMC.ActivateWindow(Home)</red>
<green>XBMC.ActivateWindow(MyVideos)</green>
<yellow>XBMC.ActivateWindow(MyMusic)</yellow>
<blue>XBMC.ActivateWindow(MyPictures)</blue>
<zero>Number0</zero>
<one>Number1</one>
<two>JumpSMS2</two>
<three>JumpSMS3</three>
<four>JumpSMS4</four>
<five>JumpSMS5</five>
<six>JumpSMS6</six>
<seven>JumpSMS7</seven>
<eight>JumpSMS8</eight>
<nine>JumpSMS9</nine>
</remote>
</global>
</keymap>[/HTML]


But still, xbmc just does not care. I don't know what else to try. As i said, the remote itself and lirc seem to work, as each key is correctly interpreted by irw. At least the names it prints seem to be ok and match the names used in my Lircmap.xml file.

Even the vfd display works wonderfully. So it has to be a tiny little mistake or something i have forgotten.

Every advice will be greatly appreciated, as i am doing this over and over for days now Sad

I also tried each possible combination of the System/input settings concerning keyboard input and mouse enabling/disabling so far. Which one would be the correct setting there?

Thx

regime
Reply
#35
regime Wrote:Great tutorial thx a lot, but i just don't seem to get it working as it should. My remote does work, at least irw command gives me the expected output and names of the buttons. But xbmc just does not seem do care if i put a Lirmap.xml, Keymap.xml or whatever into the userdata folder. It just treats the remote as a mouse (its the iMON-PAD) so it only detects mouse movement using the stick and left and right click buttons. Nothing else works. I tried every possible combination of files and though i initially thought i understood how the various config files are supposed to work, xbmc just won't mind at all Sad

This is probably a driver problem. I guess you are using the lirc_imon driver for your iMON-PAD device. This driver has an option to disable mouse support. It might be enough if you just add "nomouse=1" as module parameter.

Code:
echo "options lirc_imon nomouse=1" | sudo tee /etc/modprobe.d/lirc_imon.conf

You can try it manually first:

Code:
sudo service lirc stop
sudo rmmod lirc_imon
sudo modprobe lirc_imon nomouse=1
sudo service lirc start
sudo service xbmc restart
Reply
#36
Code:
echo "options lirc_imon nomouse=1" | sudo tee /etc/modprobe.d/lirc_imon.conf

Sorry, i forgot to mention that I have already added this option. Though i wonder if it has any effect. It seems that it does not and i don't notice any difference.

Thanks

regime

P.S.: I also added the often mentioned usbhid quirk to the modprobe options.
Reply
#37
regime Wrote:Sorry, i forgot to mention that I have already added this option. Though i wonder if it has any effect. It seems that it does not and i don't notice any difference.

You can try it manually by stopping the lirc service, unloading the module (rmmod) and reloading it (modprobe) with the correct parameters. Before loading the module again, use lsmod to make sure that unloading was successfull.

Sorry, but I'm not really into these imon devices any more. Though I would expect that XBMC picks up the same input button events as irw. So if irw reports the correct button, XBMC should pick it up, too.

Maybe the guys in the IMON thread http://forum.xbmc.org/showthread.php?tid=40290 know more about your issue.
Reply
#38
hi, i partially understand the setup of this, but how do i know these values

The LIRC name of your remote.
The LIRC button names of your remote

my setup is LiveCD 10.08 svn32696

Thanks
Scott Huh
Reply
#39
abster Wrote:how do i know these values

The LIRC name of your remote.
The LIRC button names of your remote

You can extract them from the LIRC configuration file /etc/lirc/lircd.conf or you can use the command line tool 'irw' to get these values. Open a console and enter...

Code:
sudo irw

Now you can press every button on the remote and irw will return the name of the button and the name of the remote. A sample output could look like this:

Code:
0000000000001794 00 Up Hauppauge_350
0000000000001794 01 Up Hauppauge_350
0000000000001796 00 Left Hauppauge_350
0000000000001796 01 Left Hauppauge_350
0000000000001795 00 Down Hauppauge_350
0000000000001795 01 Down Hauppauge_350
0000000000001797 00 Right Hauppauge_350
Reply
#40
the irw command doesnt output anything, from the deamon log i can see this:-

need to look into is, its a mce remote

Aug 25 00:11:08 XBMCLive lircd-0.8.6[940]: accepted new client on /var/run/lirc/lircd
Aug 25 00:11:08 XBMCLive lircd-0.8.6[940]: could not get file information for /dev/lirc0
Aug 25 00:11:08 XBMCLive lircd-0.8.6[940]: default_init(): No such file or directory
Aug 25 00:11:08 XBMCLive lircd-0.8.6[940]: Failed to initialize hardware
Aug 25 00:12:02 XBMCLive lircd-0.8.6[940]: accepted new client on /var/run/lirc/lircd
Aug 25 00:12:15 XBMCLive lircd-0.8.6[940]: removed client
Aug 25 00:16:29 XBMCLive lircd-0.8.6[940]: accepted new client on /var/run/lirc/lircd


thanks
scott

Temar Wrote:You can extract them from the LIRC configuration file /etc/lirc/lircd.conf or you can use the command line tool 'irw' to get these values. Open a console and enter...

Code:
sudo irw

Now you can press every button on the remote and irw will return the name of the button and the name of the remote. A sample output could look like this:

Code:
0000000000001794 00 Up Hauppauge_350
0000000000001794 01 Up Hauppauge_350
0000000000001796 00 Left Hauppauge_350
0000000000001796 01 Left Hauppauge_350
0000000000001795 00 Down Hauppauge_350
0000000000001795 01 Down Hauppauge_350
0000000000001797 00 Right Hauppauge_350
Reply
#41
abster Wrote:Aug 25 00:11:08 XBMCLive lircd-0.8.6[940]: Failed to initialize hardware

LIRC is unable to initialize your infrared receiver.

You have to configure LIRC first. As I don't know anything about XBMCLive, I can't help you here. However, if XBMCLive is a Debian based distribution you might be able to configure LIRC by simply entering...

Code:
sudo dpkg --configure lirc


You have to make sure that 'irw' outputs some data, before you can continue with this Howto.
Reply
#42
yeah, im slightly puzzled by this as the IR is working slightly (arrow keys move through menus and 'esc' stop, pause etc)

it is usable
i'll tinker further tonight Nerd

Thanks
Scott


Temar Wrote:LIRC is unable to initialize your infrared receiver.

You have to configure LIRC first. As I don't know anything about XBMCLive, I can't help you here. However, if XBMCLive is a Debian based distribution you might be able to configure LIRC by simply entering...

Code:
sudo dpkg --configure lirc


You have to make sure that 'irw' outputs some data, before you can continue with this Howto.


I give up with it, i updated to latest lirc, checked config etc, then i updated ubuntu core, wasnt a good move, it seemed to disable my hdmi audio, finally gave up and backed up and reinstalled, im just going to live with the remote as is till i understand linux better.

another xbmcfreak release is due in a few weeks, perhaps i'll try again then

id have liked to get some mame games and firefox working under darma, but launcher isnt working as good and im getting lost with the games, perhaps everything will be automatic addons soon.

ahh i feel better now ha ha
scott
Reply
#43
i found the solution to my problem and as i had expected it was trivial. Well i guess this is the way it mostly is with it stuff so here i am to share what i learned.

The missing link between xbmc and lirc was simply and embarassingly an entry in my hardware.conf which sets the output socket for the lircd. So after setting the property REMOTE_SOCKET to "/var/run/lirc/lircd" everything worked like a charm. I still do not fully grok the difference between setting it and not setting it though as my irw seemed to be able to connec to the socket when running with root privileges. Only when i tried irw with a non root account i realized that it gave me a permission denied error which then quickly enabled me to further isolate the cause of the problem. Obviously setting the remote socket explicitly somehow affects the permissions of the socket file.

That's it folks. I hope someone will one day read this and use it as a shortcut to a blissfull xbmc experience Smile

One more thing: Configuring the lircrc config file to be able to launch xbmc using only my remote control did not quite work out. I got to launch it, but once i did so using irexec and the lircrc i could not use all my buttons within xbmc any more. But that is just a minor issue and does not bother me too much. There will certainly be a solution waiting for me somewhere.

Right now, the only thing i want to do is to finally enjoy my HTPC and Logitech Harmony twosome watching a few nice movies and hopefully sleep away my cold.

Thanks for your help.

regime
Reply
#44
After installing Dharma 3 beta I can't modify my keys anymore. When I'm using IRW I'm getting just some replies with [[ and so on... no keynames. So the remote itself is working

I checked the lircd.conf and the lircmap.xml - for me it looks OK:

lircd.conf:
include "/usr/share/lirc/remotes/mceusb/lircd.conf.mceusb"

lircmap.xml:
<lircmap>
<remote device="mceusb">
<play>KEY_PLAY</play>
<pause>KEY_PAUSE</pause>
<stop>KEY_STOPCD</stop>
<forward>KEY_FASTFORWARD</forward>
<reverse>KEY_REWIND</reverse>

keymap.xml:
<keymap>
<global>
<remote>
<pageminus>ContextMenu</pageminus>
<mute>FullScreen</mute>
<clear>XBMC.ActivateWindow(Home)</clear>
<record>OSD</record>
<pause>Close</pause>

I think it's just a small thing, but I can't find it out...
Reply
#45
Zubbeli Wrote:After installing Dharma 3 beta I can't modify my keys anymore.

At least Dharma Beta 2 does not support the Keymap.xml file any more. I don't know if they fixed it in Dharma Beta 3 but it does not really matter. The Keymap.xml file was still supported in Confluence but already marked as deprecated.

The new file name for the remote keymapping is: $HOME/.xbmc/userdata/keymaps/remote.xml

So you can just copy your current Keymap.xml to that location:

Code:
cp $HOME/.xbmc/userdata/Keymap.xml $HOME/.xbmc/userdata/keymaps/remote.xml


Quote:When I'm using IRW I'm getting just some replies with [[ and so on... no keynames.

When using irw you should always see a line which lists the name of the remote and the name of the button which was pressed. Otherwise something is wrong with your LIRC setup.
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] HOW-TO use all custom buttons of your remote control with LIRC2