COMP 3000 2011 Report: XBMC

From Soma-notes
Revision as of 01:43, 19 November 2011 by Ketsiagb (talk | contribs)

Report - Part 1

Friday, October 14, 2011

5:26 PM

Background:

XBMC is short for Xbox Media Center. This operating system is focused primarily on media playback, including music, podcasts, television and movies. Its main goal is to serve as a versatile dashboard for personal media, acting as a set-top box. It is an open source software solution whose target audience/usage is similar to that of the Apple TV, PlayStation 3 and Xbox 360. XBMC is meant as robust operating system for home theatre PCs.

XMBC is itself developed by the XBMC Foundation. It is a non-profit organization that is made up of volunteer developers/translators from around the world. These developers were the original creators of the distribution, and have been updating XBMC since 2003.

XBMC can be downloaded as a media player/dashboard for Windows, MacOS, Linux, and can be used as a standalone Linux OS for PCs as well as other devices such as Xbox and iOS devices like the Apple TV, iPad, iPhone and iPod Touch. Distributions for all these platforms (except the original Xbox) can be obtained from xbmc.org and Cydia which is an alternative app store for iOS users.

The stand-alone XBMC (XBMC Live) with an embedded Linux OS (Ubuntu) is approximately 490 MB in size. The specific installation instructions cite a 2 GB minimum capacity USB key in order to boot/install from USB.

XBMC gets its namesake from the platform that it was first developed for. In 2003 XBMC was released, but only as an OS for hacked Xbox's. It was a notable piece of software, as it turned the video game console into a remarkably well featured media center. The OS was acclaimed for having great flexibility in terms of video and audio playback, as well as expanded functionality through user-created plug-ins and utilities. In many regards XBMC was the first major media center platform, predating the Apple TV, PlayStation 3, and other prominent set-top boxes.

XBMC quickly grew beyond its titular platform, making its way to Windows, MacOS and Linux, as well as hardware specific builds for PlayStation 3 and Apple TV. The software base of XBMC has also been used commercially as the backbone for the media center platform Boxee, which makes its own set-top boxes. While under a different name, XBMC has become the core for a widely popular consumer set-top box company.

Installation/Startup

Setup in Oracle VirtualBox VMWare

There were no real issues with installing XBMC in VirtualBox. I simply chose to create a virtual machine for a "Unknown/Other" OS type. The settings are detailed in the screenshot above, but the important details are as follows:

  • RAM: 1 GB
  • HDD Size: 10.4 GB (Dynamically Allocated)

UPDATE: Enabled 3D Acceleration within VirtualBox. Noticed a slight graphical improvement, but there was still no hardware acceleration within XBMC. This was likely due to the fact that I couldn't install the guest additions for XBMC. Sadly, I wasn't able to find suitable instructions for installing XBMC guest additions.

The installation process itself was smooth, albeit a little slow. It took around 5 minutes for the actual installation to complete, despite the fact that it is typically a lightweight installation as a host OS. When I installed XMBC on a HTPC and even an original Xbox (733 MHz CPU, 64 MB RAM) it didn't take more than a minute on either.

Aside from duration though, the installation went off without a hitch. Two partitions were created, filling the 10 GB disk. XMBC installed the appropriate drivers for USB devices, allowing me to use external controllers (such as an Xbox 360 Controller) to navigate the interface.

Basic Operation

Upon starting XBMC up, one major problem became readily apparent. XBMC is a graphically oriented OS, one that requires some graphical power to even run its basic dashboard smoothly. Virtualization, however, is only limited to the CPU, so the guest XBMC OS ran excessively very slowly, with a frame rate below 5 FPS. This is quite problematic, as the GPU is heavily involved in any interaction with the OS. This unfortunately cripples all of the functionality of the OS.

I spent some time looking into hardware acceleration for VirtualBox. However, most of my research turned up the same result; that it is only possible on major platforms acting as guest OSs (Windows, Mac, Linux). I will continue researching what alternatives might be available, but for now it is an exceedingly slow OS to virtualize.

Even browsing the basic dashboard took a frustrating amount of time. However, the actual design and interactivity of XBMC is impressive. The dashboard looks fantastic (even if it animates at the same speed as a slideshow), and actually importing videos and music was very intuitive, automated and took very few inputs (thankfully).

However, the keyboard controls for XBMC were quite intuitive, which was very appreciated in a virtualized environment. It is very easy to see how these controls would work well on a remote, or basic controller (tested with an Xbox controller).

