XBMC will be renamed to Kodi for v14. Read here for more details

HOW-TO:Configure VRC-1100 remote for Ubuntu

From Kodi
Jump to: navigation, search

This page is all about getting the Hama MCE Remote 52451 to run with XBMC.

This remote is sold under several brand names or non-branded and is made by Ortek (check it out here).

NOTE: There is also an alternative tool available on trac for using the HAMA MCE remote with XBMC that works around the unusual protocol used by this remote.

Hama mce remote.jpg

As reference system I use a minimal Ubuntu 9.10 (Karmic).

Contents

1 UDev rule

First you have to create an own udev rule to ensure, that your device nodes are always the same.

We get the vendor id and the product id from /proc/bus/input/devices:

cat /proc/bus/input/devices

the output is something like this:

...

I: Bus=0003 Vendor=05a4 Product=9881 Version=0110
N: Name="HID 05a4:9881"
P: Phys=usb-0000:00:06.0-1/input0
S: Sysfs=/devices/pci0000:00/0000:00:06.0/usb4/4-1/4-1:1.0/input/input4
U: Uniq=
H: Handlers=kbd event4 
B: EV=120013
B: KEY=e080ffdf01cfffff fffffffffffffffe
B: MSC=10
B: LED=7

I: Bus=0003 Vendor=05a4 Product=9881 Version=0110
N: Name="HID 05a4:9881"
P: Phys=usb-0000:00:06.0-1/input1
S: Sysfs=/devices/pci0000:00/0000:00:06.0/usb4/4-1/4-1:1.1/input/input5
U: Uniq=
H: Handlers=kbd mouse1 event5 
B: EV=17
B: KEY=1f0000 2020000 3878d801d001 1e000000000000 0
B: REL=103
B: MSC=10

...

What we need are the numbers behind Vendor= and Product=. In my case 05a4 and 9881. We also need to know the minor and major numbers. In my example, I need to run these two commands.

udevadm info -q all -n /dev/input/event3
udevadm info -q all -n /dev/input/event4

At the bottom you will find the MINOR and MAJOR numbers, in my example these are: 13, 13 (majors) and 68, 69 (minors)

Now we write a new rules file for udev:

nano /etc/udev/rules.d/10-irremote.rules

and put the following content in:

SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ATTR{dev}=="13:68",SYMLINK="input/irremote0"
SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ATTR{dev}=="13:69",SYMLINK="input/irremote1"

Note the numbers for idVendor and idProduct are the numbers we got from /proc/bus/input/devices.

Alternatively, you can avoid relying on specific minor numbers with:

KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",IMPORT{program}="input_id %p"
KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ENV{ID_INPUT_KEYBOARD}=="1",SYMLINK="input/irremote0"
KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ENV{ID_INPUT_MOUSE}=="1",SYMLINK="input/irremote1"

Note that without the KERNEL match irremote1 is attached to a device sometimes which seems to be an inappropriate ioctl device (no event but only mouse).

Now restart udev and trigger a new discovery:

restart udev #notice for Gentoo: rc-service udev restart
udevadm trigger

(Restarting udev is optional at least as of Ubuntu lucid, and likely others.)

Under /dev/input should now be two more symlinks: irremote0 and irremote1:

ls /dev/input

2 Lirc installation

First you have to install lirc and inputlirc:

sudo apt-get install lirc inputlirc

You get some screens asking for IR remotes. Say none to every question here.

2.1 hardware.conf

This is the hardware.conf (located under /etc/lirc/hardware.conf)

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="None"
REMOTE_MODULES=""
REMOTE_DRIVER=""
REMOTE_DEVICE="phys="
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Enable lircd
START_LIRCD="false"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="false"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#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"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""

Note, that START_LIRCD is set to false, because we don't need the LIRC-Daemon.

2.2 lircd.conf

The file /etc/lirc/lircd.conf is empty.


2.3 /etc/default/inputlirc

EVENTS="/dev/input/irremote0 /dev/input/irremote1"
OPTIONS="-g -m 0 -c"

The entries unter EVENTS are the devices we created via udev. The OPTION entries mean the following:

-g Grabs the input from the devices, specified under EVENTS, so that no other application interferes with it.
-m 0 By default, all keycodes below 88 are filtered out. This setting ensures, that all keycodes are captured
-c Because some of the keys on the remote are mapped to keys with modifiers, this option maps this codes to single events.

In Gentoo, you have to modify the file /etc/conf.d/inputlircd instead. Make it look like this:

# Options to pass to the lircd process
INPUTLIRCD_OPTS="-g -m 0 -c /dev/input/irremote0 /dev/input/irremote1"

Now restart inputlirc

/etc/init.d/inputlirc restart

You can now test the device via 'irw':

irw

This are some sample output from irw:

14 0 CTRL_SHIFT_KEY_T irremote0
a4 0 KEY_PLAYPAUSE irremote1
a4 0 KEY_PLAYPAUSE irremote1
a6 0 KEY_STOPCD irremote1
110 0 BTN_LEFT irremote1
110 0 BTN_MOUSE /dev/input/irremote1
111 0 BTN_RIGHT /dev/input/irremote1
6c 0 KEY_DOWN /dev/input/irremote0
6c 0 KEY_DOWN /dev/input/irremote0
67 0 KEY_UP /dev/input/irremote0

due to a move of /dev/lircd to /var/run/lirc/lircd in the LIRC project the default device of irw is now the one under /var... Either insert a sym link or let the inputlircd generate the lircd Unix Domain Socket at the new location with adding the '-d /var/run/lirc/lircd' to the inputlirc options - this is just needed for the test with irw!

