Make XBC/mceusb remote working with lirc 0.9.0 (solution)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
yrat Offline
Junior Member
Posts: 2
Joined: Jun 2011
Reputation: 0
Post: #1
I spend a day to make lirc 0.9.0 recent xbmc and kernel 2.6.39 working together.
Below is step-by-step guide for people who stuck on the same.

1. mceusb driver now is in the kernel - compile kernel with

CONFIG_LIRC=m
CONFIG_IR_MCEUSB=m

2. Compile lirc (gentoo) with USE "lirc_devices_userspace"

3. Make sure X doesn't add mceusb device as a keyboard,
add to xorg.conf

Section "InputClass"
Identifier "Remote"
MatchProduct "Media Center Ed. eHome Infrared Remote Transceiver"
Option "Ignore" "True"
EndSection

4. Change Lircmap.xml according to irw output - e.g. Play to KEY_PLAY

5. Enjoy (don't forget to restart XBMC)
find quote
bas.t Offline
Senior Member
Posts: 110
Joined: Dec 2010
Reputation: 0
Location: Baflo, The Netherlands
Post: #2
I have been trying to do this on Debian Wheezy (2.6.38 kernel). No luck so far. I ended up building a 2.6.35 kernel. That works. But it is not a good solution.
Did anyone succeed? If so, how?
(This post was last modified: 2011-06-02 17:30 by bas.t.)
find quote
caudata Offline
Junior Member
Posts: 2
Joined: Jun 2011
Reputation: 0
Post: #3
I don't know if this is the same problem but I had both lirc's mceusb driver and the kernel mceusb driver running at the same time causing conflicts. The route I took was to blacklist the kernel mceusb driver and use lirc with XBMC as usual. Hope that is somehow helpful.

Cheers,
caudata
find quote
bas.t Offline
Senior Member
Posts: 110
Joined: Dec 2010
Reputation: 0
Location: Baflo, The Netherlands
Post: #4
caudata Wrote:I don't know if this is the same problem but I had both lirc's mceusb driver and the kernel mceusb driver running at the same time causing conflicts. The route I took was to blacklist the kernel mceusb driver and use lirc with XBMC as usual. Hope that is somehow helpful.

Cheers,
caudata

I don't think I understand...
lirc 0.9 does not include mceusb module anymore since it is in the kernel now. So how did you manage to have two drivers?

Bas.
(This post was last modified: 2011-06-03 09:18 by bas.t.)
find quote
bas.t Offline
Senior Member
Posts: 110
Joined: Dec 2010
Reputation: 0
Location: Baflo, The Netherlands
Post: #5
Ok, I have arrived. Running Debian Wheezy or Squeeze with lirc 0.9.0 and a mceusb remote controll.

Just compile kernel 2.6.39.* with
# CONFIG_RC_MAP is not set

(works for 2.6.38 and probably any 2.6.36 and later too)

relevant part of multimedia section:
Code:
#
# Multimedia drivers
#
CONFIG_VIDEO_SAA7146=m
CONFIG_VIDEO_SAA7146_VV=m
CONFIG_RC_CORE=m
CONFIG_LIRC=m
[color=Navy]# CONFIG_RC_MAP is not set[/color]
CONFIG_IR_NEC_DECODER=m
CONFIG_IR_RC5_DECODER=m
CONFIG_IR_RC6_DECODER=m
CONFIG_IR_JVC_DECODER=m
CONFIG_IR_SONY_DECODER=m
CONFIG_IR_RC5_SZ_DECODER=m
CONFIG_IR_LIRC_CODEC=m
CONFIG_IR_ENE=m
CONFIG_IR_IMON=m
CONFIG_IR_MCEUSB=m
CONFIG_IR_ITE_CIR=m
CONFIG_IR_NUVOTON=m
CONFIG_IR_STREAMZAP=m
CONFIG_IR_WINBOND_CIR=m
# CONFIG_RC_LOOPBACK is not set

Reboot your machine so you are running your new kernel.

Now do:
Code:
mkdir /etc/lirc

Then make three files:

The two configfiles in /etc/lirc/ are:

hardware.conf
Code:
# /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=""
# usually /dev/lirc0 is the correct setting for systems using udev
# DEVICE="/dev/input/by-id/usb-Philips_eHome_Infrared_Transceiver_PH00FvKa-event-if00"

DEVICE="/dev/lirc0"

# MODULES=""

MODULES="lirc_dev mceusb"

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


and for lircd.conf the usual: http://lirc.sourceforge.net/remotes/mceu...onf.mceusb


Now also create in /etc/init.d/ the file

lirc

like this:

Code:
#! /bin/sh
### BEGIN INIT INFO
# Provides:          lirc
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Starts LIRC daemon.
# Description:       LIRC is used to control different
#                    infrared receivers and transceivers.
### END INIT INFO

load_modules ()
{
    MODULES_MISSING=false

    log_daemon_msg "Loading LIRC modules"
    for mod in $*; do
        if [ $mod = "udev" ]; then
            log_end_msg 0
            log_success_msg "Restarted via udev, don't reload modules"
            break
        else
            modprobe $mod 2> /dev/null || MODULES_MISSING=true
        fi
    done
    log_end_msg $?

    if $MODULES_MISSING; then
        log_failure_msg "Unable to load LIRC kernel modules. Verify your"
        log_failure_msg "selected kernel modules in /etc/lirc/hardware.conf"
        START_LIRCMD=false
        START_LIRCD=false
    fi
}

build_args ()
{
    ARGS="$*"

    ## Try to find an lirc device.
    if [ -z "$DEVICE" ]; then
        if [ -c $dev ]; then
            DEVICE="$dev"
            break
        fi
    fi

    if [ -n "$DEVICE" ] && [ "$DEVICE" != "none" ]; then
        ARGS="--device=$DEVICE $ARGS"
    fi

    if [ -n "$DRIVER" ] && [ "$DRIVER" != "none" ]; then
        ARGS="--driver=$DRIVER $ARGS"
    fi

    echo $ARGS
}

. /lib/lsb/init-functions

test -f /usr/sbin/lircd || exit 0
test -f /usr/sbin/lircmd || exit 0

START_LIRCMD=true
START_LIRCD=true
START_IREXEC=true


if [ -f /etc/lirc/hardware.conf ];then
    . /etc/lirc/hardware.conf
fi

if [ ! -f /etc/lirc/lircd.conf ] || grep -q "^#UNCONFIGURED" /etc/lirc/lircd.conf; then
    if [ "$1" = "start" ]; then
        log_success_msg "No valid /etc/lirc/lircd.conf has been found."
        log_success_msg "Remote control support has been disabled."
        log_success_msg "Reconfigure LIRC or manually replace /etc/lirc/lircd.conf to enable."
    fi

    START_LIRCD=false
    START_LIRCMD=false
    START_IREXEC=false
fi

if [ ! -f /etc/lirc/lircmd.conf ] || grep -q "^#UNCONFIGURED" /etc/lirc/lircmd.conf; then
    START_LIRCMD=false
fi

if [ ! -f /etc/lirc/lircrc ] || grep -q "^#UNCONFIGURED" /etc/lirc/lircrc; then
    START_IREXEC=false
fi

case "$1" in
    start)
        [ -d "/var/run/lirc" ] || mkdir -p "/var/run/lirc"
        if [ "$LOAD_MODULES" = "true" ] && [ "$START_LIRCD" = "true" ]; then
            load_modules $2 $MODULES
        fi

        if [ "$START_LIRCD" = "true" ]; then
            log_daemon_msg "Starting remote control daemon(s) : LIRC "
            LIRCD_ARGS=`build_args $LIRCD_ARGS`

            if [ ! -z "$LIRCD_ARGS" ]; then
                start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircd -- $LIRCD_ARGS < /dev/null
                # retain compatibility with old clients
                ln -fs ../var/run/lirc/lircd /dev/lircd
                log_end_msg $?
            else
                log_end_msg 1
            fi
        fi

        if [ "$START_LIRCMD" = "true" ]; then
            log_daemon_msg "Starting remote control mouse daemon : LIRCMD "
            start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircmd < /dev/null
            log_end_msg $?
        fi

        if [ "$START_IREXEC" = "true" ]; then
            log_daemon_msg "Starting execution daemon: irexec"
            start-stop-daemon --start --quiet --oknodo --exec /usr/bin/irexec -- -d /etc/lirc/lircrc < /dev/null
            log_end_msg $?
        fi
        ;;
    stop)
        if [ "$START_IREXEC" = "true" ]; then
            log_daemon_msg "Stopping execution daemon: irexec"
            start-stop-daemon --stop --quiet --exec /usr/bin/irexec
            log_end_msg $?
        fi

        if [ "$START_LIRCMD" = "true" ]; then
            log_daemon_msg "Stopping remote control mouse daemon: LIRCMD"
            start-stop-daemon --stop --quiet --exec /usr/sbin/lircmd
            log_end_msg $?
        fi

        if [ "$START_LIRCD" = "true" ]; then
            log_daemon_msg "Stopping remote control daemon(s): LIRC"
            start-stop-daemon --stop --quiet --exec /usr/sbin/lircd
            log_end_msg $?
        fi
        ;;
    reload|force-reload)
        if [ "$START_IREXEC" = "true" ]; then
            start-stop-daemon --stop --quiet --signal 1 --exec /usr/bin/irexec
        fi

        if [ "$START_LIRCD" = "true" ]; then
            start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/lircd
        fi

        if [ "$START_LIRCMD" = "true" ]; then
            start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/lircmd
        fi
        ;;
    restart)
        $0 stop
        sleep 1
        #passes parameter $2 which is possibly our udev paramater
        $0 start $2
        ;;
    *)
        echo "Usage: /etc/init.d/lircd {start|stop|reload|restart|force-reload}"
    exit 1
