XBMC on Asus AT5IONT-I using Debian

I finally figured out how to install a mostly working XBMC system on my new media center, a shiny Asus AT5IONT-I board with 4GB of ram.

Because it was quite a hassle, here’s the guide on how I did it, hoping that other people might benefit from it, and possibly myself too if I ever forget this when I need to reinstall πŸ˜‰

First things first, a quick overview of what I’ll be installing. I’ll be using Debian wheezy, or testing currently, with XBMC from the www.debian-multimedia.org repository.

We’ll start by inserting the Debian Wheezy CD and starting the installation. It’ll complain about firmware for the network interface, just hit continue on that, we’ll manage that later.

When asked about which software to install, untick everything but the the SSH server (as that will make it much easier to troubleshoot if something goes wrong). You could possibly also add the Standard System Utilities, but I didn’t as I wanted the system to be as lean as possible, and if I needed anything specific, I could just apt-get it.

From here on, most of the configuration can be done either through SSH, or through the terminal (ctrl+alt+f1 after we’ve installed the graphical bits)

Once Debian is installed and running, the first step is to get audio working. Why audio? Because it’s a bitch to get working on this motherboard, and I’d rather know sound is working before I install any other parts. So on we go, installing alsa and pulseaudio:

apt-get install pulseaudio alsa-base pulseaudio-utils alsa-utils

At this point, audio should be able to play through the analog channels (over the Intel chipset on the board), but HDMI is still a bitch to get working (it’s possible, just more difficult). The problem seems to be that the nVidia chipset should have only one output (HDMI), yet due to some driver issues multiple are recognized. To fix this, we need to set some module options on the HDA Intel driver. For other boards, see the XBMC guide on setting up HDMI audio for NVidia ION and other cards. For my card, the you need to add the following line to /etc/modprobe.d/sound.conf using, for example, nano /etc/modprobe.d/sound.conf:

options snd-hda-intel enable_msi=0 probe_mask=0xffff,0xfff2

Then type:

modprobe -r snd-hda-intel
modprobe snd-hda-intel
aplay -l

The first two commands will unload and reload the intel HDA driver, the second should lits all audio devices. At this point, there should be two device on card0, one analog and one digital, and just one device on card1, the HDMI one.

Now to actually test HDMI, we need the nvidia drivers (and X11) to be loaded. First, open /etc/apt/sources.list and add the words contrib and non-free to each of the sources. Then type:

apt-get update
apt-get install nvidia-glx nvidia-xconfig xorg
nvidia-xconfig

Seeing as apt is now again whining about the missing firmware bits, this is also a good time to fix that:

apt-get install firmware-realtek

For some reason, the nvidia driver won’t properly load unless the system is restarted, so let’s do so now.

shutdown -r now

Now let’s get to installing the actual XBMC packages. open /etc/apt/sources.list and add the following line:

deb http://www.debian-multimedia.org/ wheezy main non-free

Then do:

apt-get update
apt-get install debian multimedia keyring
apt-get update

And finally install XBMC:

apt-get install xbmc-standalone

Finally we need to have XBMC start when the machine boots, for which I’m using this solution. Simply edit /etc/rc.local and add the following line just before the exit line:

su – xbmc startx &

And then make xbmc the window manager with:

ln -s /usr/bin/xbmc-standalone /usr/bin/x-window-manager

And finally allow XBMC to actually start the X daemon, by running

dpkg-reconfigure x11-common

and specifying that Anybody can start it.

At this point you should try another reboot and see if XBMC starts by default. Now to get sound through HDMI, we’ll have to set it up in XBMC. Go to System -> System -> Audio Output and

  • Audio output: HDMI
  • Audio output device: High definition audio controller … (the HDMI one)
  • Passthrough output device: Custom, hw:1,3 (note, this is for this specific motherboard, use aplay -l to find which one you need)
  • If your display doesn’t support passthrough output, disable those.

This should make video and music go through the proper channel. Test this by starting up a song or movie, and seeing if you hear anything. If you don’t, start alsamixer and play around with the volume controls. I needed to press F6 to change to the nvidia card, and then unmute the SPDIF switch the the m key.

Video and music should now work, but XBMC-menu-blips will still go through the analog ports. Β To fix that we need a shell as the xbmc user, and execute pacmd which allows us to talk to pulseaudio. Make sure XBMC is running and in the menu.

First, find the sink you want it to output on with list-sinks, memorize the index. (use shift+pageup/down to see more on a normal terminal).

then type:

set-default-sink the_index_you_just_found

Next, we need to force XBMC on that sink too (as else it’ll save which one it was on before). Find it’s index by doing list-sink-inputs, and then type:

move-sink-input xbmc_id sink_id

And the blips should work now. At first with some delay, but that will go away after playing music or video (XBMC just needs to reopen pulse). You can type exit to exit the pulseaudio command shell.

Next up is allowing XBMC to shut down or put the computer to sleep, I used this guide.

apt-get install upower acpi-support

Then open /var/lib/polkut-1/localauthority/50-local.d/custom-actions.pkla and add the following lines:

[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=no
ResultActive=yes

While we’re at it, also install the following packages to allow USB auto-mount:

apt-get install udisks usbmount ntfs-3g

And open /etc/usbmount/usbmount.conf to add ntfs to the allowed filesystems, simply add it at the start of the FILESYSTEMS=”…” list.

Now to speed up booting a bit, I edited /etc/default/grub and set GRUB_TIMEOUT to 0, after which I ran

update-grub

At this point the XBMC is pretty much ready. All that’s left to do is set up the network access for smartphone remote control, and add all movie sources.

If any new developments are added, I’ll post a new item on this blog πŸ™‚