Categories
Tech

Send Command to XBMC to Start Music

You can use the following command to remotely start music playing on XBMC. The examples below were sent while I was SSH’ed into the XBMC machine. As you’ll notice from the music paths, I am using some of the ‘special’ paths which call up the LastFM tags of Rap and Alternative.

Start the LastFM Rap tag playing:

xbmc-send -a "PlayMedia(lastfm://globaltags/rap)"

Start the LastFM Alternative tag playing:

xbmc-send -a "PlayMedia(lastfm://globaltags/alternative)"

To play a tag that contains a space in it’s name, you must URL encode the space in your request (eg. replace all the spaces with %20). For example:

Start the LastFM ‘Classic Rock’ tag playing:

xbmc-send -a "PlayMedia(lastfm://globaltags/classic%20rock)"

I should note that each LastFM request is mutually exclusive of the other. Meaning each time you send a new PlayMedia request, the old genre/tag will stop playing and the new one will start playing.

I’ll add to this later when I start documenting some of the various URLs and functions that can be used to start playing music. A list of functions that can be sent can be found on the XBMC wiki.

Categories
Tech

Restart XBMC Live from SSH (Bash Shell)

As an update for XBMCbuntu, you can run the following command to start/stop XBMC:

sudo service lightdm [start|stop|restart]

Original Post:

I always forget the command for restarting XBMC Live from the shell, so I figured I would post it to my blog. It’s a really simple, one-line command:

sudo /etc/init.d/xbmc-live restart

Then enter the password for the root account (typically ‘xbmc’).

Just to be clear, the benefit of running this command instead of a full reboot (sudo reboot) is the above command only restarts the XBMC Live application. This means if you have any other services or apps running (like SABnzbd+), you can keep those apps running.

The only reason I’ve ever really needed the xbmc-live restart command is when something gets locked up on XBMC… and that usually only happens when I’m trying out new skins or plugins.

I should also note that on occasion this command will not restart XBMC live. The alternative is to stop, then start XBMC again using the following commands:

sudo /etc/init.d/xbmc-live stop
sudo /etc/init.d/xbmc-live start 
Categories
Tech

Set XBMC to Auto Update Library

After getting XBMC Live installed on my Revo and getting my library setup, I couldn’t find a simple option to have XBMC watch my video folder and automatically update my library. In place of this missing functionality, I figured I would setup a simple timed job to automatically update my library for me every hour.

Before I get started, I should note that there is an option to automatically update the library when the box is booted up which may work for some people. You can find this under System > Video > Update Library on Startup. This option wouldn’t work for me though as I leave my box on 24/7 or at most just put it in a standby state.

See below for the details on how to setup a timed job (cron) to update your video or music library. This consists of installing the xbmc-send application and setting up a cron job (and enabling the EventServer).