As you can see from the main screen on the dashboard, access to personal media is incredibly quick and easy. XBMC also allows media to be imported by user-defined sources. These "sources" can be local or network sources. This is an intuitive system for defining and including specific media and libraries. Additionally, there are many robust and automated library building systems. XBMC is capable of building a remarkably large and complete database of metadata for any imported media, using online libraries like IMDB and TheTVDB.com as well as mp3tag to match metadata and artwork to entries in your movie, television, and music libraries. This feature is fantastic for users who like having their media organized (myself included); it also allows users to take advantage of the well-designed aesthetic of XBMC without having to take the time to manually input the metadata.

This is an ideal solution for organizing media from a variety of sources. While similar data would be included and displayed if obtained through a singular outlet (iTunes, Zune, etc.). However, in most cases, most users get their digital media from a variety of sources(imported CDs, DVD rips, torrent downloads, etc.). XBMC has one of the only systems in place that accommodates this reality.

In terms of it's use as a media player, XBMC was very impressive for both its ease of use, and format robustness. While sluggish, I was able to easily access my NAS and play a 480p movie. The video itself ran at a slideshow pace, but I was impressed with how few operations were required to open a video on a network device. Considering the level of complexity involved in using my NAS in a Windows environment, it was refreshing to see how easy it was to use.

While I was already familiar with XBMC's versatility with media files from all formats and codecs, its flexibility still deserves credit. Despite having a wide array of file types and formats in my collection, XBMC was able to play everyone one of them without issue. The same cannot be said for some contemporary home theatre platforms. Even years later, it is still much better at handling many varieties of video files than an Xbox 360 or PlayStation 3. This open source solution is still the easiest and in many ways, best platform for an HTPC.

XBMC also has embraced the idea of crowd-sourced applications. User-created add-ons and plugins are available. While there isn't a great deal of selection, those that are present heartily extend the usage of XBMC. While many act as important media extensions, including YouTube functionality, Netflix and others, there are add-ons that allow XBMC to take on other tasks.

Automated downloaders and torrent clients are available, allowing for XBMC to act as an Internet PVR. Emulators and game library plug-ins provide users with a retro arcade experience. Video plug-ins that improve you movie experience by automatically detecting the movie you are about to watch and gives you movie trivia questions related to that movie as well as playing trailers of current movies out in the theatre. Through these extensions, XBMC can provide a unique array of functionality, one that could only be found in an open-source environment.

Overall, XBMC is a media center platform that rivals its commercial counterparts, and in many respects excels beyond them. A great deal of the aforementioned functionality wasn't available for me to test out thoroughly; due to the lack of hardware graphics acceleration. These functions were instead tested out on other platforms (PC and Xbox hardware distributions). However, these distributions are functionally identical (another major advantage of XBMC). This may pose a problem for future sections of the report, but hopefully we can test out the Linux distribution of XBMC outside of a virtualized environment.

Usage Evaluation

As stated before, it is difficult to obtain a fair testing environment for XBMC through paravirtualization. However, in terms of meeting its design goals, XBMC remains an excellent media center OS. It recognized and played every media file in my library, regardless of format or codec. As a library/media manager, it was excellent; automatically organizing music, movie and television libraries, and populating them with the appropriate metadata and graphics.

Aesthetically, XBMC is equally impressive. The interface is well laid out, and intuitive. It also manages to take advantage of the detailed metadata for these libraries. For an open-source OS, XBMC presents a smooth interface that rivals major commercial platforms like iTunes and Xbox 360. In addition to this, users have the flexibility of changing the feel of the interface through several skins (themes) designed by the open source community. Some skins are specially optimized for particular platforms it runs on.

That alone speaks volumes about XBMC. It is a free and open-source distribution which is comparable and in many respects superior to platforms which have been created and backed by some of the largest and most successful software companies in the world.

It is also extensible in many interesting ways, taking advantage of being both an Internet connected device and an open platform. Through these plugins XBMC is almost limitless in its media center functionality, acting as a great interface for IPTV and other online content providers (Revision3, YouTube, IceFilms etc.) as well as being an arcade, supporting game ROM libraries and major emulators.

Seeing the potential customization and functionality of a stand-alone XBMC enabled device has made me very excited to incorporate it into a personal media center. Personally, I see the virtualization issues as an opportunity to test it out in a concrete environment. It is unlikely that there are many distributions chosen for this report which inspire the same sort of interest amongst students.

References

Part 2

Software Packaging

