MCE Remote

From MythTV Official Wiki
Revision as of 23:33, 20 May 2007 by Kormoc (talk | contribs) (Support Status)

Jump to: navigation, search

Media Center Remotes

MCEremote.jpg Media Centre Remote 2 Media Centre Remote 2 ALT MCE Remote Hauppauge version
Version
1
2
2
2
Model
1039
1039
Hauppauge PVR- kit
Features
Backlight
Backlight
Backlight

Description

USB Remote intended for Media Center PCs

Vendors Website: http://www.microsoft.com/hardware/mouseandkeyboard/productdetails.aspx?pid=065

There are two main versions of the MCE remote, typically referred to as the 'older' (Version 1) and 'newer' (Version 2) models. Both of these are now supported in the latest lirc, currently 0.8.1.

The newer remote comes in various alternatives, including different shapes and features. The new model is manufactured by Philips and half a dozen other manufacturers and is available by (among many other ways) purchase on it's own, shipped with MCE 2005 and contained in Hauppauge TV card MCE-Kits.


Support Status

 New Version (V2):
   IR Receiver is supported 
   IR Transmitter is supported with driver module lirc_mceusb2 version >0.23 (lirc-0.8.1).
 Old Version (V1):
   IR Receiver is supported
   IR Transmitter is not supported
 Phillips eHome:
   These are now supported in latest lirc. For those that must run a pre 0.8 version,
   follow the INSTALL guide at http://www.blatter.com/mceusb/old/INSTALL. Be sure that
   the source you are compiling against is the recomended 0.7.0 branch. Note that this
   patch is no longer updated or supported since it is now part of the lirc distribution.
   The IR Transmitter is NOT supported by this project.

NOTE: How do you determine the version of lirc_mceusb2? Modinfo doesn't make it obvious...

[me@mythbackend ~]# modinfo lirc_mceusb2

filename: /lib/modules/2.6.15-1.1831_FC4/updates/drivers/lirc/lirc_mceusb2.ko

description: USB remote driver for LIRC

author: Martin Blatter <martin_a_blatter@yahoo.com>

license: GPL

parmtype: debug:bool

parm: debug:Debug enabled or not

vermagic: 2.6.15-1.1831_FC4 686 REGPARM 4KSTACKS gcc-4.0

depends:

alias: usb:v0471p0815d*dc*dsc*dp*ic*isc*ip*

alias: usb:v0609p031Dd*dc*dsc*dp*ic*isc*ip*

alias: usb:v1460p9150d*dc*dsc*dp*ic*isc*ip*

srcversion: 0DB345057C284AB48653F05

In my situation I used Mythdora for initial install and config. When I used yum to upgrade lirc to 0.8.1 it didn't 'take' fully since Dennis hand rolled some of his lirc stuff into Mythdora specific directories. I've got the new lircd loading properly now, but I'm not confident that the new mce module has loaded. Thus the desire to see the module version to check if it's really >0.23

This box can be considered graffiti and can be replaced with more details on the version or a link to somewhere useful...

Installation guides

Older remote

I would think it's the same as the newer remote instructions below, but I can't verify. Only difference is the module name - it will be lirc_mceusb instead of lirc_mceusb2.

Newer remote

You must be using a 2.6 kernel for the newer remote. The kernel module that lirc creates does not have 2.4 support.

Be sure your kernel has support for USB. Most default kernels will. You will only need the USB 1.1 driver (OHCI or UHCI) and USB 2.0 (EHCI) is not required. There is no kernel module specific for this device. Before continuing, be sure your device is recognized by your USB host controller:

# lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 0471:0815 Philips
Bus 001 Device 001: ID 0000:0000

Download a lirc CVS SnapShot

Generally the latest cvn snapshot from the official LIRC website should work fine. As of writing, the latest snapshot available is lirc-0.8.2pre2. Download and extract it either manually from the previous link or using the following code.

