MCE Remote, LIRC in Kernel(Gentoo) full guide
#1
Smile 
This guid is specially for gentoo users with kernel 3+ (2.6.something at least, where lirc is in kernel) and the Logitech Harmony series remote

What you need
* MCE Compatible remote
* RC6 compatible IR receiver
* Kernel 2.7 or higher
* Gentoo (or something equal)

First step is to get the remote send the right commands(not using harmony, skip this part)
Add a new
* device [Computer => Media Center PC]
* Manufacturer = Microsoft
* Model = MCE

Should look like this
Image

Do not worry about button mappings, the original is good enough to get it to work, sync your remote

Second step is to configure the kernel and LIRC to work together
Uninstall any previous LIRC you may have

Prepare the kernel in the following way

cd /usr/src/linux; makemenuconfig
Device Drivers --->
<*> Multimedia support --->
<*> Remote Controller adapters --->
Image

Save on exit

at the /usr/src/linux
type
make && make modules && make modules_install
copy new /usr/src/linux/arch/i386/boot/bzImage to boot
modprobe rc_rc6_mce
modprobe ir_rc6_decoder
modprobe mceusb
reboot

If that part was to complicated read section 5 at gentoo-wiki

now that new kernel is booted and you type 'lsmod | grep mce' you should see following line
mceusb 9819 0
if not, then read gentoo-wiki

It is time to install LIRC(to get all the buttons on the remote to work, at this point some buttons should be working, such as navigation and play/paus etc.)

go to /etc/portage
in the file package.use add the following line (on a empty line)
app-misc/lirc lirc_devices_userspace
in the file package.keywords
app-misc/lirc ~x86

type
emerge -av app-misc/lirc

this should get you something like then a long list with options starting with '-'

These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ~] app-misc/lirc-0.9.0 USE="X -debug -doc -hardware-carrier -transmitter" LIRC_DEVICES="userspace

if it seems right type yes

Now we should get a working lircd.config (/etc/lirc/lircd.conf) I found some on the webb this is the one i use
Code:
#
# brand:                        HP
# model no. of remote control:  TSGH-IR01
# devices being controlled by this remote: HP Slimline S3100y
#
# RC-6 config file
#
# source: http://home.hccnet.nl/m.majoor/projects_remote_control.htm
#         http://home.hccnet.nl/m.majoor/pronto.pdf
#
# used by: Philips
#
#########
#
# Philips Media Center Edition remote control
# For use with the USB MCE ir receiver
#
# Dan Conti  dconti|acm.wwu.edu
#
# Updated with codes for MCE 2005 Remote additional buttons
# *, #, Teletext, Red, Green, Yellow & Blue Buttons
# Note: TV power button transmits no code until programmed.
# Updated 12th September 2005
# Graham Auld - mce|graham.auld.me.uk
#
# Radio, Print, RecTV are only available on the HP Media Center remote control
#
#
# Updated with codes for MCE 2007 Remote additional buttons
# Visualization, Aspect, SlideShow, Eject
# Note:
# Renamed some buttons: DVD->DVDMenu, More->MoreInfo, Star->Asterisk, Hash->Pound
# Note:
# Blue, Yellow, Green, Red, and Teletext buttons do not exist on the HP remote

begin remote

  name        mceusb
  bits                 16
  flags  RC6|CONST_LENGTH
  eps                  30
  aeps                100

  header       2667   889
  one           444   444
  zero          444   444
  pre_data_bits        21
  pre_data        0x37FF0
  gap              105000
  toggle_bit           22
  rc6_mask    0x100000000


      begin codes

#seen on HP Pavilion dv3t remote  --Tim Mann, 3 Nov 2009
    Media         0x00007b7f
    PlayPause     0x00007b91


#unused by HP remote
    Blue          0x00007ba1
    Yellow          0x00007ba2
    Green          0x00007ba3
    Red          0x00007ba4
    Teletext      0x00007ba5

