XBMC imon and lirc settings

imon-remote: Image taken from the Soundgraph website.iMon-remote
I use XBMC on my HTPC, and it is great. I'm using a case that has a built in iMon IR receiver and vfd readout, which also lets me turn the system on from off (which isn't common with lots of PC remote controls). XBMC needs to be set up to work with these.

As my HTPC runs on linux (Arch linux to be precise), this first of all means setting up lirc and lcdproc. My case also has a volume knob and some media control buttons on the front that need setting up too. There are plenty of guides out there on how to set these up, so I'm not going to here - I'm just going to give my config files that might be useful for others.



The first is lircd.conf. Lirc supply this for the remote, so I have just added the necessary values for my front panel buttons:

begin remote

  name  Front_Panel
  bits           40
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  post_data_bits  24
  post_data      0x1EE
  gap          23991
  min_repeat      9
  toggle_bit_mask 0x3000000

      begin codes
          Stop                     0x0000000004
          Rewind                   0x0000000007
          Play                     0x0000000002
          Forward                  0x0000000008
          Pause                    0x0000000003
          Knob_AC                  0x0100000000
          Knob_CW                  0x0001000000
      end codes

end remote

begin remote

  name     iMON-PAD
  bits           32
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  gap          235965
  min_repeat      1
  toggle_bit      0


      begin codes
          AppExit                  0x288195B7
          Power                    0x289115B7
          Record                   0x298115B7
          Play                     0x2A8115B7
          SlowMotion               0x29B195B7
          Rewind                   0x2A8195B7
          Pause                    0x2A9115B7
          FastForward              0x2B8115B7
          PrevChapter              0x2B9115B7
          Stop                     0x2B9715B7
          NextChapter              0x298195B7
          Esc                      0x2BB715B7
          Eject                    0x299395B7
          AppLauncher              0x29B715B7
          MultiMon                 0x2AB195B7
          TaskSwitcher             0x2A9395B7
          Mute                     0x2B9595B7
          Vol+                     0x28A395B7
          Vol-                     0x28A595B7
          Ch+                      0x289395B7
          Ch-                      0x288795B7
          Timer                    0x2B8395B7
          1                        0x28B595B7
          2                        0x2BB195B7
          3                        0x28B195B7
          4                        0x2A8595B7
          5                        0x299595B7
          6                        0x2AA595B7
          7                        0x2B9395B7
          8                        0x2A8515B7
          9                        0x2AA115B7
          0                        0x2BA595B7
          ShiftTab                 0x28B515B7
          Tab                      0x29A115B7
          MyMovie                  0x2B8515B7
          MyMusic                  0x299195B7
          MyPhoto                  0x2BA115B7
          MyTV                     0x28A515B7
          Bookmark                 0x288515B7
          Thumbnail                0x2AB715B7
          AspectRatio              0x29A595B7
          FullScreen               0x2AA395B7
          MyDVD                    0x29A395B7
          Menu                     0x2BA3D5B7
# different codes
          MyDVD                    0x29A395B7
          Menu                     0x2BA3D5B7

          Caption                  0x298595B7
          Language                 0x2B8595B7
          MouseKeyboard            0x299115B7
          SelectSpace              0x2A9315B7
          MouseMenu                0x28B715B7
          MouseRightClick          0x688481B7
          Enter                    0x28A195B7
          MouseLeftClick           0x688301B7
          WindowsKey               0x2B8195B7
          Backspace                0x28A115B7
# Corrin added
	  Space                    0x2B9B15F7
          Up                       0xEB53F9B7
          Left                     0x6ABAFFBF
          Down                     0x6F9ECBB7
          Right                    0x69A281B7
# Variants and additions of keys reported by Ryan Gardner
          1                        0x0200001E
          2                        0x0200001F
          3                        0x02000020
          4                        0x02000021
          5                        0x02000022
          6                        0x02000023
          7                        0x02000024
          8                        0x02000025
          9                        0x02000026
          Star                     0x02200025
          0                        0x02000027
          Hash                     0x02200020
          Backspace                0x0200002A
          Select                   0x0200002C
          LeftMenu                 0x02800000
          RightMenu                0x02000065
          Enter                    0x02000028
          Escape                   0x02000029
          LeftClick                0x01010000
          RightClick               0x01020000
          Up                       0x01008000
          Down                     0x01007F00
          Left                     0x01000080
          Right                    0x0100007F
