Archive:HOW-TO:Configure VRC-1100 remote for Ubuntu

From Official Kodi Wiki
Revision as of 11:57, 29 August 2010 by >Andreas67
Jump to navigation Jump to search

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

Hama mce remote.jpg

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

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.

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.

Now restart udev and trigger a new discovery:

restart udev
udevadm trigger

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

ls /dev/input

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.

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.

lircd.conf

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


/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.

Now restart inputlirc

/etc/init.d/inputlirc restart

You can now test the device via 'irw':

irw

This is 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

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!

Configuration XBMC

Lircmap.xml

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>


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.