Launch XBMC with remote
#1
I have an Asrock ION330-HT with the latest XBMC version. Everything is working fine, including the remote in XBMC.

Now, I'd like to be able to launch XBMC with the remote when Ubuntu is running. I've read quite some stuff about it, but for some reason is does not work.

According to http://www.lirc.org/html/configure.html#...onf_format and other sources the format should be:

Code:
begin
    remote = mceusb
    button = Home
    prog = irexec
    repeat = 0
    config = /usr/bin/xbmc
end

I've added that to /etc/lirc/lircrc and restarted the lirc daemon. Lirc is running OK, and when I run irw to see what is happening when I press the Home button, I get pretty much what I expected:

Code:
bever@htpc:~$ irw
000000037ff07bf2 00 Home mceusb
000000037ff07bf2 01 Home mceusb

But for some reason xbmc is not launched.

irexec is also running, with the config file I edited as input:

Code:
bever@htpc:~$ ps -ef | grep irexec
root      6260     1  0 17:35 ?        00:00:00 /usr/bin/irexec -d /etc/lirc/lircrc

Does anyone have an idea as to why the command is not executed and xbmc is not launched?
Reply
#2
Use a script to start xbmc and test the script first.
I also seem to remember that after script name you should put a &.
I can probably find my old scripts later tonight.
Reply
#3
Take a look at this, it is old stuff but maybe you can get something out of it.
http://vikjonlinuxhowto.blogspot.com/200...-xbmc.html

startXBMC.sh
----------------------
Code:
#!/bin/bash

# Test to see if XBMC is running first
if ps -ef|grep -v grep|grep -i xbmc.bin
then
# Do nothing
echo "XBMC already Running!"
else
# Startup XBMC
xbmc
fi
exit


killXBMC.sh
----------------
Code:
#!/bin/bash

# Test to see if XBMC is running first
if ps -ef|grep -v grep|grep -i xbmc.bin
then
# Try a clean kill
ps aux|grep -i xbmc|grep -v grep|grep -i xbmc.bin|awk '{print $2}'|xargs kill
echo `date` "Killed XBMC! (soft)" >> /tmp/killXBMC.log
else
echo "XBMC already dead! (soft)"
exit
fi

# takes a second or two to die with the soft kill
sleep 2

# Test to see if it's still running
if ps -ef|grep -v grep|grep -i xbmc.bin
then
# If it's still around, kill it -9
ps aux|grep -i xbmc|grep -v grep|grep -i xbmc.bin|awk '{print $2}'|xargs kill -9
echo `date` "Killed XBMC! (hard)" >> /tmp/killXBMC.log
else
echo "XBMC already dead! (hard)"
exit
fi
startIRexec.sh
---------------------
Code:
#!/bin/bash

# Test to see if IRXevent is running first, if so kill it, then restart
if ps -ef|grep -v grep|grep -i irxevent
then
ps aux|grep -i xbmc|grep -i irxevent |awk '{print $2}'|xargs kill
else
# Do nothing
echo "irxevent already dead!"
fi

# Test to see if IRexec is running first, if so kill it, then restart
if ps -ef|grep -v grep|grep -vi start|grep -i irexec
then
ps aux|grep -i xbmc|grep -i irexec |grep -vi start|awk '{print $2}'|xargs kill
else
# Do nothing
echo "irexec already dead!"
fi

#test to see if an instance of irxevent is already running
if ps -ef|grep -v grep|grep irxevent
then
# do nothing
echo "irxevent already running"
else
# start irxevent
/usr/bin/irxevent ~/.lircrc &
fi

#test to see if an instance of irexec is already running
if ps -ef|grep -v grep|grep irexec
then
# do nothing
echo "irexec already running"
else
# start irexec
/usr/bin/irexec -d ~/.lircrc &
fi

exit
Reply
#4
Hey man, using a bash script did the trick! I don't quite understand why it needs to be a script, but hey, it works Wink
Reply
#5
The problem now is that xbmc is started as the user that irexec is running as. And that's root. It should be me (bever). I tried changing the startup script, to no avail:

Code:
#!/bin/bash
PROCESS=`ps -ef | grep xbmc.bin | grep -v grep`
if [ "$PROCESS" = "" ]
then
        rm -f /home/bever/core*
        su -c "/usr/bin/xbmc &" -l bever
else
        killall -v -s9 xbmc.bin
fi
Reply
#6
Quote:The problem now is that xbmc is started as the user that irexec is running as. And that's root. It should be me (bever). I tried changing the startup script, to no avail:
I am not a linux expert. I only know that there were something strange with irexec and users in 8.10. To remove sudo password for shutdown I had to remove it for all users. (I guess if it was run as root I could just have removed sudo...but this was kind of in my first week of linux)

I started irexec as an gnome autostarted application, do you do the same? Perhaps it can be started later? Or...have to tried to apply your su -c magic to the irexecstart script instead?
Reply
#7
did you try?
gksu -u you xbmc

su - seem to have a have a problem with display.
I cant test myself, I dont want to install gksu since I dont know exactly what in gnome that creates problem for xbmcLive.
Reply
#8
I'm puzzled... Irexec is still running as root, but now for some reason xbmc is launched as the correct user... I'm not complaining, I'd just like to know why...
Reply
#9
I'm just put
Code:
nirexec -d

as last line in ~/.profile
and nirexec is running with the correct user.

in this case i din't need a bash script to start xbmc
Reply

Logout Mark Read Team Forum Stats Members Help
Launch XBMC with remote0