Search this blog ...

Wednesday, January 13, 2010

Obtain Apple TV XBMC nightly build



# Should you want the latest available nightly Apple TV xbmc build, then ...

# ssh to apple tv as user frontrow, then ...

defaults read com.teamxbmc.xbmclauncher XBMCAdditionalDownloadPlistURLs 2>/dev/null | grep --silent mirrors.xbmc.org/nightlies/osx/update_urls.plist
if [ $? -eq 1 ]; then
defaults write com.teamxbmc.xbmclauncher XBMCAdditionalDownloadPlistURLs -array-add http://mirrors.xbmc.org/nightlies/osx/update_urls.plist
fi

# From the Apple TV User Interface, Go to the launcher menu, then choose "Settings", then choose "Downloads"
# - Obtain the appropriate xbmc download build.



Friday, January 8, 2010

Thanks Davilla and XBMC team - Apple TV support for Broadcom Crystal HD BCM70012

NOTE - the following instructions are here for historical reasons! There is now a much more elegant way to setup XBMC with Crystal HD on the ATV; See the following post

Thanks to Davilla!!! and Turbo!!

http://xbmc.org/forum/showthread.php?t=55042


# Step 0: http://rufn.it/aTV/ - Install the BroadCom BCM970012 Mini PCI-e HD card as per ewequeone's instructions.
# Note! - there is no need to clip the wireless antenna leads. You can electrical tape them up / heat-shrink-tube them

# Step 1: SSH in to the apple tv as the user frontrow using your favourite ssh client

# having successfully logged in, switch to the root user
sudo -s

# Note! - you will need to manually supply the ROOT password for the ABOVE command before proceeding ...

# Step 2: Obtain the crystalhd kext, driver, and firmware and install in to the appropriate location

cd /tmp

wget http://crystalhd-for-osx.googlecode.com/files/crystalhd-for-osx-1.0.1.zip

unzip crystalhd-for-osx-1.0.1.zip

mv crystalhd-for-osx-1.0.1/BroadcomCrystalHD.kext /System/Library/Extensions

chown -R root:wheel /System/Library/Extensions/BroadcomCrystalHD.kext

chmod -R 755 /System/Library/Extensions/BroadcomCrystalHD.kext

mv crystalhd-for-osx-1.0.1/libcrystalhd.dylib /usr/lib/

chmod 755 /usr/lib/libcrystalhd.dylib

mv crystalhd-for-osx-1.0.1/bcmFilePlayFw.bin /usr/lib/

chmod 644 /usr/lib/bcmFilePlayFw.bin

rm -rf /tmp/crystalhd-for-osx-1.0.1

# Step 3: Ensure that the crystalhd kext is activated at boot time by adding an entry to /etc/rc.local

# to load kexts, we require Turbo's ATV or Kext enabler ...
# check for presence of /sbin/turbo_atv_enabler.bin or /sbin/turbo_kext_enabler.bin

if [ ! -f /sbin/turbo_kext_enabler.bin ] && [ ! -f /sbin/turbo_atv_enabler.bin ]; then
wget http://0xfeedbeef.com/appletv/turbo_atv_enabler.bin
mv turbo_atv_enabler.bin /sbin
chown root:wheel /sbin/turbo_atv_enabler.bin
chmod 755 /sbin/turbo_atv_enabler.bin
fi

# begin rc.local changes ...
touch /etc/rc.local
cp /etc/rc.local /etc/rc.local.original


# check if kext enabler entry missing from rc.local
if [ `grep --count -G '^/sbin/turbo_\(atv\|kext\)_enabler.bin' /etc/rc.local` -eq 0 ]; then
if [ -f /sbin/turbo_atv_enabler.bin ]; then
echo "/sbin/turbo_atv_enabler.bin" > /tmp/rc.top
else
echo "/sbin/turbo_kext_enabler.bin" > /tmp/rc.top
fi

cat /tmp/rc.top /etc/rc.local.original > /etc/rc.local
rm -rf /tmp/rc.top
fi

# add kexload entry to end of rc.local file if missing
if [ `grep --count -G '^/sbin/kextload -v /System/Library/Extensions/BroadcomCrystalHD.kext' /etc/rc.local` -eq 0 ]; then
echo "/sbin/kextload -v /System/Library/Extensions/BroadcomCrystalHD.kext" >> /etc/rc.local
fi

# ensure rc.local permissions are correct
chown root:wheel /etc/rc.local
chmod 644 /etc/rc.local


# exit as user root, and return as user frontrow ...
exit


# Step 4: Next, we want to add support from laucher for downloading
# TheQuestor's svn builds which provide the latest xbmc builds with crystalhd support


# Note! You should now be the user frontrow.

# add custom xbmc download location entry for launcher if not present ...

defaults read com.teamxbmc.xbmclauncher XBMCAdditionalDownloadPlistURLs 2>/dev/null | grep --silent www.sshcs.com/xbmc/Info.asp
if [ $? -eq 1 ]; then
defaults write com.teamxbmc.xbmclauncher XBMCAdditionalDownloadPlistURLs -array http://www.sshcs.com/xbmc/Info.asp
fi


# Step 5: From the Apple TV User Interface, Go to the launcher menu, then choose "Settings", then choose "Downloads"
# - Obtain the latest xbmc download build available from TheQuestor e.g. XBMC r26651.



# Step 6: Reboot the Apple TV ...
sudo -s
reboot

# Step 7: After the Apple TV has rebooted, fire up XBMC from the launcher
# check that XBMC has detected the Crystal HD ...


# Check under "Settings -> Video -> Playback -> Render method", there is an option Auto-Detect, which could be changed to "Broadcom Crystal HD"

# If no /usr/lib/libcrystalhd.dylib or no BroadcomCrystalHD.kext loaded, then Broadcom Crystal HD will NOT show up as a rendering option.


# Optional - Basic debugging can be done in the event the Cyrstal HD was not detected:

# switch to root
sudo -s

# check that crystal hd hardware was detected
dmesg | grep -i crystal

Output :-
BroadcomCrystalHD::start
BroadcomCrystalHD: Found HW and started driver SW.


# check that crystalhd driver is loaded :-
kextstat | grep crystalhd

Output :-
75 0 0x2f588000 0xb000 0xa000 com.broadcom.crystalhd.driver (0.9.26) <5>


# Check the xbmc.log when playing an appropriate movie ..
grep -i crystal /Users/frontrow/Library/Logs/xbmc.log

Output :-
16:19:54 T:2684407808 M: 14409728 DEBUG: Loading: libcrystalhd.dylib
16:19:59 T:2684407808 M: 11501568 INFO: CrystalHD: device opened
16:40:28 T:51790336 M: 20217856 INFO: Trying Broadcom Crystal HD Decoder...
16:40:29 T:51790336 M: 13025280 DEBUG: CrystalHD: codec opened
16:40:29 T:51790336 M: 13025280 INFO: DVDVideoCodecCrystalHD: Opened Broadcom Crystal HD Codec





People should strongly think about donating to the xbmc team/davilla to ensure that further development continues. They have effectively extended the lifetime of the ATV! ( PS.. yes I donated ;) )
http://xbmc.org/contribute/donate/

Additionally, if you want to duplicate the instructions found in this guide, please at least link back to it.