Monday, January 30, 2012

Day Eight: Building XBMC from Source

Between working and learning C and Vi for my Operating Systems class, I was not able to put any more time into compiling Freeciv since my last post. Upon starting my Ubuntu install in VirtualBox this afternoon, I discovered that I had somehow corrupted my operating system because it would not boot to desktop. I deleted that setup and installed a new machine with the latest version of Ubuntu. Everything is working fine now, but the delay put me behind schedule. My other group members are reporting success so far in building XBMC from source code. I will document my progress here and list all the steps along the way.

(note: the following steps are for Ubuntu users)
Step 1: Install Source Code
If you do not already have git installed, you can install it from terminal with this command:

sudo apt-get install git-core

Navigate to your home directory and issue this command:

git clone git://github.com/xbmc/xbmc.git xbmc

Step 2: Install Dependencies 
This single line installs most of the dependencies:


sudo apt-get install git-core make g++ gcc gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound2-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmpeg3-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs python-dev libyajl-dev libboost-thread-dev libplist-dev libusb-dev libudev-dev

And then one more line for newer versions of Ubuntu:

sudo apt-get install autopoint libltdl-dev


Step 3: Add XBMC's PPA to Your System
You can use these commands to add the PPA to your apt repository:

sudo add-apt-repository ppa:team-xbmc/unstable
sudo add-apt-repository ppa:pulse-eight/libcec

(These are other possible PPAs but they should not be necessary)
ppa:team-xbmc/ppa
ppa:team-xbmc/xbmc-ppa-build-depends
ppa:nathan-renniewaldock/xbmc-stable


Then update apt-get:

sudo apt-get update


Then run the "magic command" to build the dependencies

(note: this part did not work for me on 10.04, but xbmc compiled correctly anyways)
sudo apt-get build-dep xbmc        

Step 4: Compile
Navigate to the xbmc directory and run the following commands:
./bootstrap
./configure
make
make install    (note: might need to admin privileges)


Unfortunately, my compilation breaks during the make process, and I am unable to compile XBMC from source at the moment. I tried to utilize all of my resources, but it is obvious that I will need to make a topic on XBMC's forum or start a conversation in the IRC.

I have tried to compile the source code from the SVN repository as well and discovered some missing dependencies that were not installed from the provided command line code. Here are the extra dependencies that I had to install: libmms-dev, libwavpack-dev, libfaad-dev

The SVN version did not compile either. I will retry the process on a different virtual machine running an older version of Ubuntu. That is the only thing I can think to do at this point.

UPDATE:
I created a new virtual machine with Ubuntu 10.04 and went through all of the steps again. It compiles successfully and I am able to run it by calling "xbmc" through the terminal. Hooray!


Friday, January 27, 2012

Day Seven: How to Build a Project from Source

Teaching Open Source is one of our textbooks this semester. I mentioned it in an earlier blog post and commented on how different the approach is from what I am used to. In chapter 5, section 4, there is an exercise that walks the reader through all of the steps required to build Freeciv, a free open source strategy game, from source. The exercise goes into great detail, but does not always state the specific commands to use in Ubuntu. I will make my own walk-through as I attempt to build Freeciv on my own machine.

Step 1: Download the Source Code
Assuming that you already have Subversion installed on your machine, you can download the source code with the following command:

svn co svn://svn.gna.org/svn/freeciv/trunk freeciv

If everything goes smoothly, you should see a folder labeled freeciv in your home folder.

Step 2: Install Prerequisites
Freeciv has an INSTALL file that tells you all of the prerequisites that you need. The recommended prerequisites are libtool, g++, gcc, gmake, gettext, autoconf, automake, pkg-config, glib, atk, pango, and gtk+. A simple "sudo apt-get install *insert package name here*" works for most of these prerequisites. The package associated with gmake is simply "make". Glib, atk, pango, and gtk+ cannot be located. I found an ftp link to glib compressed as a bz2 file, but I am not sure what to do with it. I downloaded, extracted, and compiled it, but I do not know what directory it goes in. I put it in the etc folder because I noticed that a lot of other software use this folder. The building process might not work without these dependencies, but I am not sure what to do so I will just continue with the process.

