Page 1 of 1

HOWTO: LMDE Windows Media Remote

Posted: Sun Jan 15, 2012 11:47 pm
by terroreek
Ok hopefully this will save someone some headaches and it took me a while to figure out. If some of you use a windows media centre remote with xbmc this is what you have to do to make it work. You may notice that once you plug in your tranceiver, and press the arrow keys on your remote that it is mapped as a keyboard.

First install lirc, open the terminal and enter the following;

Code: Select all

sudo apt-get install lirc
Once apt finishes installing the lirc package it will complain that there isn't a valid /etc/lirc/lircd.conf file, or something along those line. Ignore that for now and lets start configuring your remote. I tend to backup my config files before making changes, if you wish to ignore this step go ahead but its a force of habit for me.

Code: Select all

sudo cp /etc/lirc/hardware.conf /etc/lirc/hardware.conf.orig
sudo cp /etc/lirc/lircd.conf /etc/lirc/lircd.conf.orig
Now lets edit the hardware.conf file

Code: Select all

gksudo gedit /etc/lirc/hardware.conf
Replace the file with the following; just to note, your device maybe different than mine, but /dev/lirc0 is what is on my desktop. On my macbook the device location is /dev/usb/hiddev0. If you are not sure you can try it and see if lirc starts correctly.

Code: Select all

# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS=""

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

#Don't start irexec, even if a good config file seems to exist.
#START_IREXEC=false

#Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
# DRIVER="devinput"
DRIVER=""

DEVICE="/dev/lirc0"

# MODULES=""

MODULES="lirc_dev mceusb"

# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""
Save and close the file and jump back into terminal and edit the lircd.conf file

Code: Select all

gksudo gedit /etc/lirc/lircd.conf
and replace the contents of the file with the following.

Code: Select all

#
# 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 Mon Feb 23 23:55:04 2009
#
# contributed by 
#
# brand:                       Hauppauge
# model no. of remote control: 
# devices being controlled by this remote: PVR-150 Remote (MCE kit)
# SMK dongle 0609:031d
#

begin remote

  name  mceusb_hauppauge
  bits           13
  flags RC6|CONST_LENGTH
  eps            30
  aeps          100

  header       2674   870
  one           455   427
  zero          455   427
  pre_data_bits   24
  pre_data       0x1BFF82
  gap          106288
  min_repeat      1
  toggle_bit_mask 0x8000
  rc6_mask    0x100000000

      begin codes
          TV                       0x1BB9
          Music                    0x1BB8
          Pictures                 0x1BB6
          Videos                   0x1BB5
          Power                    0x1BF3
          Stop                     0x1BE6
          Record                   0x1BE8
          Pause                    0x1BE7
          Play                     0x1BE9
          Rewind                   0x1BEA
          Foward                   0x1BEB
          Replay                   0x1BE4
          Skip                     0x1BE5
          Back                     0x1BDC
          More                     0x1BF0
          Up                       0x1BE1
          Left                     0x1BDF
          Right                    0x1BDE
          OK                       0x1BDD
          Down                     0x1BE0
          VolUp                    0x1BEF
          VolDown                  0x1BEE
          Home                     0x1BF2
          ChanDown                 0x1BED
          ChanUp                   0x1BEC
          Mute                     0x1BF1
          RecTV                    0x1BB7
          Guide                    0x1BD9
          LiveTV                   0x1BDA
          DVD                      0x1BDB
          One                      0x1BFE
          Two                      0x1BFD
          Three                    0x1BFC
          Four                     0x1BFB
          Five                     0x1BFA
          Six                      0x1BF9
          Seven                    0x1BF8
          Eight                    0x1BF7
          Nine                     0x1BF6
          Star                     0x1BE2
          Zero                     0x1BFF
          Hash                     0x1BE3
          Clear                    0x1BF5
          Enter                    0x1BF4
      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 
#
# brand:  SIIG Vista MCE remote
# model no. of remote control: 
# devices being controlled by this remote:
#