cd /usr/src
wget http://lirc.sourceforge.net/software/snapshots/lirc-0.8.2pre2.tar.bz2
bunzip lirc-0.8.2pre2.tar.bz2
tar -xvf lirc-0.8.2pre2.tar
cd lirc-0.8.2pre2

Users of newer linux kernels such as 2.6.20 may find they have problems when compiling / making the source code from the svn snapshot (notably lirc_mceusb2 with 0.8.1pre5 and kernel 2.6.20 does not work, at least for me...). If you have problems with the following install, or just want to run the latest and greatest lirc version, download the latest cvs lirc code using the following method:

Downloading using CVS

1. Make sure you have the cvs, autoconf, automake and libtool packages installed (rpm package manager users search for them and install their rpms).

2. Type the following on a command line and ignore what it says about not finding /root/...:

cvs -d:pserver:anonymous@lirc.cvs.sourceforge.net:/cvsroot/lirc login

3. Type the following:

cvs -z8 -d:pserver:anonymous@lirc.cvs.sourceforge.net:/cvsroot/lirc co lirc

4. Type the following:

cd lirc
./autogen.sh

5. Continue with the following Install section, starting with "./setup.sh".

Install

You now have two choices, you can either run the Lirc Setup script and accept it installing itself where it wants to, or you can carry out a manual configure. Using the setup script is easier, but it means that the various binararies and configuration files aren't placed in the normal Gentoo locations.

To use the automated setup process:

./setup.sh
Menu Option # (1) - Driver Configuration (enter)
Menu Option # (8) - USB Devices (enter)
Menu Option # (o) - Windows Media Center Remotes (new version, Philips et al.) (enter)
Menu Option # (3) - Save your configuration and run configure (enter)
make
make install


Important.png Note: If bash returns 'dialog not found' when running ./setup.sh, install the dialog package

This will also create a /etc/lircd.conf file which should work. If it complains about missing fedora source files use "yum install kernel-devel" and rerun ./setup.sh.

To perform the manual configuration:

./configure --prefix=/usr --sysconfdir=/etc/conf.d --with-x --with-driver=all
make
make install
cp remotes/mceusb/lircd.conf.mceusb /etc/conf.d/lircd.conf

If you get errors during the compile, try to change the .configure step to be


./configure --prefix=/usr --sysconfdir=/etc/conf.d --with-x --with-driver=mceusb2

instead of -with-driver=all. You should change mceusb2 to mceusb if you are using the old version of the remote.

If you get an error message that the "kernel source is required", it actually means the kernel headers. On my system this Ubuntu package was linux-kernel-headers-2.9.12-9-386 to match the version returned by the uname -a command. Installing the right version of the headers to match your kernel version is esssential. You may also need to install the gcc compiler.

Load the module

# modprobe lirc_mceusb2

Start lircd

# lircd

Test it with irw. irw will output the commands received by the IR receiver that match your lircd.conf file. So start irw, point your remote and start pressing buttons.

# irw
000000037ff07bfe 00 One mceusb
000000037ff07bfd 00 Two mceusb
000000037ff07bfd 01 Two mceusb
000000037ff07bf2 00 Home mceusb
000000037ff07bf2 01 Home mceusb

If everything works, then autoload lirc_mceusb2 when your computer loads (how to depends on your distro) and start lircd as well (also depends on your distro).

One note, I'm running a late-model Gentoo and I have to load lircd with this option:

# lircd -d /dev/lirc/0

Otherwise it fails, as it defaults to /dev/lircd.

