[Linux] Get a default Ubuntu install XBMC ready
#1
  • Installing Ubuntu from a USB device
  • Installing XBMC
  • Installing LIRC, and getting an IR remote working
  • Getting HDMI sound output to work
  • Accessing Windows network shares using Samba

I recently built my first HTPC, and after much research I decided my best option would be to install a default Ubuntu distribution, and then setup the more HTPC specific stuff from there. This is my Walkthrough, as I came across quite a few problems while setting up the machine. Hopefully you’ll be able to work your way around the same pit-falls with this guide.

Just to begin, I’ll state that this guide was written with the following assumptions in mind. I am running on a Zotac ION board. My goal was to have HDMI output working, with audio, as well as have a working remote. By the end I had working network share access, and everything else I had wanted to get working.

Step one involved getting the latest Ubuntu iso, installing it onto a USB key, and then installing it onto the hard drive on the HTPC. My HTPC setup didn’t have a CD-Rom, so this part was pretty crucial. I decided to go with the XFCE derivative of Ubuntu (Xubuntu), simply because I assumed it would handle better on the relatively low-end machine I was working with. You can find more information, or download the iso here.

Once downloaded, you’ll need a program to setup your USB key with the files required to get Ubuntu working. If you’re running Xubuntu, as I am, visit this webpage and follow the guide. If you’re running the standard KDE install run through this guide. Just a note, your USB key needs to be 2GB or larger. Once you’ve got your Linux-ready USB key, plug it into your HTPC and choose to boot from the USB media.

You will now boot into a Live version of Ubuntu. Assuming you choose the option to boot Ubuntu, you’ll end up at the desktop. There, you should see an icon to ‘Install Ubuntu’. This will allow you to install your current iteration of Ubuntu onto a hard drive. Run through the dialogue box, and eventually you will be rebooted where you’ll end up at the desktop again. Although this time, you’ll be running from your hard drive.

The next step is to install the graphics drivers. The easiest way is to access the Restricted Drivers dialogue box. On XFCE it can be found under Applications -> System -> Hardware Drivers. The KDE dialogue box can be found under a similar tree structure. Choose the display driver and click ”Allow”. The driver will download and install. In my case I was greeted with an Nvidia driver, but obviously, if you have an ATI card, you’ll see an ATI driver. One thing to note, XBMC center supports VDPAU (Essentially, it uses your graphics card and processors to render videos for smoother playback.), but it is an Nvidia technology. So don’t be disappointed when VDPAU doesn’t work with your ATI card.

We can finally install XBMC and run it under acceptable conditions. Open up a Terminal window and execute the following commands. (Note: This will only work for 9.10 Karmic or higher.)

Code:
$ sudo add-apt-repository ppa:team-xbmc
$ sudo apt-get update
$ sudo apt-get install xbmc
$ sudo apt-get update

XBMC should now be installed. Not so bad, right? The next step was to get LIRC up and compatible with my remote. I had a standard Media Center Remote, so I figured it wouldn’t be too hard to get up and running. I made a few mistakes though. So my advice early on is this. If you mess up one of the configuration files, simply open up the Synaptic Package Manager, or use a Terminal if you wish, and uninstall LIRC, including the config files. Then reinstall it and use the configuration dialogue again. (Actually, after a little research, you can simply recall the config dialogue by using the command sudo dpkg-reconfigure lirc)

To install LIRC open up a Terminal and use the following commands.

Code:
$ sudo apt-get install lirc

When the config dialogue pops up, you should only worry about the first drop down list. This includes the remote and IR dongle. The second list is a bit misleading, and doesn’t have anything to do with MCE compatible remotes as far as I’m aware. Anyhow, choose Windows MCE Remote from the first drop down list. Leave the second list on the ’None’ option, and hit continue. Now to test if your remote is working properly, open up a Terminal and execute the following.

Code:
irw

Now point your remote at the IR reader and start pushing some buttons. You should see some output text show up in the console if your remote is working properly. (Hit Ctrl – C to terminate the irw program when finished.) If not, the only advice I can give you is to run the configuration dialogue box again and make sure you chose the correct driver. After a correct installation, your remote should work with-in XBMC.

The final step I had hoped to accomplish was to get sound working over HDMI. This proved a bit challenging, but I found some helpful posts online. I’ll quickly reiterate what I found. Open a new terminal window or tab and execute alsamixer. Scroll to the right until you hit IEC958. If it is muted hit M, if not, leave it alone. Hit Ctrl – C when finished. Now enter cat /proc/asound/devices in the terminal, and you’ll get a list of sound devices. (The brackets show [Card – Device].) Use the following command to test if the device is working properly: aplay -D hw:card,device /home/[user]/Desktop/file.wav

Replace ‘card’ and ‘device’ with one of the card and device numbers we found earlier using the list devices command. Run through all of the devices until you find the one that works. Remember the card and device number of the working option. I should also note, you need an actual wav file to play, so make sure file.wav exists, or point it to a file that does. (Note: When I played my wav file, it sounded like crap, but that doesn’t matter. As long as one of the devices outputs sound.)

Now you’ll need to write the asound.conf file. Execute the following command: sudo nano /etc/asound.conf and paste the following, replacing the ‘device’ and ‘card’ words with the working device and card number you found earlier.

Code:
ctl.!default {
    type hw
    card x
    device y
}
pcm.!default {
    type plug
    slave {
        pcm {
            type hw
            card x
            device y
        }
    }
}

Hit Ctrl – O to save the file, and Ctrl – E to exit. Now reboot and sound should work over the HDMI cable. Make sure to change the sound options in XBMC from analog to digital, and choose HDMI under the options.

The last step was to get Windows network share access. I’m pretty sure Ubuntu 9.10 comes with Samba packaged, so there is no need to download it. In order to mount a network share, use the following command in Terminal.

Code:
$ sudo smbmount //10.0.0.2/Media /mnt/

This command will mount the Media folder from my computer with the local address 10.0.0.2 directly into my /mnt/ folder. It’s a dirty and simple solution, so you may want to look into creating a more permanent folder to setup network access. Samba won’t allow you to mount a root network drive, so the command smbmount //10.0.0.2 /mnt/ would fail. Just keep that in mind.

Hope this guide helps some of you out there. XBMC is legit, and I wouldn’t want anyone to be turned away from it because of lack of Linux experience, or anything like that. Post any questions, and I’ll try my best to answer them.
Reply

Logout Mark Read Team Forum Stats Members Help
[Linux] Get a default Ubuntu install XBMC ready0