HOWTO: Setup A Dedicated Boxee Box
Pick Out The Parts
You could always re-use parts, but you have to be careful here. In trying an old single-core AMD Athlon 64 3000+ running at 1.8GHz with on-board GeForce 6150, 720p video runs noticeably but not annoyingly at lowered frame rates. But you don’t have to go to the other extreme and get an AMD Phenom or Intel Core i7 processor with the latest nVidia GeForce GTX285. With the average home broadband connection at 2mb/s down and 720p video consuming 2.5mb/s, 720p is more of a niche offering offering right now and 1080p is out of the question. For 720p, an Intel Atom, Core 2 Duo, or recent AMD Athlon 64 II X2/X4 and GeForce 8xxx series card will do.
Not to completely dis ATI fans here, but AMD is still thawing the relationship of ATI’s past with Linux, and releasing XvBA for only the two most recent line of video cards (the Radeon 4800 series and up) doesn’t help much. The last three years (and five lines) of nVidia cards will run VDPAU, while XvBA doesn’t even have half of that.
Motherboard – Any MicroATX or ITX motherboard will do, as long as it supports your CPU. Bonus points for onboard graphics, but not necessary.
CPU – For 720p, an Intel Atom, Intel Core 2 Duo, or recent AMD Athlon 64 X2 CPU, preferably 45-65 Watts.
GPU – GeForce 8xxx series, can be on-board. Be sure you have an interface that your HDTV will accept (VGA, DVI, HMDI) or a converter handy.
RAM – 512MB, any more is just going to be wasted.
Storage – Just over 1gb (as the drive manufacturers define gigabyte).
Case – Anything, really. But if you want this to hang around your TV, it’s best to get something slim or small. If you’re going to use a standard desktop CPU with an ITX motherboard and case, be aware that most ITX cases are designed with ultra low-powered Intel Atoms and VIA C7 CPUs in mind. You can always fit an ITX motherboard in a MicroATX case as ITX motherboards use 4 of the same screw positions as MicroATX motherboards.
Install a Minimum Ubuntu System
Grab the latest Ubuntu server ISO and burn it to a CD. Optionally, you can set up a USB Stick, which can be a bit more work. When you boot, you’ll want to hit F4 for Modes and select Install a Minimum System. This will select the ubuntu-server-minimal.seed file and only give us the absolute minimum we need to get a command line.
Once you get your system installed, it’s time to make sure we have the latest updates. Issue the command
sudo apt-get update and then
sudo apt-get upgrade to update the system. Once done, issue the command
sudo apt-get upgrade again to see if there are package being held back. (You’ll something along the lines of
The following packages have been held back: followed by a list if so.) If there are any packages listed there, you’ll have to tell apt-get to install them manually using
sudo apt-get install [space-separated-package-list].
Install Boxee And Required Software
Now that you have security and bugs out of the way, you’ll want run
sudo nano /etc/apt/sources.list so you can add the line
deb http://apt.boxee.tv [ hardy | intrepid | jaunty | karmic | lucid ] main at the end. Use
sudo apt-get update to refresh the package list database.
Now we can get Boxee and some needed apps by runnging
sudo apt-get install alsa-utils boxee linux-headers-server xorg. Alsa-utils gives us sound, linux-headers-server gives us the header files we need to compile binary drivers for nVidia cards, and xorg gives us an X server to work with. A couple of notes I’ve found out along the way:
- Boxee only depends on an X server framework. If you don’t specify xorg, you’ll get errors about not being able to find an X server.
- The dependencies are a bit wonky for the nvidia binary drivers. If you don’t install the header files, the nvidia drivers will point to the meta package linux-headers which by default point to linux-headers-generic, resulting in a failed compile when using server kernels. By specifying linux-headers-server, the meta package linux-headers will be installed and will point to linux-headers-server.
Next up we need to get sound working. Run
usermod -a -G audio,video [username] to add a user to the audio and video groups. Log out and then back in to have the changes take place. Then issue the command
alsmamixer to manage audio volume. By default, everything in Alsa is muted. Use the M key to toggle mute/open for Master, PCM, Headphones, and Front and up/down to increase/decrease volume. Use the command
sudo alsactl store 0 to store these settings between reboots.
Now we’re ready to install the binary drivers. Run
sudo apt-get install nvidia-glx-185. This one will spew a few dependencies and take a little longer because the drivers use DKMS or Dynamic Kernel Module Support. If you’ve ever compiled your own kernel modules (drivers, etc.) you know of the hell that can arise when a kernel update comes down because everything that didn’t come out-of-the-box gets broken. DKMS automatically re-compiles modules that are not a part of the standard set of modules your distribution supports.
Now we need to configure the X server’s resolution, and this can get tricky real quick. Linux has changed quite a bit over the years, and most notably is the lack of an xorg.conf file. This is because Xorg tries to auto-detect what resolutions your monitor supports and pick the best (highest) one. However, if your monitor isn’t giving out the proper EDID info, this fouls things up fast.
sudo nvidia-settings. If your monitor is giving out the right EDID information, you’ll see the appropriate resolution in the drop-down box under X Server Display Configuration. If not, you’ll have to craft an xorg.conf file by hand. You can start by picking a resolution other than Auto, hitting Apply to test, and then hitting Save to X Configuration File. This will give you most of what you need.
The only thing left to do is force X to use a specific setting. Open the file using
sudo nano /etc/X11/xorg.conf.
Monitor section. Only keep the Indentifier, HorizSync, VertRefresh, and Option lines. Construct your own Mode line using either
gtf [horizontal] [vertical] [refresh] or
ctv [horizontal] [vertical] [refresh].
Section "Monitor" Identifier "Monitor0" HorizSync 28.0 - 33.0 VertRefresh 43.0 - 72.0 Modeline "1280x720@60" 74.48 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync Option "DPMS" EndSection
Next find the
Device section. Keep only the Identifier and Driver lines. Add the options found below.
Section "Device" Identifier "Device0" Driver "nvidia" Option "UseEDID" "False" Option "ModeValidation" "NoEdidModes, NoMaxPClkCheck, NoVertRefreshCheck, NoHorizSyncCheck, NoEdidMaxPClkCheck" Option "NoLogo" "True" EndSection
Lastly, find the Screen section. Keep the Indetifier, Device, Monitor, and DefaultDepth lines. Get rid of everything else. Add a Subsection like in the example below so that there is only one resolution to use.
Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 Modes "1280x720@60" EndSubSection EndSection
At this point, you should have a proper setup for running Boxee. However, we can tweak things a bit further by forcing login and using startup scripts to automatically launch Boxee.
To make your box log in automatically, edit
/etc/event.d/tty1 and change
exec /sbin/getty 38400 tty1 to
exec /bin/login -f boxee /dev/tty1 2>&1.
To start X automatically when you log in, create/edit ~/.bash_profile and add these lines:
case "`tty`" in /dev/tty1) clear && startx &>/dev/null;; esac
Lastly, to start Boxee when X starts, create/edit
~/.xsession and add the line