3 Configuration XBMC

3.1 Lircmap.xml

Important: The remote device attribute content is the mapping between the recognized input device and the remote commands defined in this file:

 <remote device="NameAsShownIn.irw.Output">
  ...
 <remote device="irremote1">
  ...
 <remote device="/dev/input/irremote1">

This is my Lircmap.xml:

  <lircmap>
      <remote device="irremote1">
          <start>KEY_HOMEPAGE</start>
          <power>KEY_SLEEP</power>
          <skipplus>KEY_NEXTSONG</skipplus>
          <skipminus>KEY_PREVIOUSSONG</skipminus>
          <pause>KEY_PLAYPAUSE</pause>
          <stop>KEY_STOPCD</stop>
          <info>BTN_RIGHT</info>
          <title>BTN_LEFT</title>
          <volumeplus>KEY_VOLUMEUP</volumeplus>
          <volumeminus>KEY_VOLUMEDOWN</volumeminus>
          <mute>KEY_MIN_INTERESTING</mute>
      </remote>
      <remote device="irremote0">
          <myTV>CTRL_SHIFT_KEY_T</myTV>
          <mymusic>CTRL_KEY_M</mymusic>
          <mypictures>CTRL_KEY_I</mypictures>
          <myvideo>CTRL_KEY_E</myvideo>
          <reverse>CTRL_SHIFT_KEY_B</reverse>
          <forward>CTRL_SHIFT_KEY_F</forward>
          <menu>CTRL_SHIFT_KEY_M</menu>
          <record>CTRL_KEY_R</record>
          <back>KEY_BACKSPACE</back>
          <left>KEY_LEFT</left>
          <right>KEY_RIGHT</right>
          <up>KEY_UP</up>
          <down>KEY_DOWN</down>
          <select>KEY_ENTER</select>
          <pageplus>KEY_PAGEUP</pageplus>
          <pageminus>KEY_PAGEDOWN</pageminus>
          <one>KEY_KP1</one>
          <two>KEY_KP2</two>
          <three>KEY_KP3</three>
          <four>KEY_KP4</four>
          <five>KEY_KP5</five>
          <six>KEY_KP6</six>
          <seven>KEY_KP7</seven>
          <eight>KEY_KP8</eight>
          <nine>KEY_KP9</nine>
          <zero>KEY_KP0</zero>
          <display>KEY_KPASTERISK</display>
          <clear>KEY_ESC</clear>
          <eject>ALT_META_KEY_ENTER</eject>
      </remote>
</lircmap>

Note: With some controls, a BTN_LEFT event isn't sent by the control for the left mouse button - instead, it sends BTN_MOUSE. Try changing it in the above configuration if you find that you can't access the context menu.

Note 2: If you find that you suffer this problem where pausing and unpausing video seems to cause a problem with buffering, you may want to employ the workaround that's suggested and make use of the "play" button rather than the "pause" button - so change:

<pause>KEY_PLAYPAUSE</pause>

to

<play>KEY_PLAYPAUSE</play>

There's no difference between the play and pause buttons on the remote - they both send the same event, so you just have to decide whether you want it to send "play" or "pause".

3.2 keymaps/remote.xml

<keymap>
  <global>
    <remote>
      <eject>XBMC.EjectTray()</eject>
      <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.Quit</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>
      <menu>XBMC.Skin.ToggleSetting(HomeViewToggle)</menu>
      <info>XBMC.ActivateWindow(SystemInfo)</info>
     <clear>XBMC.ActivateWindow(Weather)</clear>
      <hash>XBMC.ActivateWindow(Settings)</hash>
    </remote>
  </Home>
  <MyFiles>
    <remote>
      <clear>Delete</clear>
    </remote>
  </MyFiles>
  <MyMusicPlaylist>
    <remote>
      <back>Playlist</back>
      <clear>Delete</clear>
    </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>
      <title>CodecInfo</title>
      <info>Info</info>
      <enter>AspectRatio</enter>
      <select>AspectRatio</select>
      <teletext>XBMC.ActivateWindow(Teletext)</teletext>
      <subtitle>ShowSubtitles</subtitle>
      <language>AudioNextLanguage</language>
    </remote>
  </FullscreenVideo>
  <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>
    </remote>
  </VisualisationSettings>
  <VisualisationPresetList>
    <remote>
      <menu>Close</menu>
    </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>
      <enter>NextCalibration</enter>
      <zero>ResetCalibration</zero>
      <display>NextResolution</display>
      <xbox>NextResolution</xbox>
    </remote>
  </ScreenCalibration>
  <GUICalibration>
    <remote>
      <select>NextCalibration</select>
      <enter>NextCalibration</enter>
      <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>
      <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>XBMC.ActivateWindow(ScriptsDebugInfo)</info>
    </remote>
  </Scripts>
  <ScriptsDebugInfo>
    <remote>
      <info>Info</info>      <!-- clears debug python info -->
    </remote>
  </ScriptsDebugInfo>
  <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>
      <back>BackSpace</back>
    </remote>
  </NumericInput>
  <Weather>
    <remote>
      <back>PreviousMenu</back>
    </remote>
  </Weather>
  <Settings>
    <remote>
      <back>PreviousMenu</back>
    </remote>
  </Settings>
  <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>
      <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>

After a restart, the Remote should now work fluently with XMBC.

At the moment, 14th of September,there is a glitch with xbmc source code. Checkout this ticket for more info [1]

Personal tools
Namespaces

Variants
Actions
Navigation
Wiki help
Toolbox