Software for XBMC is mainly packaged in the form of an add-on. These add-ons are basically packages that add features and functions not normally included with XBMC. Add-ons are usually developed by third-parties. Add-ons provide extra value and flexibility by making it easy for programmers to add new functions to the program, and letting users pick and choose which packages they want to use. XBMC's supported add-ons include plugins, scripts, and skins. The plugins, scripts and skins are usually written in python language and packaged together with other add-ons in the author’s repository. The repository is usually in the format of a .zip file. All the repository file mainly contains is an XML file accompanied with some images. The XML file contains the path to where the actual add-ons are stored. (Usually hosted on googlecode). To install or add any of the add-ons available in these repositories, from the main menu, the user simply navigates to System >Add-ons. The “install from zip file” option (Figure 1) is then selected and the user browses their filesystem and selects the repository (.zip file) saved locally. The user can proceed to selecting the add-on they wish to install from that particular repository by clicking on “Get Add-ons” from the Add-on window. All the add-on repositories added are displayed and clicking on any will display the add-ons available. Add-ons are usually categorized mainly by “Music”, “Video” and “Program” Figure 1 Screenshot of Add-ons page To remove any add-ons installed, the user simply selects “Enabled Add-ons” and choses their category of add-ons from which they want to delete. They are then presented with all the addons installed in that category. They add-on is selected and the user can select the “Uninstall” option

Though it seems like the user need to go through several loops before finally installing an addon, one advantage of the repository style is that updates could be easily pushed and the user notified when the system is running as opposed to manually updating the add-on Since XBMC is a media centre distribution built on top of Ubuntu, there is also under-the-hood software primarily for Ubuntu that run the back-end stuff for XBMC. The package manager dpkg is installed. This package manager installs, removes and supplies information about .deb packages necessary for system usage. dpkg --get-selections and dpkg --list can be used from the command line to view all the installed packages. The latter command is preferred since it reports the versions and description of the all the packages installed. It is worth mentioning that running the command confirmed that almost all the packages were that necessary for system usage. Though the user may never have to install packages through Ubuntu, it is still possible through the command 'dpkg --install <package_name>.deb' where the package is a file in your current working directory. They can be removed by using 'dpkg --remove <package_name>' (which will leave its configuration file) or dpkg --purge <package_name>' (which will remove the configuration file as well). Due to the absence of a GUI packet manager like Synaptics, we weren’t too certain on how many packages were actually installed but they from the dpkg --list command, they did not see that many. A major reason that can be attributed to the fact that the Ubuntu Operating System lying underneath XBMC is not meant to be tampered with as it’s meant to just power the media centre. That being said, the actual XBMC OS has a pretty extensive software catalog courtesy of the open source community. The website http://xbmcaddonbrowser.com/ displays just a few of the add-ons available with XBMC. There are several “unofficial” add-ons as well.

Major Package Versions

Table 1 below lists some of the packages (as well as their versions and upstream sources) that are important for system usage. Package Version Upstream Source Linux Kernel 2.6.32-29-generic http://www.kernel.org/ libc 2.11.1-0ubuntu7.8 http://www.eglibc.org X.Org X Server 1.7.6 http://www.x.org/wiki/ Bash 4.1.5(1)-release http://www.gnu.org/software/bash/ PCI Utilities (picutils) 1:3.0.0-4ubuntu17 http://mj.ucw.cz/pciutils.html Unzip 6.0-1build1 http://www.info-zip.org/UnZip.html Lirc 0.8.6-0ubuntu4.2 http://www.lirc.org/ Mtools 4.0.10-1ubuntu1 http://www.gnu.org/s/mtools/manual/mtools.html Pm-utils 1.3.0-1ubuntu3 http://pm-utils.freedesktop.org/wiki/ Lsof 4.81 http://people.freebsd.org/~abe/ dpkg 1.15.5.6ubuntu2 http://packages.qa.debian.org/d/dpkg.html Noticeably absent are a web browser and an email client. A plausible reason is the fact that the underlying Ubuntu OS is not meant to be fully functional (stripped down). Even with that reason, one may also argue that XBMC OS is supposed to be a media centre and hence the inclusion of a web browser or an email client addition is not necessary That being said, the actual XBMC has a very basic web browser add-on under the “Program” category and a Gmail email client.

Package Comparisons

Linux Kernel

The Linux Kernel included in XBMC is version 2.6.32-29-generic.The latest official stable release, as of November 15 2011, is 3.0.9 which was released on November 11, 2011.

Libc

XBMC includes version 2.11.1-0 of eglibc which is a fork of the main glibc 2.11 branch. It was release on January 19, 2011 and is the not the latest stable release of this fork. The latest stable release of the fork is 2.14 which is the branch of the latest stable release of libc 2.14 which was released on June 1, 2011.

X.Org

The version of X.org X Server included in XBMC is 1.7.6 which was released on March 17, 2010. The latest stable release of X.org X Server is 1.11.2, released on November 4, 2011. Bash XBMC includes version 4.1.5(1) of Bash which is a fork of 4.1 made by the Fedora team. It was released on April 12, 2010. This is the latest stable release of the Fedora fork, but Bash proper is at 4.2 which was released February 13, 2011.

