16 Feb

HTPC 2010 – The Install

Category:Hacking, Hardware, Howto's

The Install

Time for the install. Nothing spectacular here. I booted the thing off a USB-drive i created using unetbootin 3.93, with a Ubuntu 9.10 (32-bit) iso slapped on there.  There was some issues booting from the stick, because i couldn’t get to any kind of boot menu (F12 didn’t take me anywhere), so i had to take a look at the BIOS. The setup was a bit different from what i’m  used to, namely, the usb drive is detected as a hard drive, and not as a removable or separate device. So, to start off, i had to set the hard-disk to boot as the first device, and then set the order of the hard disks, so that the “primary” hard disk was the USB-drive, and the secondary drive was the internal 250 GB drive. After this, the boot worked just fine. After the installation was done, removing the USB drive bumped the 250GB to the primary drive.

Other things that need to be noted in the BIOS are: Setting your graphics memory to 512 (or whatever your max is). This will ensure flawless HD playback. Default is usually 64 or 128 or something, which isn’t enough. Also make sure you have all the necessary audio and video ports enabled.

The Ubuntu installation was quick and painless. I chose to use the entire 250GB drive, and let Ubuntu do it’s magic on it. Nothing special during the install.

After the installation, only a few packages are needed. The commands that i ran, in order:

apt-get upate && upgrade

apt-get install nvidia-glx-185

This updates the repositories, upgrades existing packages, and installs the nvidia hardware driver. You can also use the Administration -> Hardware Drivers, which at the time of this writing, installs the 185 driver.

Note! I had some problems with the latest 195 driver. After installing it, there were some dpkg errors that prevented the installation from finishing properly. After this, graphics were fucked, and i couldn’t start x. When i did get the driver installed, and everything seemed to work, i was completely unable to play any HD quality .mkv files. XBMC would crash to the desktop. Also, trying to play them in VLC for instanec, resulted in equally disasterous problems. So unless you are having problems with your ION and the default 185 drivers, don’t upgrade.

After this i pretty much followed the linux installation guide of XBMC in their wiki. Roughly the installation is:

  • add the correct repositories
  • run apt-get update
  • run apt-get install xbmc
  • configure sound
  • configure xbmc
  • done.

The setup i had was: Run video through VGA (i have only one HDMI in my current TV), and audio through spdif to my amplifier. This was a fairly easy thing to set up, though the audio was a bit problematic, as i will describe a bit later.

Connecting the VGA got me a good picture right away with native resolution (1366×768), whereas through the HDMI it got detected as 1280×720, which is incorrect. And the picture wasn’t scaling correctly either, so i figure i would have needed to add some modelines to my xorg.conf. More about this later when i get my new Tv and hook up using HDMI.

About the audio

Getting audio to work was a bit problematic. In XBMC go to System -> Settings -> System, and then to the audio output tab. There, you need to check that you have your amplifier or TV set to support DTS and AC3 audio (if it does), and that you are outputting digital audio. For me, i had to set the audio output device to custom, and the device to plug:dmixer, and the passthrough device to IEC958 to get everything working. Changes to your .asoundrc in your profile root was also necessary, to make it understand the plug:dmixer device.

If you don’t make the above changes, you will find that only surround movies (DTS and the likes) will work. The rest, say shittier mp3 audio movies will not play anything, or even display a “incorrect audio device” message. Which is odd, because you kind of expect it to be the other way around, that the complicated DTS and other encoded sound would not work.

First off, find out which device you want to be using, by running the command aplay -l in your terminal. Look at the card number, and the device number, and see which output you want. In my case, it was the spdif, which was card 0, device 1. In alsa speak, this equals hw0,1

The contents of my .asoundrc file, which is placed in the root of my profile is as follows:

pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,1"
        period_time 0
        period_size 1024
        buffer_size 8192
        #periods 128
        #rate 44100
        rate 48000
     bindings {
        0 0
        1 1

The bold line over there is the important one, and the only one you possibly need to change. Save the file, reboot the computer to be sure.

Now sound should work in any media files, regardless of the encoding.

Customizations i used in XBMC was the Rapier skin, basically. I stream media from my other machine through gbit lan, which works fine with any type of media.  I used a standard samba share for this, and no issues have cropped up so far.

I could write a bunch on scraping and other XBMC stuff, but they are so well documented in their wiki that i won’t bother. Just remember, the backspace key takes you back one level, and the c-key gives you the “right-click” context menu on any item (like a movie or folder). That is all.



Leave a Reply

Your email address will not be published. Required fields are marked *