#ba6 - bae unused
        BA6           0x00007ba6
        BA7           0x00007ba7
        BA8           0x00007ba8
        BA9           0x00007ba9
        BAA           0x00007baa
        BAB           0x00007bab
        BAC           0x00007bac
        BAD           0x00007bad
        BAE           0x00007bae

        Radio         0x00007baf
        Print         0x00007bb1

#bb2 - bb4 unused  
        BB2           0x00007bb2
        BB3           0x00007bb3
        BB4           0x00007bb4

        Videos        0x00007bb5
        Pictures      0x00007bb6
        RecTV         0x00007bb7
        Music         0x00007bb8
        TV            0x00007bb9

#bba - bbf unused
        BBA           0x00007bba
        BBB           0x00007bbb
        BBC           0x00007bbc
        BBD           0x00007bbd
        BBE           0x00007bbe
        BBF           0x00007bbf
#bc1 - bca unused
        BC1           0x00007bc1
        BC2           0x00007bc2
        BC3           0x00007bc3
        BC4           0x00007bc4
        BC5           0x00007bc5
        BC6           0x00007bc6
        BC7           0x00007bc7
        BC8           0x00007bc8
        BC9           0x00007bc9
        BCA           0x00007bca

        Eject         0x00007bcb
        SlideShow     0x00007bcc
        Visualization 0x00007bcd

#bce - bcf unused
        BCE           0x00007bce
        BCF           0x00007bcf
#bd1 - bd7 unused
        BD1           0x00007bd1
        BD2           0x00007bd2
        BD3           0x00007bd3
        BD4           0x00007bd4
        BD5           0x00007bd5
        BD6           0x00007bd6
        BD7           0x00007bd7

        Aspect        0x00007bd8
        Guide         0x00007bd9
        LiveTV        0x00007bda
        DVD           0x00007bdb
#NoGap
        Back          0x00007bdc
        OK            0x00007bdd
        Right         0x00007bde
        Left          0x00007bdf
        Down          0x00007be0
        Up            0x00007be1
#NoGap
        Star          0x00007be2
        Hash          0x00007be3
#NoGap
        Replay        0x00007be4
        Skip          0x00007be5
        Stop          0x00007be6
        Pause         0x00007be7
        Record        0x00007be8
        Play          0x00007be9
        Rewind        0x00007bea
        Forward       0x00007beb
#NoGap
        ChanDown      0x00007bec
        ChanUp        0x00007bed
        VolDown       0x00007bee
        VolUp         0x00007bef
#NoGap
        More          0x00007bf0
        Mute          0x00007bf1
        Home          0x00007bf2
        Power         0x00007bf3
#NoGap
        Enter         0x00007bf4
        Clear         0x00007bf5
#NoGap
        Nine          0x00007bf6
        Eight         0x00007bf7
        Seven         0x00007bf8
        Six           0x00007bf9
        Five          0x00007bfa
        Four          0x00007bfb
        Three         0x00007bfc
        Two           0x00007bfd
        One           0x00007bfe
        Zero          0x00007bff
      end codes

end remote


#
# this config file was automatically generated
# using lirc-0.8.4a(default) on Tue Mar 10 19:27:09 2009
#
# contributed by
#

when this is done we type
/etc/init.d/lircd restart

To verify that the lircd config is correct we use irw (from lirc package)
just type irw in a terminal and then press the remotes buttons, should look something like this;
Image

Notice that all the commands seems to come 3 times enumerated from 0..2

If the commands seem to match you have a fully working lirc setup and we add it as a service
type
rc-update add /etc/init.d/lircd
* service /etc/init.d/lircd added to runlevel default

Final step is to configure XBMC

The only config left are
~/.xbmc/userdata/Lircmap.xml read more info about the file here
The one i used looks like this