Step 3: Configure
Navigate to your freeciv directory and run autogen.sh by typing "./autogen.sh" (minus the quotes). I received an error message at this point saying that libcurl development files are required. I installed curl, but I still get the same message after trying to run autogen.sh again. I am honestly beyond lost now. My understanding of Linux at the moment is far too limited to get past this point. I will ask my team members for some pointers and come back to this.

Step 4: Make
I cannot actually make Freeciv yet because my configuration failed. I will update this section once I make it through the configuration phase.

Wednesday, January 25, 2012

Day Six: Installing Subversion

Last night, I set up a virtual Linux machine using Oracle's VirtualBox and the latest version of Ubuntu. It runs very smoothly and looks great on my third monitor. My current setup, from left to right, is a 32 inch lcd tv for XBMC and streaming media, a 22 inch lcd for Ubuntu, another 22 inch lcd for my primary Windows display, and a final 22 inch lcd in portrait mode for web browsing. It's a great setup for both work and play. I can have my browser, multiple Windows applications, and Ubuntu open and visible all at the same time. Needless to say, I am a little spoiled in terms of screen real estate; therefore, laptops can feel a bit claustrophobic sometimes.

Last semester, I used a similar setup for my 362 Software Engineering project. The biggest downfall that I noticed is the lack of mobility. I own a decent laptop, but it has switchable graphics. Many Linux distributions either do not have the drivers that support switchable GPUs, or they make you jump through hoops to get this functionality. David, one of my group members, has been struggling with this same problem for a while now, but I believe he has got it working now. The GPU issue is just a minor inconvenience; the real problem is that I am using a very small SSD. It works great for a single OS and all of the applications that I need. Finding enough room to create another partition for Linux is easier said than done. If only I could bring myself to sacrifice Skyrim for more space. All joking aside, I may get a netbook sometime soon and install Ubuntu as my primary OS. This would solve all of my mobility issues and allow me to bring all of my materials to group meetings with relative ease.

I also installed Subversion last night and played around with some terminal commands. I used TortoiseSVN for my project last semester. The GUI is much easier for newbies to use, but it is not as clean and efficient as a simple terminal command in Ubuntu. The past two readings for this class have dealt with Subversion and worked their way from the ground up. This information really would have helped me last semester and kept me from Googling frantically. I managed to checkout the latest version of XBMC from the repository and looked briefly at the source code. Between the resources Dr. Bowring gave us and XBMC's awesome wiki, the entire process was easy and straightforward. There was a lot of right-clicking and moving through menu options with TortoiseSVN. I have a feeling that terminal window approach will be less of a hassle once I get used to it.

Monday, January 23, 2012

Day Five: First Impressions Revisited

I wrote in my last post that I would continue to monitor the IRC and mention any worthwhile conversations. As in past examinations, the channel was relatively quiet; however, this time people were asking more software oriented questions. It is clear that most information is contained within the forum because many questions about specific software features are addressed in setup "how-to"s and FAQs. A user who asked about the latest additions in XBMC v11.0 Eden Beta 2 was given a link to a forum post. The IRC rules state that questions should only be asked once informative resources, like the wiki or the forum, have been exhausted. Even though this particular user technically broke the rules, another user was nice enough to share a link to the answer. This behavior suggests that the community is more open to new users and contributors than some other software communities. I feel more comfortable introducing myself in the IRC now. I have already registered for XBMC's forum and its wiki-page, and I will provide an update my next post with the details of my introduction to the community.

I met with my group Sunday 22 to discuss our intentions for this project. Our first contribution should be a bug-fix; therefore, our efforts should be focused there. XBMC has a bug-tracker that here. There are a small number of tickets that are active and being addressed in the next patch. It might be best to start a forum post in the developer's topic and ask which particular tickets and/or problems should be addressed. Contributors with more experience could point us in the right direction. Our plans after the initial bug-fix are focused mainly on plug-ins and/or scripting. I suggested developing a simple plug-in that adds a functionality that is not contained within the base XBMC framework. One such possible plug-in could be a "shutdown after playback" option in the video's option menu; Windows Media Center Classic: Home Cinema has this option by default, and it is a great way to save energy.

