Lirc works, but XBMC does not respond to Infrared input
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Lirc works, but XBMC does not respond to Infrared input
Hi, I have a strange situation with Lirc and XBMC:
Lirc is set up to work with my homemade IR receiver, plugged into /dev/ttyS0 on my media PC. (Ubuntu 10.04 with XBMC Eden)
Running irw gives the desired results: The correct button names (e.g. key_up) are displayed on stdout as I press them on the remote. XBMC starts as a service, xbmc-live, on boot. It does not respond to IR button presses at all. My configuration is as follows:
In /etc/lirc:
hardware.conf:
Code:
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Custom"
REMOTE_MODULES="lirc_dev lirc_serial"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS=""
#Chosen IR Transmitter
TRANSMITTER="Serial Port (UART) : Direct TV Receiver"
TRANSMITTER_MODULES="lirc_dev lirc_serial"
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE="/dev/lirc0"
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF="directtv/general.conf"
TRANSMITTER_LIRCD_ARGS=""
START_LIRCD="true"
LOAD_MODULES="true"
LIRCMD_CONF=""
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
xbmc.log is attached, because it is too big for the post... xbmc.log
The sad thing is: All of the "DEBUG: LIRC: Update - NEW at" entries are keyboard presses on the tty2 console. I tested this by rebooting (for a clean log) and just going to tty2 (you'll see CTRL+ALT registered in the log file, but not F2), pressing up, down, left and right (on my actual keyboard) a few times, and checking the log. It seems that keyboard presses such as up, down, left, right, home, delete, etc. are registered as LIRC events, but not the Alphanumerical keys or ENTER.
However, none of my IR button presses show up in the log.
It is weird, keyboard presses presented as LIRC events. Can you disable transmitter in hardware .conf, restart lircd and then test? Check also lirc logs
Disabling the "transmitter" in hardware.conf fixed the weird Keyboard-presses-as-Lirc-commands problem!
Pressing buttons in XBMC still did nothing, and caused no events in the log.
I had an idea and did:
Code:
# service xbmc-live stop
# service lirc stop
# service lirc start
# service xbmc-live start
And my remote control worked in XBMC!! So it seems that Lirc should start before XBMC. Problem is, XBMC is an UpStart script, while Lirc is using sysvinit. I am very new to UpStart, and still find it confusing. I think I should convert Lirc to an UpStart service, and let XBMC depend on it. But I really don't know how!!
/etc/init/xbmc-live.conf:
Code:
# xbmc-live
#
# init XBMC environment
#
description "XBMCLive"
author "Luigi Capriotti"
start on (filesystem and stopped udevtrigger)
stop on runlevel [06]
script
get_opt() {
echo "$@" | cut -d "=" -f 2
}
CMDLINE=$(cat /proc/cmdline)
#Process command line options
XBMC_PARAMS=""
for i in ${CMDLINE}; do
case "${i}" in
xbmc\=*)
XBMC_PARAMS=$(get_opt $i)
;;
esac
done
echo $XBMC_PARAMS > /tmp/xbmcliveParams
if grep "boot=live" /proc/cmdline ; then
# Relies on init scripts to mount boot device on a specified directory
BOOTMEDIAMOUNTPOINT="/live/image"
fi
BOOTHOOKSDIRECTORY="/etc/xbmc"
xbmcUser=xbmc
# Read configuration variable file if it is present
[ -r /etc/default/xbmc-live ] && . /etc/default/xbmc-live
if ! getent passwd $xbmcUser >/dev/null; then
xbmcUser=$(getent passwd 1000 | sed -e 's/\:.*//')
fi
# Executes pre-hooks (if any) in the System "Hooks" directory
if [ -d $BOOTHOOKSDIRECTORY/live.d ]; then
for hook in $(find $BOOTHOOKSDIRECTORY/live.d -type f -perm /u=x,g=x,o=x | sort)
do
$hook $BOOTMEDIAMOUNTPOINT $XBMC_PARAMS || true
done
fi
# Executes pre-hooks (if any) in the user "Hooks" directory
if [ -d /home/$xbmcUser/.xbmc/live.d ]; then
for hook in $(find /home/$xbmcUser/.xbmc/live.d -type f -perm /u=x,g=x,o=x | sort)
do
$hook $BOOTMEDIAMOUNTPOINT $XBMC_PARAMS || true
done
fi
runXBMC
end script
/usr/bin/runXBMC just launches XBMC in standalone mode.
sysvinit scripts are normal executable files, so you can invoke it (with appropriate flags start and stop) in your "/etc/init/xbmc-live.conf" before running "xbmc" and remove links to lirc startup script in "/etc/rc*.d" directories.
Or you can add to xbmc upstart script to "start on" your custom event (for example "lirc") and emit it by "initctl emit lirc" in lirc script, after starting "lircd".
I had set in my xbmc.conf "start on stopped rc RUNLEVEL=[2345]". So it should start after all rc* scripts.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.