begin remote

  name  vista_mce
  bits           16
  flags RC6
  eps            30
  aeps          100

  header       2654   889
  one           427   427
  zero          427   427
  pre_data_bits   21
  pre_data       0x37FF0
  gap          69850
  toggle_bit_mask 0x8000
  rc6_mask    0x100000000

      begin codes
          Power                    0xEBF3
          Pictures                 0x6BB6
          Radio                    0xEBAF
          Videos                   0x6BB5
          Music                    0xEBB8
          Rec                      0x6BE8
          Pause                    0xEBE7
          Stop                     0x6BE6
          Skipback                 0xEBE4
          Play                     0x6BE9
          Skipfwd                  0xEBE5
          Rwd                      0x6BEA
          Fwd                      0xEBEB
          Start                    0x6BF2
          Back                     0xEBDC
          More                     0x6BF0
          Volup                    0xEBEF
          Voldown                  0x6BEE
          Chup                     0xEBED
          Chdown                   0x6BEC
          Up                       0xEBE1
          Down                     0x6BE0
          Left                     0xEBDF
          Right                    0x6BDE
          Mute                     0xEBF1
          Rectv                    0x6BB7
          Guide                    0xEBD9
          Livetv                   0x6BDA
          Dvdmenu                  0xEBDB
          1                        0x6BFE
          2                        0xEBFD
          3                        0x6BFC
          4                        0xEBFB
          5                        0x6BFA
          6                        0xEBF9
          7                        0x6BF8
          8                        0xEBF7
          9                        0x6BF6
          *                        0xEBE2
          0                        0x6BFF
          #                        0xEBE3
          Clear                    0x6BF5
          Enter                    0xEBF4
      end codes

end remote
Save the file and exit. Now lets restart lirc, hopefully with a working remote.

Code: Select all

sudo /etc/init.d/lirc start
Note if someone how you tried this earlier and had a half working config, you may need to use restart instead of start. Now lets test the remote by opening irw and seeing what you get.

Code: Select all

irw
now press the left button and the right button on the remote you should get an output similar to this.

Code: Select all

000000037ff07bdf 00 Left mceusb
000000037ff07bdf 01 Left mceusb
000000037ff07bdf 02 Left mceusb
000000037ff07bde 00 Right mceusb
000000037ff07bde 01 Right mceusb
000000037ff07bde 02 Right mceusb
Ok great the remote is working. Now at this point when I fired up xbmc, I found when I pressed one of the direction keys on the remote it would register the button twice, this is because xorg thinks the remote is a keyboard. To stop that we need to tell xorg to ignore the device. You can press CTRL C to kill irw, and get back to work. Lets take a look in our xorg logs to find the remote tranceiver.

Code: Select all

sudo cat /var/log/Xorg.0.log | grep Media
I get this output;

Code: Select all

[    17.731] (II) config/udev: Adding input device Media Center Ed. eHome Infrared Remote Transceiver (147a:e03e) ([b]/dev/input/event7[/b])
Now I have bolded what we are looking for, you may have to not put the | grep Media and just sift through the log depending on your tranceiver, to find it. Again, I would recommend you back up your xorg.conf file before proceeding. If you break X, I am not taking responsibility, especially if you didn't backup the config. Anyways, backup your xorg config;

Code: Select all

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

Call the backup what ever you will but (fix the name in the following command) you can restore if X breaks on your machine with

Code: Select all

sudo mv /etc/X11/xorg.conf.bak /etc/X11/xorg.conf
from bash.

Ok so now lets edit your xorg.conf

Code: Select all

gksudo gedit /etc/X11/xorg.conf
and add this to the bottom of your xorg.conf

Code: Select all

Section "InputClass"
    Identifier           "Remote"
    MatchDevicePath      "/dev/input/event7"
    Option     		 "Ignore" "True"
EndSection
Now if for some reason your tranceiver keeps changing to a differnt event-id you could try using the MatchProduct "Media Center Ed. eHome Infrared Remote Transceiver" instead of the MatchDevicePath line. I did try that but it didn't work for me and the device is always event7 even after a reboot for me.

Save and close xorg. Now you can restart X or reboot. Once you restart X or have rebooted to test if X is ignoring the remote as a keyboard, in terminal type in xev, press the left and right buttons on the remote, if xev does nothing thats great if it's saying that its a left or right keyboard press thats bad and we need to figure out why xorg is not ignoring your remote.

Start up xbmc and you have a working media centre remote. Hopefully that helps, I figure most people using LMDE know how to figure things out, but I thought in case someone reading this isn't too well versed in terminal or config files it may help I would provide all steps.

Re: HOWTO: LMDE Windows Media Remote

Posted: Fri Feb 01, 2013 9:56 pm
by vigi
Thank you for information! It's really made me happy with my HP Pavilion dv5 and remote control. It is fully working now in XBMC.
I found when I pressed one of the direction keys on the remote it would register the button twice
I only exclude all direction keys from /etc/lirc/lircd.conf. May be this "workaround bolt", but it is working for me.