Introduction
This is the third article about my journey building a HTPC server. If you didn’t follow the whole serie, they are available here: basic & hardware considerations.
I finally received all the hardware required to build my server. I only bought the base: a motherboard which includes CPU plus graphic card (AT5IONT-I), memory (1x1GB + 1x2GB), a case (Lian-Li PC-V354R), and a Blu-Ray reader. I re-used a Antec EarthWatt 500W power supply unit and a old 500G hard drive I had in some server laying at my place.
Installing Ubuntu Server 10.04 « Lucid Lynx »
I had some concerns about the Linux ability to handle all that recent hardware, especially on a server oriented distribution. Luckily, even if the hardware is recent, Intel didn’t design a whole new chipset for those low consumption platforms. The NM10 chipset found on the motherboard is pretty much an equivalent to the old ICH7 designed for Pentium 4 CPUs. Nothing really surprising here: the Atom 5xx series are just dual-core Pentium 4 with HT (Hyper-Threading).
Prior to installing Ubuntu, I flashed the BIOS to the latest revision (316 in this case). This was mostly to add support for the 2GB RAM module I bought, which isn’t supported with the firmware the board was shipped with. After flashing, I went into the BIOS to ensure a few things:
- That the SATA controller was in AHCI mode. I don’t know which kind of SATA controller is onboard, probably an Intel one, but anyway using AHCI avoid risks of missing driver while ensuring decent performance.
- That the onboard soundcard was disabled. I will use an HDMI cable to connect the HTPC to my TV, and thus use the audio capabilities of this protocol. The board expose 2 soundcards: a standard HD-Audio/AC97, and a nVidia HDMI one. I won’t use both so I’d rather disable the Intel card and avoid a ALSA configuration nightmare.
The Ubuntu installation was trivial, I won’t give any details here, its basically « next, next, next, done ». I’m sure you can find thousand guides out there on the Internet on how to install Ubuntu Server 10.04. Plugging my TV using HDMI just worked out of the box, I was able to use it as a screen for the whole installation procedure. I used the 64 bits version of Ubuntu, even if I can’t see any clear advantage for a server running with less than 4GB of RAM, except that I may use ZFS on it which is not available for the 32 bits x86 architecture.
I then updated the Lucid Lynx installation to Maverick (Ubuntu 10.10) using:
# apt-get install update-manager-core
I didn’t check if XBMC was installing fine on Lucid Lynx, but I guess most of the installation instructions given here are working the exact same on the older version.
After the installation finished, I installed an OpenSSH server to be able to perform all the administration tasks from my workstation:
# apt-get install openssh-server
From this point, the server was set up into its final location, plugged to both my TV and my network (using the 1GBits/s onboard network controller).
I knew I had to install both nVidia and VPDAU drivers, plus the VPDAU library from my readings on the subject, mostly the XBMC website.
# apt-get install nvidia-current libvdpau1 vdpau-va-driver
After a quick reboot, I had the nVidia drivers installed and waiting for some kind of X setup.
I also installed a few basic applications, like a decent text-editor (Vim is my choice), and the add-apt-repository helper:
# apt-get install python-software-properties
Installing XBMC
XBMC isn’t available in the official Ubuntu repositories. In order to get the latest version (10.0 Dharma) I had to add the SVN repository:
# add-apt-repository ppa:team-xbmc-svn
You should check prior to installing if you really need the latest build instead of the stable one which is available at:
# add-apt-repository ppa:team-xbmc
I created an user account for XBMC manually. I’m not sure this is required, as the packages may be doing it.
# useradd xbmc -m
Installing XBMC is then really easy:
# apt-get install xbmc xinit
xinit is included in the packages list to ensure we’ll be able to use the startx command.
After this step, XBMC should be installed.
In order to get it to start at boot I had the idea to install nodm, which is the simplest, dependencies-less display manager you can find on Unix. It was made to use on embedded devices and thus lack the ability to restrict access with a login screen: it just start whatever application you’d like using a specified user.
# apt-get install nodm
I then edited /etc/default/nodm like this:
# nodm configuration # Set NODM_ENABLED to something different than 'false' to enable nodm NODM_ENABLED=true # User to autologin for NODM_USER=xbmc # xinit program NODM_XINIT=/usr/bin/xinit # First vt to try when looking for free VTs NODM_FIRST_VT='7' # X session NODM_XSESSION=/etc/X11/Xsession # Options for the X server NODM_X_OPTIONS='vt7 -nolisten tcp' # If an X session will run for less than this time in seconds, nodm will wait an # increasing bit of time before restarting the session. NODM_MIN_SESSION_TIME=60
So the xbmc user will get auto-logged-in at boot. As any standard display manager, nodm will look for .xinitrc/.xsession file in the user’s home directory prior to using the default window manager. I created a .xsession file in the home directory of the xbmc user:
#!/bin/sh xbmc
Then it needed to be chmoded:
# chmod +x /home/xbmc/.xsession
We now need to allow any user to open an X server:
# dpkg-reconfigure x11-common
When prompted, choose to let anyone launch its own X server.
One reboot later, the system was working: nodm started, which then started XBMC! I only had to go in the System panel, in the System category, Video output, and configure the Video calibration… for the video image to use the whole surface of my TV, and set the sound output channel (check out the next chapter to learn how).
Customization: ASuSTeK AT5IONT-I specific fixes
Getting the sound to work on the HDMI link was a little tricky. In order for this to work, we need to configure a few options for the soundcard driver, as argument to its kernel module.
I first created the /etc/modprobe.d/sound.conf file with the following content:
options snd-hda-intel enable_msi=0 probe_mask=0xfff2
This tells the driver not to use MSI interrupts, and to apply a specific mask when looking for available soundcards. With the 0xfff2 value, only one of the 3 HDMI soundcards will get exposed:
# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0
The final touch was to create the /etc/asound.conf file to force ALSA to use this soundcard as default:
pcm.!default hdmi:NVidia pcm:iec958 hdmi:NVidia
After a quick reboot needed for the changes to take effect, I configured XBMC in the System panel, in the System category, Audio output, as follow:
- Audio output: HDMI
- Speaker configuration: 2.0
- Dolby Digital (AC3) capable receiver: Off
- DTS capable receiver: Off
- Audio output device: hdmi
- Passthrough output device: hdmi
This specific configuration suits my TV: its not AC3 nor DTS capable so I need XBMC to convert the audio stream on the fly to standard 2.0 stereo.
Things to come
I now bought a Remote Media Center compatible remote with a USB IR (Infra-Red) receiver, and a 4 ports PCI-Express x1 SATA card. I will make another article as soon as I get them to work.
I will also provide details on how I installed Samba to share my storage folder and access my home directory from my LAN.
I did a few attempts at compiling ZFS for the latest Ubuntu’s kernel version but yet none succeeded. I will post more about this aswell as soon as I can fix all the compile time errors.

[...] Here is the 4th and final post on this subject. Previous posts can be found here, here, and there. [...]
Thank you for the excellent guide! After hours of browsing for a way to get HDMI sound through my at5iont-i deluxe, your guide finally put me on the right track!
[...] HTPC linux installation & HTPC Xbmc configuration. | devquotes,Description : Article describing how to build an HTPC server. Previous article are related to hardware choice, this article handle the server installation.http://www.devquotes.com/2011/ .. [...]