# Variations on the mouse buttons from Jan Schneider
          LeftClick                0x01010080
          RightClick               0x01020080

      end codes

end remote


# this config file was automatically generated
# using lirc-0.8.5(default) on Tue May 26 22:07:16 2009
#
# contributed by Karl Newman, based on lircd.conf.imon-pad in lirc-0.8.4
# devices with USB ID 0x15c2, 0x0038 are using 64 codes in 0.8.5
#
# brand:                       iMON-New
# model no. of remote control: iMON-PAD
# devices being controlled by this remote:
#

begin remote

  name     iMON-PAD
  bits           64
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  gap          135993
  toggle_bit_mask 0x0
  ignore_mask 0x00000000FFFFFFFF

      begin codes
          AppExit                  0x288195B700002401
          Power                    0x289115B700002401
          Record                   0x298115B700002401
          Play                     0x2A8115B700002401
          SlowMotion               0x29B195B700002401
          Rewind                   0x2A8195B700002401
          Pause                    0x2A9115B700002401
          FastForward              0x2B8115B700002401
          PrevChapter              0x2B9115B700002401
          Stop                     0x2B9715B700002401
          NextChapter              0x298195B700002401
          Esc                      0x2BB715B700002401
          Eject                    0x299395B700002401
          AppLauncher              0x29B715B700002401
          MultiMon                 0x2AB195B700002401
          TaskSwitcher             0x2A9395B700002401
          Mute                     0x2B9595B700002401
          Vol+                     0x28A395B700002401
          Vol-                     0x28A595B700002401
          Ch+                      0x289395B700002401
          Ch-                      0x288795B700002401
          Timer                    0x2B8395B700002401
          1                        0x28B595B700002401
          2                        0x2BB195B700002401
          3                        0x28B195B700002401
          4                        0x2A8595B700002401
          5                        0x299595B700002401
          6                        0x2AA595B700002401
          7                        0x2B9395B700002401
          8                        0x2A8515B700002401
          9                        0x2AA115B700002401
          0                        0x2BA595B700002401
          ShiftTab                 0x28B515B700002401
          Tab                      0x29A115B700002401
          MyMovie                  0x2B8515B700002401
          MyMusic                  0x299195B700002401
          MyPhoto                  0x2BA115B700002401
          MyTV                     0x28A515B700002401
          Bookmark                 0x288515B700002401
          Thumbnail                0x2AB715B700002401
          AspectRatio              0x29A595B700002401
          FullScreen               0x2AA395B700002401
          MyDVD                    0x29A395B700002401
          Menu                     0x2BA3D5B700002401
# different codes
# These codes are the button release codes, which will cause duplicate
# events, so they are commented out here.
#          MyDVD                    0x29A3D5B700002401
#          Menu                     0x2BA3D5B700002401

          Caption                  0x298595B700002401
          Language                 0x2B8595B700002401
          MouseKeyboard            0x299115B700002401
          SelectSpace              0x2A9315B700002401
          MouseMenu                0x28B715B700002401
          MouseRightClick          0x688481B700002401
          Enter                    0x28A195B700002401
          MouseLeftClick           0x688301B700002401
          WindowsKey               0x2B8195B700002401
          Backspace                0x28A115B700002401
# Corrin added
          Space                    0x2B9B15F700002401
          Up                       0xEB53F9B700002401
          Left                     0x6ABAFFBF00002401
          Down                     0x6F9ECBB700002401
          Right                    0x69A281B700002401
# Variants and additions of keys reported by Ryan Gardner
          1                        0x0200001E00000000
          2                        0x0200001F00000000
          3                        0x0200002000000000
          4                        0x0200002100000000
          5                        0x0200002200000000
          6                        0x0200002300000000
          7                        0x0200002400000000
          8                        0x0200002500000000
          9                        0x0200002600000000
          Star                     0x0220002500000000
          0                        0x0200002700000000
          Hash                     0x0220002000000000
          Backspace                0x0200002A00000000
          Select                   0x0200002C00000000
          LeftMenu                 0x0280000000000000
          RightMenu                0x0200006500000000
          Enter                    0x0200002800000000
          Escape                   0x0200002900000000
          LeftClick                0x0101000000000000
          RightClick               0x0102000000000000
          Up                       0x0100800000000000
          Down                     0x01007F0000000000
          Left                     0x0100008000000000
          Right                    0x0100007F00000000
      end codes

