Friday 26 August 2011

XBMC on the Apple TV 2

As previously mentioned, I've been playing with XBMC on the Apple TV 2.

Its worth noting that you need to finish running through the Apple TV setup (selecting language and location etc.) before you can access the device. This needs to be done after updating the firmware.

After installing the latest official build using these instructions I wanted to try the nightly builds. When attempting to update XBMC to a nightly version using the instructions on the same page, dpkg would halt on:
Preparing to replace org.xbmc.xbmc-atv2 10.0-9 ...

It turns out that because my Apple TV is running iOS 4.3, rm -rf which is used to remove the previous version when upgrading, is broken. I therefore needed to manually remove the previous version before updating using the following:
rm -r /Applications/XBMC.frappliance

Skins can be added manually to the Apple TV 2 build of XBMC by SSH'ing to it and downloading them with wget to the addons directory and unzipping:
cd /private/var/mobile/Library/Preferences/XBMC/addons/
wget <url of skin.zip>
unzip <skin zip file >
rm <skin zip file >
The skin can then be selected in XBMC (I'm using 'Night' at the moment).

If using an advancedsettings.xml for custom settings, this needs to go here on the Apple TV 2:
/private/var/mobile/Library/Preferences/XBMC/userdata
And the ever useful log file is at:
/private/var/mobile/Library/Preferences/xbmc.log

A Shared MySQL Database for XBMC

I want to use XBMC to stream media from my home server to various devices on my network. XBMC supports using a central MySQL database to store details about media such as the cast of a movie which can be accessed by any device on the network. This means that all devices are in sync, media only has to be scanned once rather than on each device and if you stop playback on one device you can resume from the same place on another device.

I followed this guide to set up the database.

I had to open port 3306 for TCP in the Vista firewall to allow devices to access to the database.

XBMC threw up some errors and I found that I had to scrap the databases I had created (xbmc_video and xbmc_music) and build them again with the following commands:
CREATE DATABASE xbmc_video CHARACTER SET latin1 COLLATE latin1_general_ci;
CREATE DATABASE xbmc_music CHARACTER SET latin1 COLLATE latin1_general_ci;

After getting it working with a XBMC 10.01 for Windows, I installed a nightly build of XBMC on an Apple TV 2 and found I had problems with the Apple TV build expecting a different database version. It looks like you need to be careful about using builds that that expect the same database version. XBMC creates the required tables automatically when scanning the library provided it can get to the DB and has access, so to rebuild the DB to a different version you just need to drop the tables (or drop and recreate the databases) and re-scan the library from XBMC.

The advancedsettings.xml file used by XBMC to enable the MySQL DB needed to go in the following locations:
Windows - C:\Users\<USERNAME>\AppData\Roaming\XBMC\userdata
Apple TV 2 - /private/var/mobile/Library/Preferences/XBMC/userdata

The XBMC log files are really helpful in diagnosing issues like these and are in the following locations:
Windows - C:\Users\<USERNAME>\AppData\Roaming\XBMC\xbmc.log
Apple TV 2 - /private/var/mobile/Library/Preferences/xbmc.log

Vista on the HP Proliant Microserver

I recently got an HP Proliant Microserver (which currently has a £100 cash back offer from HP) to store media and backups on. This is a little server box with 4 drive bays sporting a low power dual core AMD processor. I've added 4GB of DDR3 ECC RAM to give 5GB and as well as the 250GB HDD that comes with it, added a 2TB drive for storage. I had a spare copy of Vista so its currently running that while I wait for Windows Home Server 2011 to arrive.

I had a couple of issues installing Vista on it. First of all I had to change the SATA controller to IDE mode in the bios to get the installer to detect the hard drive.

Vista didn't find an ethernet driver. The machine has a Broadcom NetXtreme BCM5723 ethernet controller so I was able to use a driver from the Broadcom site.

Finally, rather than use the standard VGA driver, I used ATI Catalyst Mobility utility to pull down the appropriate graphics driver.

Vista runs a little sluggish on this machine but it should be fine for a little share sharing until WHS 2011 arrives.