Friday, January 20, 2012

Day Four: The Decision Has Been Made

Last class, my team chose XBMC as our FOSS project. I am really excited because there are a lot of opportunities to contribute to this vibrant community in the form of bug fixes and/or updated documentation. The headline on XBMC's wiki page asks users to update the manual for the latest release (Eden, XBMC v11). I do not know exactly how much work goes into updating documentation from one release to the next, but I can imagine that it is a significant amount of work, especially if the latest build is drastically different from the previous build. I went to webchat.freenode.net and logged into XBMC's channel (#XBMC) earlier today and left my browser open to monitor the chatter. The majority of discussion that I saw was between end users. One user wanted to know if intel and nvidia's atom/ion platform could handle 1080p playback when using XBMC. Another user asked about networking issues when syncing multiple XBMC clients to a single media source. The responses were generally quick, and the discussions seemed very lively; however, I did not notice any topics relevant to software development. With an average of 300 or more users on the IRC at any given time, it is difficult to believe that this brief example of chatter reflects an average discussion. If a user asked a question related to development issues, I am sure that a qualified user would respond. I will leave my browser open tomorrow and investigate this further.

I looked over the forum, and it seems that there is much more technical discussion. There are several forum topics and sub-forums, but the big ones are "Help and Support" and "Development." As I said earlier, it is difficult to judge an IRC from a single day's worth of monitoring; however, a forum has every thread available for viewing and discussion at any given point. If my group has any questions, we should try the IRC just to see if we get a response, but the forum is a sure way to get a decent reply. It just might take a little longer. Once my group decides on a particular interest within this project, I plan on introducing myself in the IRC and gauging the response. My group is meeting on Sunday to discuss possible ideas for contribution. I will report on our decisions and see what the XBMC community has to say.

Wednesday, January 18, 2012

Day Three: A New Project Proposal

I investigated the Nexus Mod Manager (NMM) that I mentioned in my previous post. Since this modding tool is still in open beta, I was not expecting anything glamorous. I just wanted to contribute to the community that made modding an enjoyable experience for me. Unfortunately, my findings suggest that the community associated with the NMM needs more time to develop. There is a significant amount of forum chatter surrounding the beta release of the NMM, and the community interest is certainly there; however, the communication channels are still in their infancy, and development is still spearheaded by a select few. The sourceforge page exists, but that is really all that can be said. I mean no disrespect to the community behind the project. There is just not enough documentation or activity for me to recommend this software project to my group.

In our initial group meeting, Team 3 decided that each group member should find one H/FOSS project that he or she finds interesting and worthwhile. After abandoning NMM as a viable project, I spent hours looking through dozens of potential projects. I found some pretty cool stuff out there, but, even if a software's community and its documentation looked promising, I had trouble making a connection with these projects. Eventually, I had a sort of epiphany and remembered that my media player (XBMC) is a FOSS. I switched to XBMC from Windows media center (WMC) last year, and it is safe to say that I will never go back. WMC felt static and clunky. I had difficulty associating video and audio codecs with WMC during the initial setup on new systems, and the general lack of customization always frustrated me. XBMC fulfilled all of my needs by providing a comprehensive media center application with a flexible framework that supports third party plugins. As an adamant user of this program, I can see myself as a part of the community.

XBMC seems like a much better alternative to NMM. It has a well-established community, and the wiki documents most things very well. A list of relevant links can be found on Team 3's wiki here. The latest release of XBMC (11.0 Eden) is in beta phase and could probably use a few testers and some updated documentation. I have not researched the project or its community as in-depth as the assigned reading goes, but that information will be listed in a future post if XBMC is chosen as our group project.

Note: XBMC's site will be down on January 18 in protest of SOPA/PIPA so do not be alarmed if you are unable to access the site during this time. 

Friday, January 13, 2012

Day Two: An Interesting Discovery

Last class, my group began looking over H/FOSS projects for this semester. There are plenty of websites that list hundreds of potential software projects. Finding a software project is not a problem; Sifting through the countless possibilities and agreeing upon a single project is the difficult part. Coming to a consensus is less of an issue with such a small group, but, even if only one person disagrees with the end decision, this conflicting interest could pose a hindrance to the entire group throughout the semester. We have until January 18 to come up with three project candidates. Rather than wasting time as a group, we decided to look for projects on our own and use the assigned exercise as the centerpiece for our discussion on Friday.

In my search for a candidate H/FOSS project, I was reminded of a section in chapter 2 from our reading last class. Section 2.5 mentions "climbing contributor mountain" and follows Alice on her journey from typical user to helpful contributor. The four steps listed are user, seeker, collaborator, and contributor. This flow seems natural to me, and I see a resemblance in the author's example with some of my own experiences. Replace Inkscape with Oblivion Mod Manager (OBMM) or Fallout Mod Manager (FOMM) and the story becomes very similar for me. This next section might seem like a tangent, but it is necessary in order to establish the background story for my initial project choice.

I am an avid video gamer and technology enthusiast. I get a thrill from modding boring vanilla products into personalized versions that offer a unique experience to the user based on individual preference. More and more games are headed in this direction with reactive gameplay and story elements, such as dialogue choices and detailed character creation tools. There are plenty of games out there that allow users to add their own content, but few companies are as supportive of their modding community as Bethesda Softworks. Bethesda releases toolkits for their Elder Scrolls and Fallout games that make it easier for the community to develop mods. I played Oblivion when it first came out and loved the game overall, but there are many bugs and nit-picky issues that I discovered in my playthrough. Bethesda patched the major bugs as they were discovered and reported by the community, but, as these open-world games become larger and more complex, it is increasingly more difficult to address every issue thoroughly.

By keeping games like Oblivion relatively open, Bethesda allows the community to participate in the software's maintenance. Tesnexus is one such community that provides users with a framework in which to release, download, and/or install unofficial patches, mods, and modding resources. I have worked my way up from a user to a seeker to collaborator within this community, but I have yet to contribute. Just recently, the Nexus community released the Nexus Mod Manager (NMM) in Open Beta. This software is open source, and it allows the user to download a file from the Nexus site and add it to a supported game. I used it to apply some high-res texture mods to Skyrim, and I was amazed by the relative simplicity of the process. This is something in which I am definitely interested, and I will report back in a later post with my findings.

Wednesday, January 11, 2012

My First Blog Post Ever

Welcome to my blog! ...and that's the only thing that I can think to say. It's funny how the human mind works, or doesn't work, sometimes. I read blogs, such as engadget and IGN, on a daily basis, and yet I haven't the faintest idea how to begin this post or what the finished product is supposed to look like. Should my blog be purely academic and concise or should it be more informal and contain my personal experiences as well? From my understanding, the purpose of blogging in this course is to document the students' progress with a FOSS (Free and Open Source Software) project and any lessons learned or actions taken along the way. This interpretation suggests that the learning experience is just as important as the actual outcome; therefore, I will do my best to include a succinct summary of any discoveries and/or accomplishments as well as an in-depth look into the thoughts and/or personal decisions that brought me there.

There are three requirements for our first homework assignment:
  1. Create a public, professional blog
  2. Join the class Wiki and link to our blog
  3. Register for POSSCON
I have completed these requirements and the assigned readings. Chapters 1 and 2 of the TOS (Teaching Open Source) textbook introduce a troubling problem that has only recently come to my attention. Most of my experience in the classroom so far is with programs that I made from scratch. In earlier classes, collaboration and/or reuse of existing code is frowned upon because there is a need to test students' fundamental knowledge of computer science. As a Senior, my relative inexperience with large, full-scale software is rather disconcerting. If I had known about the usefulness of FOSS much earlier in my career, I would have allotted more time to such studies. Luckily, I am not completely unfamiliar with large systems. My internship over the summer and some of my previous classes introduced me to a few of these systems. Last semester, I had the pleasure of working with OpenMRS, but I learned the pain of dealing with undocumented and/or abandoned software before choosing OpenMRS for my final project. With these experiences in mind, I will look over possible FOSS candidates in an even greater detail. I do not want to repeat the same mistakes I made last semester.