Building a Zotac ION-based HTPC

I’ve been looking to replace my ageing Xbox which has reliably run XBMC for over 7 years with a box that can handle HD content, as well as acting as a NAS & download server. The Zotac ION box caught my eye, since the latest media center apps now support hardware acceleration for video playback & the nVidia ION GPU is supported.

Components

I bought the kit as a bundle from Mini-ITX.com and fitted a 32Gb SSD for the operating system, and a 1TB Western Digital Essentials HDD which would be attached via USB & powers down when not in use. The shopping list looks like this;

– Zotac ION-ITX-A Motherboard with Dual Core 1.6GHz Atom N330
– 2GB or 4GB DDR2 800 RAM included
– M350 Universal Mini-ITX Enclosure
(bundle costing £233 from Mini-ITX)

– OCZ Onyx 32GB SATA II 2.5in Solid State Disk
(about £50 from Amazon)

– 1TB Western Digital Essentials
(about £45 from Amazon)

OS

For the OS I wanted to use Windows 7; that’s what I’m most comfortable writing scripts + code for. The Linux distros for XBMC Live look pretty good, but there was too much of a learning curve involved for adding in the extra features I wanted.

Installing OS From USB

Since there’s no optical drive, I opted to install Windows 7 from a USB key. I actually used a 4Gb SD card from my camera & a SD card reader, and followed these instructions to make it bootable & have the Windows 7 installation on it. Installation went without a hitch.

Media Player

After installing the OS, I updated with the latest nVidia drivers, and started installing apps like XBMC. The latest Dharma release of XBMC supports hardware acceleration using DXVA2, however I was unable to get it working with 1080p content & gave up after a couple of hours. I then tried Media Portal which worked perfectly with whatever I threw at it. There’s a brilliant guide on how to configure Windows 7 and MediaPortal by Rhys Jones, which is useful to follow if you want to optimise your HTPC setup.

Remote Control

Next up was getting the remote control working correctly. I had a cheapo CyberLink remote, plus a Harmony 600.. I used the Cyberlink IR Reciever & mapped up keys into the Harmony 600. Some of the buttons worked, some didn’t. I ended up re-mapping the numeric keys to certain MediaPortal features using one of the plugins. I also re-mapped the MCE Green Button so that it runs MediaPortal (see this guide.. scroll to the Green Button heading).

Scripts

The HTPC also acts as a NAS + handles any downloads, so I’ve written a bunch of scripts to handle certain situtations.

– Timed execution of certain download tasks using Windows Scheduler. Making sure that the tasks don’t bring the HTPC out of sleep.
– Execution of scripts when the HTPC is brought out of sleep (like making sure MediaPortal is running)

Keyboard + Mouse Control

For times when I need a keyboard, I’m running Unified Remote on the HTPC and the client on my Android phone. This allows me to control most aspects of the HTPC via my phone, without having to buy extra hardware like a wireless mouse/keyboard.

Advertisements

IBM Thinkpad Hardware Control

The ‘Access IBM’ button on my laptop doesn’t get much use, so I decided to map it up to the PC release of XBMC (Xbox Media Centre). That’s the easy part, because you either set that in the registry, or use this small app.

When XBMC fires up I’d also like to set the volume levels of the laptop so that they output properly for the AV equipment I’ve got hooked into it. Once XMBC shuts down I’ll set back down so that the sound is at a lower level. The IBM laptops use a hardware volume control (independent to the Windows volume control) so I’m using some Python scripts to access the IBM hardware.

Here’s the finished scripts (the first one calls the second):

xbmc.vbs

Set WshShell = WScript.CreateObject("WScript.Shell")

'Set windows volume level
SetSoundLevel 90

'Set IBM ThinkPad volume level
ReturnCode  = WshShell.Run("C:\win32app\startup\thinkpadsetvolume.pyw 14", 1, true)

'Run XBMC and wait until it exits
ReturnCode  = WshShell.Run("C:\Progra~1\XBMC\XBMC.exe -fs -p", 1, true)

'Set IBM ThinkPad volume level
ReturnCode  = WshShell.Run("C:\win32app\startup\thinkpadsetvolume.pyw 3", 1, true)

'Set windows volume level
'SetSoundLevel 30

' ------------------------------------------------------------------------
' Function to set the Windows sound level
' ------------------------------------------------------------------------
Sub SetSoundLevel ( iMyLevel )

On Error Resume Next
Err.Clear 

Dim blSoundDevicePresent
Dim objSoundDevice

blSoundDevicePresent = False

For Each objSoundDevice In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_SoundDevice")
 blSoundDevicePresent = True
 Exit For
Next

If Not blSoundDevicePresent Then Exit Sub

Dim iDefaultLevel, iSoundLevel, objSoundLevel

iDefaultLevel = 5

If Not IsNumeric ( iMyLevel ) Then iMyLevel = iDefaultLevel

MyLevel = CInt ( iMyLevel )
If Err.number  0 Then iMyLevel = iDefaultLevel

If iMyLevel  100 Then iMyLevel = iDefaultLevel

Err.Clear
set objSoundLevel = CreateObject ( "SetSoundLevel.SoundLevel" )
If Err.number  0 Then Exit Sub

iSoundLevel = iMyLevel * ( objSoundLevel.GetMaxSoundLevel - objSoundLevel.GetMinSoundLevel ) / 100

objSoundLevel.SetSoundLevel iSoundLevel

set objSoundLevel = Nothing

End Sub

thinkpadsetvolume.pyw

import thinkpad
import time
import sys

if __name__ == '__main__':
    try:
        c = int(sys.argv[1])
    except IndexError:
        c = 14
    hk = thinkpad.Hotkeys()
    hk.set_volume(c)