Tuesday, May 18, 2010

Build your own Media Center: Installing XBMC on Fedora Core 12 (FC12)

First, make sure you have a user "xbmc" installed - we'll run everything as a protected user.

I would login from a laptop or another PC with an ssh windows client, such as putty ssh (Putty Download) to do the installation, just in case you mess up something. To upload files use a windows sftp package like Bitvise Tunnelier (Tunnelier Download).

Install the latest NVIDIA Linux Driver - I wont document ATI Cards, since we're gunning for VDPAU processing offload to the graphics card to keep our media centre running at optimal performance. You SHOULD update your kernel at the same time:

yum install kernel.x86_64 kernel-devel.x86_64

Reboot, and install the latest NVIDIA Kernel modules (which will install dependent Xorg modules/libraries).

yum install kmod-nvidia-2.6.32.11-99.fc12.x86_64.x86_64 (make sure to match kernel number to running kernel)

You might need to adjust your grub settings if you get errors when loading nvidia.ko kernel module like:

May 18 14:12:03 localhost kernel: NVRM: No NVIDIA graphics adapter probed!
May 18 14:12:36 localhost kernel: NVRM: The NVIDIA probe routine was not called for 1 device(s).
May 18 14:12:36 localhost kernel: NVRM: This can occur when a driver such as rivafb, nvidiafb or
May 18 14:12:36 localhost kernel: NVRM: rivatv was loaded and obtained ownership of the NVIDIA
May 18 14:12:36 localhost kernel: NVRM: device(s).
May 18 14:12:36 localhost kernel: NVRM: Try unloading the rivafb, nvidiafb or rivatv kernel module
May 18 14:12:36 localhost kernel: NVRM: (and/or reconfigure your kernel without rivafb/nvidiafb
May 18 14:12:36 localhost kernel: NVRM: support), then try loading the NVIDIA kernel module again.

To remedy, add "nomodeset" to the /etc/grub.conf line for your kernel:

kernel /vmlinuz-2.6.32.11-99.fc12.x86_64 ro root=/dev/mapper/vg_xbmc-lv_root LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet nomodeset

Then, install subversion and checkout the latest XBMC out of the repository:

yum install subversion.x86_64

cd /home/xbmc

svn checkout http://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk xbmc

Add the RPMFusion repository (This will make things easier I promise, half of required packages do not exist on the standard FC Repos):

rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

Then install the following XBMC Dependencies:

yum install quilt.x86_64 cmake.x86_64 autoconf.noarch automake.noarch unzip.x86_64 boost.x86_64 boost-devel.x86_64 mesa-libOSMesa.x86_64 mesa-libGL-devel.x86_64 mesa-libGLU-devel.x86_64 libjpeg-devel.x86_64 glew-devel.x86_64 libsamplerate-devel.x86_64 libogg-devel.x86_64 libvorbis-devel.x86_64 freetype-devel.x86_64 fontconfig-devel.x86_64 zfstream.x86_64 fribidi-devel.x86_64 libsqlite3x-devel.x86_64 mysql-libs.x86_64 alsa-lib-devel.x86_64 libpng-devel.x86_64 pcre-devel.x86_64 lzo-devel.x86_64 libcdio-devel.x86_64 SDL_image-devel.x86_64 SDL_mixer-devel.x86_64 enca-devel.x86_64 jasper-devel.x86_64 libXt-devel.x86_64 libXmu-devel.x86_64 libXinerama-devel.x86_64 libcurl-devel.x86_64 dbus-devel.x86_64 hal-devel.x86_64 avahi-devel.x86_64 libXrandr-devel.x86_64 libavc1394-devel.x86_64 libmp4v2.x86_64 libmp4v2-devel.x86_64 libass-devel.x86_64 flac-devel.x86_64 wavpack-devel.x86_64 python-devel.x86_64 gawk.x86_64 gperf.x86_64 nasm.x86_64 cwiid-devel.x86_64 zlib-devel.x86_64 libsmbclient-devel.x86_64 libtiff-devel.x86_64 libisofs-devel.x86_64 openssl-devel.x86_64 libmicrohttpd-devel.x86_64 libmodplug-devel.x86_64 libssh-devel.x86_64 libssh2-devel.x86_64 gettext.x86_64 cvs.x86_64 libtool.x86_64 gcc-c++.x86_64 libmad-devel.x86_64 bzip2-devel.x86_64 libmpeg2-devel.x86_64 libmpeg3-devel.x86_64 libmms-devel.x86_64 mysql-devel.x86_64 faad2-devel.x86_64 libXtst-devel.x86_64 ccache.x86_64 expat-devel.x86_64 libvdpau-devel.x86_64

Start the XBMC Installation:

./bootstrap

./configure --disable-pulse --enable-vdpau --enable-ccache (We'll use direct ALSA Drivers for Multiplexing and enable VDPAU for offloading)

make -j2 (dual core) or -j4 (quad core)

Takes about 35 minutes to compile on a 2.4Ghz Core2Duo with 2GB RAM

make install

To autologin as the xbmc user, edit the /etc/gdm/custom.conf file and add the following section:

[daemon]
TimedLoginEnable=true
AutomaticLoginEnable=true
AutomaticLogin=xbmc
TimedLogin=xbmc
TimedLoginDelay=0

Then reboot your machine, go to System --> Preferences --> Startup Applications and then uncheck everything except for:

"Volume Control"
"Network Manager"

Then click on Add to create an XBMC startup item, and fill in the following:

Name: xbmc
Command: /usr/local/bin/xbmc

Click on Save, and then hit CTRL-ALT-Backspace to restart GDE, which should now automatically login and start XBMC with sound. All very nice and pretty !!!

No comments:

Post a Comment