end remote



Check that this is working with irw - if so, then it is time to set up XBMC. This means setting up Lircmap.xml:

<lircmap>
	<remote device="Front_Panel">
		<play>Play</play>
		<reverse>Rewind</reverse>
		<pause>Pause</pause>
		<forward>Forward</forward>
		<stop>Stop</stop>
		<volumeplus>Knob_CW</volumeplus>
		<volumeminus>Knob_AC</volumeminus>
	</remote>

       <remote device="iMON-PAD">
                <power>AppExit</power>
                <record>Record</record>
                <play>Play</play>
                <!--SlowMotion-->
                <reverse>Rewind</reverse>
                <pause>Pause</pause>
                <forward>FastForward</forward>
                <skipminus>PrevChapter</skipminus>
                <stop>Stop</stop>
                <skipplus>NextChapter</skipplus>
                <back>Backspace</back>
                <select>Select</select>
                <menu>LeftMenu</menu>
                <title>RightMenu</title>
                        <!--LeftClick
                        RightClick-->
                <select>Enter</select>
                <down>Down</down>
                <left>Left</left>
                <up>Up</up>
                <right>Right</right>
                <clear>Escape</clear>
                <obc1>Eject</obc1>
                        <!--AppLauncher-->
                <info>MultiMon</info>
                        <!--TaskSwitcher-->
                <mute>Mute</mute>
                <volumeplus>Vol+</volumeplus>
                <volumeminus>Vol-</volumeminus>
                <channelplus>Ch+</channelplus>
                <channelminus>Ch-</channelminus>
                        <!--Timer-->
                <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>
                <star>Star</star>
                <zero>0</zero>
                <hash>Hash</hash>
                <myvideo>MyMovie</myvideo>
                <mymusic>MyMusic</mymusic>
                <mypictures>MyPhoto</mypictures>
                <myTV>MyTV</myTV>
                        <!--Bookmark
                        Thumbnail
                        AspectRatio-->
                <display>FullScreen</display>
                        <!--MyDVD-->
                <menu>Menu</menu>
                <subtitle>Caption</subtitle>
                <language>Language</language>
        </remote>
</lircmap>



So there we are. I'll assume this is all working for now, and move on to the vfd. This means setting up lcdproc. Again, this is well covered in many other guides, so I'll move straight onto getting xbmc to work with it, which uses LCD.xml:

<lcd>
   <navigation>
      <line>$INFO[System.CurrentWindow]</line>
      <line>$INFO[System.CurrentControl]</line>
   </navigation>
   <music>
      <line>$INFO[Player.Time]/$INFO[Player.Duration]</line>
      <line>$INFO[MusicPlayer.Artist] - $INFO[MusicPlayer.Title] ----- </line>
   </music>
   <video>
      <line>$INFO[Player.Time]/$INFO[Player.Duration]</line>
      <line>$INFO[LCD.ProgressBar]</line>
   </video>
   <general>
      <line>$INFO[System.Time]</line>
      <line>$INFO[System.Date]</line>
   </general>
   <screensaver>
      <line>$INFO[System.Time]</line>
      <line>$INFO[System.Date]</line>
   </screensaver>
   <xbelaunch>
      <line>Playing</line>
      <line>$INFO[System.LaunchXBE]</line>
   </xbelaunch>
</lcd>



Finally, I have a couple of options set in advancedsettings.xml:

<advancedsettings>
        <videolibrary>
                <hideallitems>true</hideallitems>
                <flattentvshows>0</flattentvshows>
        </videolibrary>
        <musiclibrary>
                <allitemsonbottom>true</allitemsonbottom>
        </musiclibrary>
        <lcd>
                <rows>2</rows>
                <columns>16</columns>
                <scrolldelay>3</scrolldelay>
        </lcd>
</advancedsettings>