![]() |
|
|||||||
| XBMC for Linux and XBMC Live Specific Support Need help with XBMC for Linux or XBMC Live, or think you've found a bug? Discuss it here. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Fan
Join Date: Nov 2006
Posts: 479
![]() |
Here are some simple shell scripts that you may find useful. I'm not a particularly strong scripter, so I'm sure these can be greatly improved.
Start/Kill XBMC with the remote control If you don't have a wireless keyboard, it can be useful to start XBMC with the remote control. XBMC is still in beta, so it can lock up occasionally. When it does, you can SSH in and kill the process, get out that keyboard again and ctrl-alt-backspace, or use the remote to kill the process. The remote is the way to go. === 1 Install LIRC, the daemon that receives IR signals from the remote control. In the terminal: Code:
sudo apt-get install lirc lirc-x liblircclient0 To determine what should be placed in the "button" lines in your .lircrc, referenced in section 3: 1) Run "irw" from the terminal. It should appear to hang. If it doesn't, or you get an error message, your LIRC is setup incorrectly. 2) Point your remote at the receiver and press the button you want to assign. The buttons I've used are on the windows MCE remote and unused by XBMC. 3) Hit CTRL-C to exit irw. === 3 Put the following in your ~/.lircrc file, replacing the "button" arguments as you like. Create the file if it does not already exist. Code:
# Start XBMC begin prog = irexec button = RecTV config = /home/youruser/scripts/startXBMC.sh end # Kill XBMC begin prog = irexec button = DVD config = /home/youruser/scripts/killXBMC.sh end This script will start the IR daemons. Create it as "/home/youruser/scripts/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 youruser|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 youruser|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
irxevent /home/youruser/.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 irxevent
irexec -d /home/youruser/.lircrc &
fi
exit
To automatically start the IRXevent and IRexec daemons when you login to the desktop, go to the SYSTEM, PREFERENCES, SESSIONS menu. Click "Add", and fill in the following: Name: Start IR Daemons Command: /home/youruser/scripts/startIRexec.sh Comment: whatever you want Click OK, then the checkbox so it's enabled. This will run the startIRexec.sh script every time you log on to the desktop. === 6 Create the following scripts. These actually start and kill XBMC. /home/youruser/scripts/startXBMC.sh: (replace "youruser" with your user name) 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 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 youruser|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 youruser|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
Make the scripts executable. Code:
chmod +x /home/youruser/scripts/*.sh Log out of the desktop, then log back in. You should be set! 1) Press the button you set to start XBMC (Recorded TV if you used my suggestion). XBMC should start. Start playing a video. 2) Press the button you set to kill XBMC (DVD if you used my suggestion). XBMC should gracefully exit. Your mouse should still work in X windows, if you have one plugged in. 3) Start XBMC back up, start playing a video, then make XBMC lock up. The easiest way is to play a video, go to the video options, and change the interlacing method a couple of notches. Then press the kill button again-- it should hard kill XBMC, instantaneously taking you back to the desktop. Your mouse will likely be inoperable; to fix it just start and stop XBMC again. Hope this helps, and please post any other tips you've hacked together! Last edited by rodalpho; 2008-10-02 at 18:07. Reason: Oct 2 2008 - Changed binary strings to xbmc.bin |
|
|
|
|
|
#2 |
|
Fan
Join Date: Nov 2006
Posts: 479
![]() |
I started using FreeNX (a much faster remote desktop than VNC) and the remote stopped working. FreeNX actually starts a separate instance of X windows, which re-runs startIRexec.sh. I believe this associates the execution to the freeNX instance, which of course doesn't work. To fix this, remove the kill statements from the beginning of the script.
If you stick with VNC (the built in vino stuff in Ubuntu) use the old script. The preliminary kill is a good thing. /home/youruser/scripts/startIRexec.sh: Code:
#!/bin/bash #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 irxevent /home/youruser/.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 irxevent irexec -d /home/youruser/.lircrc & fi exit |
|
|
|
|
|
#3 |
|
Fan
Join Date: Nov 2006
Posts: 479
![]() |
Obviously ripped from PM3, but it looks pretty good. I created my launcher with just a space (" ") as the name, since the icon is fairly descriptive.
|
|
|
|
|
|
#4 |
|
Member
Join Date: Jun 2007
Posts: 47
![]() |
This is a small variant on the above scripts that start and stop XBMC. This script can be bound to one key to start (or restart) XBMC. You'll want to edit the "export USER=elvis" line to set it to your username.
#!/bin/bash export USER=elvis export XBMC_HOME=/home/$USER/XBMC/BUILD export LOG=$XBMC_HOME/restart.log # Test to see if XBMC is still running if ps -ef|grep -v grep|grep -i XboxMediaCenter then # Send gentle kill signal killall XboxMediaCenter echo `date` "Killed XBMC! (soft)" >> $LOG # takes a second or two to die with the soft kill sleep 2 # still running? Send hard kill signal if ps -ef|grep -v grep|grep -i XboxMediaCenter then # If it's still around, kill it -9 killall -9 XboxMediaCenter echo `date` "Killed XBMC! (hard)" >> $LOG fi fi echo date "Starting XBMC" >> $LOG export DISPLAY=:0.0 cd $XBMC_HOME ./XboxMediaCenter -fs &
__________________
XBMC machine: ABIT AN-M2HD with nVidia 7050 onboard (Ubuntu Hardy + latest nVidia driver), AMD Athlon BE-2350, Microsoft MCE IR Remote, Logitech PS3 USB keyboard, 33w idle, 53w max, 720p plasma over HDMI |
|
|
|
|
|
#5 |
|
Member
Join Date: Jun 2007
Posts: 47
![]() |
If you have the binary nVidia driver installed, as you need to for XBMC to work, suspend probably does not work for your machine. Here is how to get suspend working. These instructions are from here, but cleaned up a bit. They worked for me. Resume takes about 8 seconds.
1. Add an "Option "NvAGP" "1" in /etc/X11/xorg.conf Edit existing "Device" section to add Option "NvAGP" "1": Section "Device" Identifier ...EndSection 2. Disable the agpgart module in /etc/modprobe.d/blacklist Add the following lines to your /etc/modprobe.d/blacklist file: blacklist intel_agp blacklist agpgart 3. Two edits to /etc/default/acpi-support 3a. Disable warm-booting the video hardware Edit /etc/default/acpi-support to set POST_VIDEO=false 3b. Disable SAVE_VBE_STATE option Edit /etc/default/acpi-support to set SAVE_VBE_STATE=false 4. Disable compiz VBLANK sync Run this from the command line: gconftool --set /apps/compiz/general/screen0/options/sync_to_vblank 0 --type bool
__________________
XBMC machine: ABIT AN-M2HD with nVidia 7050 onboard (Ubuntu Hardy + latest nVidia driver), AMD Athlon BE-2350, Microsoft MCE IR Remote, Logitech PS3 USB keyboard, 33w idle, 53w max, 720p plasma over HDMI |
|
|
|
|
|
#6 |
|
Fan
Join Date: Nov 2006
Posts: 479
![]() |
If you're having problems with the SVN releases, follow this procedure before posting to the forums.
1) Back up your Userdata directory just in case. Code:
cd ~ tar zcvf home_xbmc.100208.tgz .xbmc Code:
cd ~/XBMC make uninstall cd ~ rm -Rf ~/XBMC Code:
cd ~ svn checkout https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/linuxport/XBMC 5) Rebuild and reinstall XBMC. Code:
cd ~/XBMC ./configure --disable-debug make -j2 make install Last edited by rodalpho; 2008-10-02 at 18:03. Reason: Oct 2 2008 - build.sh is largely deprecated, changed to new make syntax |
|
|
|
|
|
#7 |
|
Fan
Join Date: Nov 2006
Posts: 479
![]() |
1) Compile XBMC with debugging enabled.
2) Start it up in windowed mode under the debugger via Code:
export XBMC_PLATFORM_MODE=1 gdb /usr/local/share/xbmc/xbmc.bin Code:
(gdb) run 4) Once it crashes, you'll end up back at the (gdb) prompt. Type Code:
(gdb) backtrace http://pastebin.com/ 6) Post the pastebin link to the forums. Last edited by rodalpho; 2008-10-02 at 18:05. Reason: Oct 2 2008 - Changed to xbmc.bin nomenclature |
|
|
|
|
|
#8 |
|
Team-XBMC Linux Packager
|
Gutsy PPA packages available .
Just add the gutsy team-xbmc PPA to your repositories and install xbmc Use the steps described in the Ubuntu documentation with the following repositories . You might not need to add the deb-src one . Code:
deb http://ppa.launchpad.net/team-xbmc/ubuntu gutsy main deb-src http://ppa.launchpad.net/team-xbmc/ubuntu gutsy main The code level is SVN rev 12195 , compile with --nodebug and there isn't MythTV support (the option wasn't add on compile time and isn't there by default). The label is 2.1a1-gutsy2 If you want me to update the package with some other compile options please request it. The label will be changed to 2.1a1-gutsy3. If you want the build from another SVN revision then the label should be changed to 2.1XY-gutsyZ where :
https://answers.edge.launchpad.net/xbmc/+faq/80 If you have some comments and modification, please let me know . Next step is to ask and create the package for gutsy. If it's done right now, I'll update and upload the source to the PPA. |
|
|
|
|
|
#9 |
|
Member
Join Date: May 2008
Location: Frisco, TX
Posts: 53
![]() |
Hi!
Tried this under Hardy, but could not find XBMC in the packet manager. Is this still valid, or is there a "trick" to it? /n00b... |
|
|
|
|
|
#10 |
|
Team-XBMC Linux Packager
|
This was only for Gusty. Hardy is not officially supported yet.
But I have created a package for Hardy (which is highly instable) . For this, use the same trick with the information at: https://edge.launchpad.net/~team-xbmc-hardy/+archive/ |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|