Code:
<!-- <XBMC_COMMAND>LircButtonName</XBMC_COMMAND> -->
<!-- -->
<!--
For a list of XBMC_COMMAND's check out the <remote> sections of keymap.xml
-->
<lircmap>
<remote device="mceusb">
<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>OK</select>
<pageplus>ChanUp</pageplus>
<pageminus>ChanDown</pageminus>
<back>Back</back>
<menu>DVD</menu>
<title>Guide</title>
<info>More</info>
<skipplus>Skip</skipplus>
<skipminus>Replay</skipminus>
<display>Aspect</display>
<start>Home</start>
<record>Record</record>
<volumeplus>VolUp</volumeplus>
<volumeminus>VolDown</volumeminus>
<mute>Mute</mute>
<power>Power</power>
<myvideo>Videos</myvideo>
<mymusic>Music</mymusic>
<mypictures>Pictures</mypictures>
<mytv>TV</mytv>
<one>One</one>
<two>Two</two>
<three>Three</three>
<four>Four</four>
<five>Five</five>
<six>Six</six>
<seven>Seven</seven>
<eight>Eight</eight>
<nine>Nine</nine>
<zero>Zero</zero>
<star>Star</star>
<hash>Hash</hash>
<clear>Clear</clear>
<enter>Enter</enter>
<red>Red</red>
<green>Green</green>
<yellow>Yellow</yellow>
<blue>Blue</blue>
<teletext>Teletext</teletext>
</remote>
</lircmap>
Reply
#2
~/.xbmc/userdata/keymaps/remote.xml read more here