PCI Utilities

The version of PCI Utilities included in XBMC is 1:3.0.0-4. This release is a fork of the original 3.0.0 made by the Ubuntu team. The latest release of pciutils is version 3.1.8 which was released on October 2, 2011.

Unzip

XBMC comes with Unzip version 6.0-1build1 which is a fork made by the Ubuntu development team of version 6.0. It was released on March 7, 2010 and it is the current stable version. The 6.0 version of Unzip is currently the latest stable version of Unzip and it was released on April 20, 2009. We believe the addition of this utility was crucial in the unzipping of the repository file to download add-ons.

Lirc

XBMC includes version 0.8.6-0ubuntu4.2 which was released on September 8, 2010. This version is the fork of 0.8.6 made by the Ubuntu team. The latest stable version of this fork is 0.9.0-0ubuntu1 (released on May, 5 2011) which is from the main 0.9.0 released on March, 26 2011. According to the change log in Ubuntu launchpad, this package was modified slightly by addition of certain packages. This package was chosen in our opinion to make the use of remotes accessible to capable hardware that XBMC was running o. This makes navigating through the media centre easier.

Dpkg

XBMC includes version 1.15.5.6ubuntu2 which was released on March 11, 2010. This release is a fork of the main 1.15.5 package. The current stable version of dpkg fork is 1.16.0.3ubuntu5 released on October 6, 2011. The latest most stable release of dpkg is 1.16.1.1.

Pm-utils

The version of Pm-utils on XBMC is 1.3.0-1ubuntu3. This is a forked version of the main 1.3.0 version. It was released on February 19, 2011 and is not the latest stable release - which is 1.4.1-8ubuntu1 which was released on July 8, 2011. The current stable version of pm-utils proper is 1.4.1 released on July 4, 2010. This package was probably chosen for power management of hardware that display the contents of media centre. There may be times when movies may be paused for extended periods of time and this package will come in handy to save power while the media centre is not being used actively.

Initialization

XBMC starts up after the stripped Ubuntu has loaded up. At boot up, the init is executed and it checks the configuration file xbmc-live.conf. This configuration file basically tells to run a couple of shells scripts in the system directory - /etc./xbmc/live.d.It also caters for scripts that are loaded in the user directory - /home/xbmc/.xbmc/live.d. The scripts in the user directory are basically optional scripts that users may write for added functionality. But by default, the folder is empty of scripts.

According to the configuration file, the scripts in the system directory are first sorted and called in ascending order. Upon peeking at the directory, it made more sense as the scripts in the directory had number prefixing their filenames. Some of the processes that run based on the system directory are: X.org - This process is the first to load since it has the prefix of 01 to the script name. It first detects the GPU (Graphics Processing Unit) type and loads the necessary graphics drivers. setAlsaVolumes - This process has an order number of 10 and it sets up the output volume. It takes a single argument(0-100) which is the volume level diskmounter - This process has order number 11.This utility searches for available HFS+, NTFS and FAT32 partitions, creates a mount point for them and mounts the partitions

References

[1] http://www.kernel.org/, visited on November 12,.2011

[2] http://www.eglibc.org. visited on November 12,.2011

[3] http://www.x.org/wiki/, visited on November 12,.2011

[4] http://www.gnu.org/software/bash/, visited on November 12,.2011

[5] http://www.lirc.org/, visited on November 12,.2011

[6] http://pm-utils.freedesktop.org/wiki/, visited on November 12,.2011

[7] https://launchpad.net/ubuntu, visited on November 12,.2011

[8] https://launchpad.net/ubuntu/lucid/+source/pm-utils/1.3.0-1ubuntu3, visited on November 12,.2011

[9] http://packages.qa.debian.org/d/dpkg.html, visited on November 12,.2011

[10] http://www.gnu.org/s/mtools/manual/mtools.html, visited on November 12,.2011

[11] https://launchpad.net/ubuntu/+source/pm-utils/1.4.1-8ubuntu1, visited on November 12,.2011

[12] http://people.freebsd.org/~abe, visited on November 12,.2011

[13] http://gitorious.org/xbmc/xbmc/blobs/HEAD/docs/manpages/diskmounter.1, visited on November 12,.2011

[14] http://gitorious.org/xbmc/xbmc/blobs/HEAD/docs/manpages/setAlsaVolumes.1, visited on November 12,.2011

[15] http://en.wikipedia.org/wiki/XBMC, visited on November 12,.2011

[16] http://doityourselfhtpc.com/2010/12/25/clean-install-xbmc-liv/, visited on November 12,.2011