esac

exit 0

Next do:
Code:
chmod 755 /etc/init.d/lirc

update-rc.d lirc defaults 21 21

wget http://mesh.dl.sourceforge.net/project/lirc/LIRC/0.9.0/lirc-0.9.0.tar.bz2

tar xvf lirc*

cd lirc*

./configure --prefix=/usr --with-driver=userspace && make && make install && /etc/init.d/lirc restart && chmod 666 /var/run/lirc/lircd


Works flawless.

Cheers to all!

Bas.
(This post was last modified: 2011-06-04 14:34 by bas.t.)
find quote
apnn Offline
Junior Member
Posts: 10
Joined: Jun 2011
Reputation: 0
Post: #6
bas.t Wrote:Ok, I have arrived. Running Debian Wheezy or Squeeze with lirc 0.9.0 and a mceusb remote controll.

Just compile kernel 2.6.39.* with
# CONFIG_RC_MAP is not set ..................

Bas.


I am trying to make my built in IR port to work. This is in Jetway iontop machine, which uses Fintek cir. Very limited information is available in this regard, have been searching for months. Well, I was able to make it work a few months ago, but then I had to re-build the software and now I don't know how I did it! Your post seems to be of some promise. But, I have couple of questions.

First --- I am running Ubuntu Server minimal install with xbmc. I tried to look up available kernels, it did not list 2.6.39. It did list 2.6.38-13-generic and 2.6.38-13-server, before going on to version 3.x.x. So how do I get 2.6.39 and which version should I use 2.6.38-13-generic or 2.6.38-13-server?

Second --- How do I make the modification you suggest above (#CONFIG_RC_MAP is not set). At which point in compile process do I need to do it and where/how do I modify this?

Thank you for the help in advance.

-apnn
(This post was last modified: 2011-12-30 23:07 by apnn.)
find quote