My remote.xml below, note that it is pretty much original
Code:
<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>
<enter>FullScreen</enter>
<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(VideoLibrary,TvShows)</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>
<Home>
<remote>
<info>XBMC.ActivateWindow(SystemInfo)</info>
<clear>XBMC.ActivateWindow(Weather)</clear>
<hash>XBMC.ActivateWindow(Settings)</hash>
</remote>
</Home>
<MyFiles>
<remote>
<clear>Delete</clear>
<zero>Highlight</zero>
<star>Move</star>
<hash>Rename</hash>
</remote>
</MyFiles>
<MyMusicPlaylist>
<remote>
<back>Playlist</back>
<!-- Close playlist -->
<clear>Delete</clear>
<zero>Delete</zero>
</remote>
</MyMusicPlaylist>
<MyMusicPlaylistEditor>
<remote>
<zero>Queue</zero>
</remote>
</MyMusicPlaylistEditor>
<MyMusicFiles>
<remote>
<zero>Queue</zero>
<star>Queue</star>
</remote>
</MyMusicFiles>
<MyMusicLibrary>
<remote>
<zero>Queue</zero>
<star>Queue</star>
</remote>
</MyMusicLibrary>
<FullscreenVideo>
<remote>
<zero>Number0</zero>
<one>Number1</one>
<two>Number2</two>
<three>Number3</three>
<four>Number4</four>
<five>Number5</five>
<six>Number6</six>
<seven>Number7</seven>
<eight>Number8</eight>
<nine>Number9</nine>
<left>StepBack</left>
<right>StepForward</right>
<up>BigStepForward</up>
<down>BigStepBack</down>
<back>SmallStepBack</back>
<menu>OSD</menu>
<start>OSD</start>
<select>AspectRatio</select>
<title>CodecInfo</title>
<info>Info</info>
<teletext>XBMC.ActivateWindow(Teletext)</teletext>
<subtitle>ShowSubtitles</subtitle>
<star>ShowSubtitles</star>
<language>AudioNextLanguage</language>
<hash>AudioNextLanguage</hash>
</remote>
</FullscreenVideo>
<VideoTimeSeek>
<remote>
<select>Select</select>
<enter>Select</enter>
</remote>
</VideoTimeSeek>
<FullscreenInfo>
<remote>
<title>CodecInfo</title>
<info>Close</info>
<menu>OSD</menu>
</remote>
</FullscreenInfo>
<PlayerControls>
<remote>
<menu>Close</menu>
</remote>
</PlayerControls>
<Visualisation>
<remote>
<left>PreviousPreset</left>
<right>NextPreset</right>
<up>IncreaseRating</up>
<down>DecreaseRating</down>
<back>LockPreset</back>
<title>CodecInfo</title>
<select>XBMC.ActivateWindow(VisualisationPresetList)</select>
<menu>XBMC.ActivateWindow(MusicOSD)</menu>
<start>XBMC.ActivateWindow(MusicOSD)</start>
<info>Info</info>
</remote>
</Visualisation>
<MusicOSD>
<remote>
<menu>Close</menu>
<title>Info</title>
<info>CodecInfo</info>
</remote>
</MusicOSD>
<VisualisationSettings>
<remote>
<menu>Close</menu>
<back>Close</back>
</remote>
</VisualisationSettings>
<VisualisationPresetList>
<remote>
<menu>Close</menu>
<back>Close</back>
</remote>
</VisualisationPresetList>
<SlideShow>
<remote>
<zero>ZoomNormal</zero>
<one>ZoomLevel1</one>
<two>ZoomLevel2</two>
<three>ZoomLevel3</three>
<four>ZoomLevel4</four>
<five>ZoomLevel5</five>
<six>ZoomLevel6</six>
<seven>ZoomLevel7</seven>
<eight>ZoomLevel8</eight>
<nine>ZoomLevel9</nine>
<info>CodecInfo</info>
<skipplus>NextPicture</skipplus>
<skipminus>PreviousPicture</skipminus>
<title>Info</title>
<select>Rotate</select>
<back>PreviousMenu</back>
</remote>
</SlideShow>
<ScreenCalibration>
<remote>
<select>NextCalibration</select>
<zero>ResetCalibration</zero>
<display>NextResolution</display>
<xbox>NextResolution</xbox>
</remote>
</ScreenCalibration>
<GUICalibration>
<remote>
<select>NextCalibration</select>
<zero>ResetCalibration</zero>
</remote>
</GUICalibration>
<SelectDialog>
<remote>
<back>Close</back>
</remote>
</SelectDialog>
<VideoOSD>
<remote>
<back>PreviousMenu</back>
<menu>Close</menu>
<start>Close</start>
</remote>
</VideoOSD>
<VideoMenu>
<remote>
<menu>OSD</menu>
<back>PreviousMenu</back>
<info>Info</info>
<title>CodecInfo</title>
<zero>Number0</zero>
<one>Number1</one>
<two>Number2</two>
<three>Number3</three>
<four>Number4</four>
<five>Number5</five>
<six>Number6</six>
<seven>Number7</seven>
<eight>Number8</eight>
<nine>Number9</nine>
<play>Select</play>
</remote>
</VideoMenu>
<OSDVideoSettings>
<remote>
<back>Close</back>
<menu>Close</menu>
<start>Close</start>
</remote>
</OSDVideoSettings>
<OSDAudioSettings>
<remote>
<back>Close</back>
<menu>Close</menu>
<start>Close</start>
</remote>
</OSDAudioSettings>
<VideoBookmarks>
<remote>
<back>Close</back>
<menu>Close</menu>
<start>Close</start>
<zero>Delete</zero>
</remote>
</VideoBookmarks>
<MyVideoLibrary>
<remote>
<zero>Queue</zero>
<clear>Delete</clear>
</remote>
</MyVideoLibrary>
<MyVideoFiles>
<remote>
<zero>Queue</zero>
<star>Queue</star>
</remote>
</MyVideoFiles>
<MyVideoPlaylist>
<remote>
<back>Playlist</back>
<!-- Close playlist -->
<clear>Delete</clear>
<zero>Delete</zero>
</remote>
</MyVideoPlaylist>
<VirtualKeyboard>
<remote>
<back>BackSpace</back>
<star>Shift</star>
<hash>Symbols</hash>
<zero>Number0</zero>
<one>Number1</one>
<two>Number2</two>
<three>Number3</three>
<four>Number4</four>
<five>Number5</five>
<six>Number6</six>
<seven>Number7</seven>
<eight>Number8</eight>
<nine>Number9</nine>
<enter>Enter</enter>
<pageminus>CursorLeft</pageminus>
<pageplus>CursorRight</pageplus>
</remote>
</VirtualKeyboard>
<ContextMenu>
<remote>
<title>Close</title>
<back>Close</back>
</remote>
</ContextMenu>
<FileStackingDialog>
<remote>
<back>Close</back>
</remote>
</FileStackingDialog>
<Scripts>
<remote>
<info>info</info>
</remote>
</Scripts>
<NumericInput>
<remote>
<zero>Number0</zero>
<one>Number1</one>
<two>Number2</two>
<three>Number3</three>
<four>Number4</four>
<five>Number5</five>
<six>Number6</six>
<seven>Number7</seven>
<eight>Number8</eight>
<nine>Number9</nine>
<enter>Enter</enter>
<back>BackSpace</back>
</remote>
</NumericInput>
<Weather>
<remote>
<back>PreviousMenu</back>
</remote>
</Weather>
<Settings>
<remote>
<back>PreviousMenu</back>
</remote>
</Settings>
<AddonBrowser>
<remote></remote>
</AddonBrowser>
<AddonInformation>
<remote>
<back>Close</back>
</remote>
</AddonInformation>
<AddonSettings>
<remote>
<back>Close</back>
</remote>
</AddonSettings>
<TextViewer>
<remote>
<back>Close</back>
</remote>
</TextViewer>
<MyPicturesSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</MyPicturesSettings>
<MyProgramsSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</MyProgramsSettings>
<MyWeatherSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</MyWeatherSettings>
<MyMusicSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</MyMusicSettings>
<SystemSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</SystemSettings>
<MyVideosSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</MyVideosSettings>
<NetworkSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</NetworkSettings>
<AppearanceSettings>
<remote>
<back>PreviousMenu</back>
</remote>
</AppearanceSettings>
<Profiles>
<remote>
<back>PreviousMenu</back>
</remote>
</Profiles>
<systeminfo>
<remote>
<back>PreviousMenu</back>
</remote>
</systeminfo>
<shutdownmenu>
<remote>
<back>PreviousMenu</back>
</remote>
</shutdownmenu>
<submenu>
<remote>
<back>PreviousMenu</back>
</remote>
</submenu>
<MusicInformation>
<remote>
<back>Close</back>
</remote>
</MusicInformation>
<MovieInformation>
<remote>
<info>Close</info>
<back>Close</back>
</remote>
</MovieInformation>
<LockSettings>
<remote>
<menu>Close</menu>
<back>PreviousMenu</back>
</remote>
</LockSettings>
<ProfileSettings>
<remote>
<menu>Close</menu>
<back>PreviousMenu</back>
</remote>
</ProfileSettings>
<PictureInfo>
<remote>
<skipplus>NextPicture</skipplus>
<skipminus>PreviousPicture</skipminus>
<info>Close</info>
<back>Close</back>
</remote>
</PictureInfo>
<Teletext>
<remote>
<zero>number0</zero>
<one>number1</one>
<two>number2</two>
<three>number3</three>
<four>number4</four>
<five>number5</five>
<six>number6</six>
<seven>number7</seven>
<eight>number8</eight>
<nine>number9</nine>
<red>Red</red>
<green>Green</green>
<yellow>Yellow</yellow>
<blue>Blue</blue>
<info>Info</info>
<back>Close</back>
<menu>Close</menu>
<start>Close</start>
<teletext>Close</teletext>
</remote>
</Teletext>
<Favourites>
<remote>
<back>Close</back>
</remote>
</Favourites>
</keymap>
Reply
#3
Lircmap.xml maps the lircd.cofig commands to XBMC commands
For example when pressing (on the remote) 'menu' button lirc receives it as 'DVD 0x00007bdb'
in Lircmap.xml I have <menu>DVD</menu>, that means when lirc detects DVD sent, send 'menu' command to XBMC.
in remote.xml this is matched with <menu>PreviousMenu</menu>, where menu is the command sent and 'PreviousMenu' is the xbmc action taken.

Note that I have not fine tuned all the commands so some might be missing or be wrong, but it is good enough for me.

If irw are giving correct results, you should now have a working setup to XBMC.
One thing left to do is;
under Settings => System => Input devices
"Remote control sends keyboard presses" set to FALSE
"Enable mouse" does not mather, can be nice as fallback sometimes
Reply

Logout Mark Read Team Forum Stats Members Help
MCE Remote, LIRC in Kernel(Gentoo) full guide0