You will also need to install an lircrc file (note no dot at the front of the filename in the ~/.mythtv directory so that when the frontend starts up it can see the mythtv configuration settings for your remote control buttons.

Linux Distribution Specific Instructions

Suse

Note: On Suse 10.1 you don't need to install lirc as above, just install the lirc and lirc-kmp-<your kernel type> rpms (to find kernel type, type "rpm -qf /boot/vmlinuz" at a command prompt). You still need to do the following though.

On Suse you can start the lirc daemon at boot by using the run level editor (yast > system > system services) and enabling lirc. After this you need to edit /etc/sysconfig/lirc to load the lirc_mceusb2 module at boot. Look for the following lines and make any additions as needed (ie. they should look like this when you're finished):

LIRCD_DRIVER=""

LIRCD_DEVICE="/dev/lirc"

LIRC_MODULE="lirc_mceusb2"

You can leave the rest as it is.

Ubuntu 6.10 Edgy

Alternate Ubuntu install instructions can be found here: Ubuntu_lirc_install

Ubuntu ships with basic lirc support but does not make it easy to install the kernel modules. These need to be installed as source and compiled. The compilation however, requires the full kernel sources and can have problems with version number conflicts. The easiest way to get this remote working on Ubuntu is to download the latest source from [1] and compile the lirc_mceusb or lirc_mceusb2 module as appropriate, following the instructions above. Then run

#sudo apt-get install lirc

Which will install the main lirc daemon and configure it to start on boot. The last step is to edit the /etc/lircd/hardware.conf file, setting the MODULE to either lirc_mceusb or lirc_mceusb2 as appropriate and the DEVICE section to /dev/lirc0 Lirc can then be restarted using

#sudo /etc/init.d/lirc restart

Debian GNU/Linux 4.0

You need to install the lirc packages using apt:

# apt-get install lirc lirc-modules-source

The package lirc-modules-source allows you to build the required modules. However, just building the modules will leave you _without_ the modules lirc-mceusb andlirc-mceusb2, so you have to reconfigure the package:

# dpkg-reconfigure lirc-modules-source

This will present a screen where you can select the desired modules. You need at least lirc-dev and either lirc-mceusb or lirc-mceusb2 to get things working. If unsure, select both lirc-mceusb and lirc-mceusb2. Now you can build the modules for lirc (using the command `make-kpkg modules-image` with some additional options, depending on the kernel in use), and afterwards install the generated package from /usr/src, on my system this was:

# dpkg -i lirc-modules-2.6.17.13_0.8.0-9+MediaCenter+1.2_i386.deb

After this step, You have all the components needed on your system.

To auto-load the modules on system boot, just add them to your /etc/modules file.

Gentoo (2.6.10)

For my Gentoo (2.6.10) installation I had to do a few extra things. Before following any install documentation, remove all lirc_mceusb.ko and lirc_dev.ko modules. Mine were in /lib/modules/2.6.10/misc/ . I also had to remove /lib/dev-state/lirc* because devfs was apparently trying to restore some older (non working) lirc states.

Now follow the instructions in the INSTALL to verify proper installation (it may be helpful to load the module with "modprobe -v lirc_mceusb" to ensure you are loading the proper modules from the proper places).

I will add more to this as I understand it better, but for right now I finally have this working. Any help on Wiki Formatting would also be appreciated.

KnoppMyth

R5B7

With a clean install from R5B7 I had to edit one file to get my remote working:
/etc/init.d/lirc

Orig:

Changed to:
start-stop-daemon --start --quiet --exec /usr/sbin/lircd \

Stole this from the forums - figured it should be in the wiki:
http://mysettopbox.tv/phpBB2/viewtopic.php?t=5620

R5E50

From a clean install of R5E50 I had to do the exact opposite. /etc/init.d/lirc

Orig:
start-stop-daemon --start --quiet --exec /usr/sbin/lircd \
Changed to:
start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- $LIRCD_ARGS \

Credit goes to the same thread posted above and:
http://mysettopbox.tv/phpBB2/viewtopic.php?t=13137


Configuring the Buttons

Programmable Buttons

Some MCE Remote Controls are able to learn codes from other remote controls. This was designed to allow you to turn on and off your television and control the TV volume. Only the following MCE buttons are able to be programmed:

  • TV Power
  • Volume +
  • Volume -

To program these buttons, do the following steps for each button:

  1. Hold the "DVD MENU" and "OK" buttons at the same time for 2 seconds until the backlight turns off.
  2. Press the MCE button that you want to program. The backlight will blink once to confirm.
  3. Point the original TV remote control at the top of the MCE remote and press the button that you want teach. The MCE remote backlight will blink twice to confirm. If the learning phase fails the MCE remote will blink 4 times (error).

Example lircrc config file

There is a example lircrc config file for myth in svn. See http://svn.mythtv.org/trac/browser/trunk/mythtv/contrib/configfiles/lircrc.native.example.mceusb2

There is also a semi-regularly updated MCE remote lircrc (and coresponding lircd) file at http://www.hauppauge.co.uk/board/showthread.php?t=8048


To use this, just copy it to ~/.mythtv/lircrc


To get MPlayer (myth-video) to work with the remote, you have to set up the key bindings and create a symlink for MPlayer to the file.

Add the following to ~/.mythtv/lircrc:

begin
 prog = mplayer
 button = Back
 config = quit
end

begin
 prog = mplayer
 button = More
 config = osd
end

begin
 prog = mplayer
 button = Replay
 config = seek -10
 repeat = 1
end

begin
 prog = mplayer
 button = Skip
 config = seek +10
 repeat = 1
end

begin
 prog = mplayer
 button = Rewind
 config = seek -60
 repeat = 1
end

begin
 prog = mplayer
 button = Forward
 config = seek +60
 repeat = 1
end

begin
 prog = mplayer
 button = Pause
 config = pause
end

begin
 prog=mplayer
 button=Mute
 config=mute
end

MPlayer expects to find the configuration file in a different location to MythTV. Create a symlink so that MPlayer can find the file:

ln -s ~/.mythtv/lircrc ~/.lircrc

Example lircd config file

There is a working MCE remote lircd (and coresponding lircrc) file at http://www.hauppauge.co.uk/board/showthread.php?t=8048

Suggested changes to Button Functions

This section has been moved to Customized Remote Control Keys, as the suggestions apply to all remote controls, not just MCE remotes.

Troubleshooting

Remote fails to send data

The MCE firmware can sometimes get into an inconsistent state and needs to be reset.

In some models, there might be a large capacitor in the unit because you have to remove the batteries for 1/2 hour or more to discharge it , or try pressing lots of buttons to discharge it quicker. This should reset the firmware.

Transmitter LEDs flash with irsend but IR reciever device does not pick up anything.

The small (1/4in) Microsoft MCE transmitter LEDs have a very short range (<2cm). If you cannot get it close enough, it probably will not work. I replaced the original MS MCE transmitter LEDs with the PVR500's (slightly bigger 1/2in length) transmitter LEDs and I was able to control the IR receiver device. They are both equivalent devices and uses lirc_mceusb2.

Sluggish / Stuttery Remote

  • The below solution is no longer necessary since it has been fixed in lirc 0.8.1.

Those using the mceusb2 module (for the newer MCE remote) may want to implement Maciek Klimkowski's patch to make the remote feel a little more responsive and detect repeat keys properly. The patch edits the lirc_mceusb2.c file in the downloaded lirc code (/lirc-0.8.0/drivers/lirc_mceusb2/lirc_mceusb2.c) to remove lines 354 to 357 and insert send_packet_to_lirc(ir); just after the resulting line 380.

To install the patch, change directories to the directory that lirc unzipped to. For example, /usr/src/lirc-0.8.0, download the patch to this directory, then


patch -b -l -p1 <lirc-0.8.0.pre4-mceusb2_key_stutter_fix.patch

You can then go ahead and configure / make / install lirc as normal.

MCE Keyboard

There are some patches available which aim to get the MCE keyboard to work with Linux and lircd. They are hosted at http://mod-mce.sourceforge.net/. The gentleman as added patches to allow the ir blaster to work with lirc_mod_mce as of 0.1.3.