Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, March 23, 2010

Linux as a Gaming Platform

This past week, I've gotten more and more Windows-native games (as well as *nix ports) to run on my Arch x86_64 box. I originally built the computer with gaming in mind, but with Windows 7 getting worse and worse by the minute, booting into Windows just to play a game was becoming a more and more laborious task, not to mention that dirty feeling you get when you boot a computer and the Windows logo pops up.

I had originally used the latest stable version of Wine (1.0.1) obtained from Arch's User Repository, but found it was just as buggy as my previous Wine experiences. I managed to get Halo to run as mentioned in a previous post, however there were still relatively minor issues that persisted, such as the odd screen flicker, graphical problems on screen panning, and an odd box of discoloration that appeared in the top-right corner of the screen.

On a whim I decided to upgrade to the latest developmental version of wine (1.4.1), which was also in the AUR, though the PKGBUILD required some minor editing as wget was met with a 404 error trying to download the necessary files from the link given in the PKGBUILD. Luckily a fellow Archer posted a revised PKGBUILD in the comments, and it worked like a charm. Once the new Wine was up and running, I double-checked Halo to make sure the upgrade didn't brick it... Far from, it increased performance ten-fold, which is hard for me to say because it really wasn't bad at all to begin with. Suffice to say an immediate performance increase was more than noticeable.

After perusing the Wine AppDB for games I owned that were known to work well with Wine, I decided I'd give Half-Life 2 and Counter-Strike: Source a go. I encountered, and eventually fixed the same problem in both games. They would both load, but neither rendered any sound. After a quick trip through 'winecfg' I set the sound to OSS instead of ALSA, and it now works wonderfully. Not quite sure why, since ALSA is recommended explicitly over OSS for Wine, but with ALSA I can only play Halo, and with OSS all three games work. I suspect it has something to do with Steam, but I'll leave well-enough alone for now.

Now for the less-troublesome ports. There are countless remakes of the original DOS doom, most adding additional functionalities such as the ability to jump/crouch or have crosshairs, et cetera. Chocolate-Doom (AUR, detecting a trend here?) is a play on 'Vanilla Doom', as in the untouched original DOS version. It is as close to the original as possible, and preserves only original functionalities, as well as the original bugs. Using chocolate-doom I was able to play Doom 1, Doom 2, TNT, and Plutonia, just by setting the -iwad option on the command line and the path to the wad. Now I bought the id Super Pack on Steam some time ago, so I have access to the WADS on my Windows partition. Of course starting the game via a rather long terminal command isn't exactly efficient, so I wound up toying around with my ~/.bashrc file and got a rather satisfactory result.

~/.bashrc is used to create 'Aliases' for commands entered into the shell, using a very simple configuration file. Here's the portion of my ~/.bashrc pertaining to chocolate-doom:

alias chocolate-doom1="chocolate-doom -iwad ~/Data/DOOM.WAD"
alias chocolate-doom2="chocolate-doom -iwad ~/Data/DOOM2.WAD"
alias chocolate-doom-plutonia="chocolate-doom -iwad ~/Data/PLUTONIA.WAD"
alias chocolate-doom-tnt="chocolate-doom -iwad ~/Data/TNT.WAD"


Now instead of using the -iwad argument and specifying the full file path, I can just append a bit to the end of the command, so 'chocolate-doom1' will launch chocolate-doom using the DOOM.WAD. Much more efficient.

Getting away from the first person shooter category for a bit, Astromenace(AUR) is an extremely addictive space-scrolling 3D spaceship shooter, that is open-source. It also features RPG elements, as you buy a spaceship (from a rather large selection), and set about custom-configuring it with various hardware components such as shields, power-sources, engines, and of course weaponry. You earn money at the end of each level, which you can spend on these things as well as hull-upgrades. The difficulty level is also very customizable, you aren't presented with a simple easy/medium/hard menu, you actually get to specify various game mechanics such as damage bonuses, armor bonuses, and the like. You can also speed up/slow down the game in play using the F5-F7 keys. It is extremely addictive, and took up a few days of my life, but it is by far the best native Linux game of its kind I have ever seen.

My only hesitation about Linux originally was having to sacrifice quality gaming time to gain all of Linux's other benefits, but thanks to an increase in the availability of native/ported games for Linux, and the truly fantastic work Wine's developers are doing, I may eventually be able to rid my HDD of that ugly NTFS partition for good.

Thursday, March 4, 2010

Halo & Doom 3 on Linux

First things first, I'm officially converted; Arch is my new OS. It truly is infinitely customizable as you build it from the ground up, and I'm loving every minute of it. Anyway...

Gaming has long-been the one thing tying me to Windows. Yes there are Linux games, but let's face it: there's no Linux equivalent for some of the great Windows games out there, such as Half-Life, Halo, Call of Duty, et cetera. WINE is a possible solution, but to be honest I've never had much luck with it. I managed to get Dreamweaver running in it a few years back, but haven't touched it since then. Several days ago I figure I'd give it another go and try to get Halo CE (the first one) running.

Initially I tried it on my laptop, with an ATI Radeon 3200HD chipset, however the open-source Radeon drivers weren't getting along too well with it. The opening videos worked (I didn't need to pass the --novideo argument), but when the game loaded as far as the initial menu screen... Well I'm not sure how to describe it. Suffice it to say it was pretty recognizably a graphics issue rather than a WINE issue.

At this point I decided that rather than fiddle around with building Catalyst from AUR on a 64-bit machine, I'd try it out on my desktop, which has a more powerful Nvidia card (9600GT) anyway. That worked like a charm. The proprietary Nvidia drivers are fantastic, almost to the point where I forgive Nvidia for making them proprietary, but not quite. The game will load in a window or fullscreen (depending on your wine settings or command line arguments) and play damn-near flawlessly, which is way more than I would expect from attempting to run a DirectX game on Linux.

There is also no need for a no-cd-crack, you can use the official executable. When you run the update program it will patch the game to the latest version (1.09 I believe), which eliminates the need to actually have the cd in your drive every time you want to play the game.

While on the subject of Linux Gaming, I feel obligated to mention there is a Doom III port that will run natively on Linux available from IDsoftware's FTP Server. There's also tons of other goodies on there so make sure to give those a glance as well. I personally installed the doom3 package available in the Arch User Repository, but I have used the version available on the FTP server before on Mint, Ubuntu, and Debian successfully.

Note that you will need to copy files pack000.pk4 through pack004.pk4 from the retail version to your Doom 3's base directory (there is a directory named 'base', I am not referring to Doom 3's root directory) on the Linux box in order for the game to work (What, did you think they were giving it out for free?). If you bought Doom 3 through Valve's Steam, the needed files will be in your ...\steamapps\common\doom 3\base folder, otherwise just search for files with a .pk4 extension via your favorite method. Now as for cd keys...

I bought (yes really, no warez here) Doom 3 via steam. When you launch it the first time it displays a cd key, which I'll call key-A. It also creates two files in your Program Files (x86)\Steam\steamapps\common\doom 3\base folder called doomkey and xpkey, both of which contained different keys, which I'll call key-B and key-C. All 3 keys are 16 characters, and when the Doom 3 port launches, it prompts you for a 16+2 digit key. So now I have three separate, and equally useless keys. I sent an e-mail to Steam's customer support asking for a new key, but I doubt they'll be scrambling to help out a Linux user, so I had to rely on a little MacGyver-ing to get Doom 3 running.

For some reason, id Software chose not to disable console access while the key prompt was up. Maybe this was intentional, maybe not, but either way it allows you to circumnavigate the key-verification process which is legal provided you have actually purchased the game and corresponding cd key. So when I launch Doom 3 on Arch, I am greeted with the rather annoying prompt. Then I just ~ into the console and 'map game/delta4' (or any other map for that matter), and it will set about loading that map, thus circumnavigating the buggy cdkey authorization prompt. It's a hack, but at least I can play Doom 3 on Linux now.

NOTE: This will not help you play the game without purchasing it. You will still need to supply the .pk4 files mentioned above from the purchased version in order to play, the method I have provided is merely a means of circumnavigating a process that can prevent legitimate Doom 3 owners who have legally purchased their copy of the game from playing it on Linux, which they are entitled to do as it does not violate the terms of the EULA.

id Software is the only game company I know of that actually ports their games to Linux, and makes the ports freely available for users who have already purchased the Windows version. As such, you should actually buy id Software's games and show your support for their actions. There is currently an ID Super Pack available on steam for $70, which is an unfathomable deal considering you get over 20 games including the DOOMs, Quakes, Hexens, Heretics, Wolfensteins, and more. And no I do not benefit in any way from you doing that. I just like to support companies that support me, and by porting their fantastic games to Linux, id Software has done just that.

UPDATE: April 10th 2010
Here's how to fix the cd-key issue. Copy the doomkey and xpkey files to your ~/.doom3/base directory. Special thanks to Filip Oščádal of www.mxd.cz for the solution.

Thursday, February 11, 2010

Roll Your Own

I've become quite the avid distro hopper over the past few months, not necessarily because I was looking for something a particular distro couldn't offer, but more out of an idle curiosity. I originally started my Linux journey with Mint 6, and since then have toyed around with various *buntu's, DSL, Puppy Linux, Knoppix, Backtrack, Debian, et cetera; They all had their own strengths and weaknesses. I've gotten to a point where I wanted to build my own distro, from the ground up, without having to actually make a distro... That is to say, I wanted a minimalist install with a light footprint like Puppy, with the stability of Debian, vast customization potential, and the availability of packages and a coherent package management system on par with aptitude and the Ubuntu repositories. It seems like a tall order until you consider Arch Linux.

Arch is a VERY minimalist install, to give you an idea of how minimalist I'm talking, it doesn't even come with sudo, openssh, python, or a GUI. It is absolutely perfect for older machines and package management is a breeze, but I'll get to that in a minute. The installer is very simple and straightforward, certainly one of the most simple CLI installs I've ever done. The installer pretty much configures the network for you, then asks which packages you'd like to install, then it further fine-tunes those categories allowing you to select individual packages for installation as opposed to hundreds of them that you will probably never use in a default Ubuntu install. After the install is done you do the obligatory restart and begin to configure the system to your liking using pacman, Arch's package manager.

Now I am very, very fond of my beloved apt, but pacman won me over. In keeping with Arch's philosophy of designed simplicity, it is just that: A very powerful, yet very simple and easy to use system. My second concern when initially trying Arch was that there may not be a large number of packages available. With Mint/*buntu I was never at loss for packages, the repositories had everything. Debian's repos were good as well, though due to their snail's-pace release cycle everything is hopelessly outdated. So far I have found everything I needed through pacman, and it is all bleeding-edge in terms of software-version. Arch is a rolling distro, meaning there are no main releases just one update after another. This rolling-release model, combined with the speed at which the packages are updated provides the most cutting-edge OS I have ever seen. When I installed Firefox from the repositories, it gave me version 3.6, some distros are still working off of the 3.0 series (I'm looking at you here Debian). Even the more obscure packages are unbelievably up-to-date such as d4l, et cetera.

Pacman also made installing gnome a breeze, and I quickly got media/networking set up as well. It's a little more command-line-kung-fu than I'm used to, but for the most part it was a really good learning experience. Some might consider this a detriment, but getting hands-on with configuration files, setting up xinit manually, and specifying which modules to load when, and what daemons to start on start-up gave me a whole new insight into the undercarriage of Linux, something I could never have seen with Mint/Ubuntu which makes everything very easily usable.

In short, after less than 12 hours of using Arch, I believe this will now become my distro of choice. I've been looking for this distro for years, I just never knew the name of it.

Thursday, February 4, 2010

Windows 7 & Debian Dual Boot

Quite a long day today. My school is enrolled in MSDNAA, which is basically free software from Microsoft, which as a CS student I am entitled to. So I woke up this morning, checked my student e-mail and read the account activation letter I'd received from them, and followed the link to their site where I discovered a venerable treasure trove of Microsoft software. Granted I wouldn't use most of it to save my life (the Office '07 suite is just indescribably horrendous) but also available for download was Windows 7. Now my Desktop is running Win7 so I've used it and despite my obligatory scorn for all things Microsoft, I have to admit it's the best OS they've ever put out. It's certainly better than Vista (from which there is nowhere to go but up). It's more stable than XP, and (obviously) more updated. Let's face it, XP's felt antiquated for quite some time.

What bothered me though was that you were not able to just download the .iso. You had to download an 'installer' (windows format .exe of course) which would download the file for you. I can't think of any reason for this other than to restrict the downloads to people already running a Windows operating system. At this point it doesn't get them any more customers, it certainly doesn't make them lose any, so why limit the availability of the software all students enrolled in the MSDNAA are entitled to based upon their current operating system? That would be like an electrician refusing to work on your house after you've already payed him because the wiring was put in by another company. It is an absurd ideology and quite frankly I don't see how consumers can tolerate it to the point where Microsoft's stock is selling at almost $30 a share.

I did wind up getting their pseudo-installer to run in wine, and then burned the iso all without ever having to leave backtrack, but it was still an unnecessary annoyance... But I digress. With the new Windows 7 (x64) disk in hand, I set about wiping my laptop clean and installing Windows. It went of without a hitch and everything's working fine. A rather rare occurrence. That being said, I only spent about 20 minutes in the OS until I had accepted one license agreement too many which, in turn, drove me to download and burn a Debian disk (Lenny main x64). I have never had a Linux install give me this many problems.

Apparently the kernel that Debian 5 ships with doesn't play nice on this particular build. For a distribution so well-known for stability, I was rather surprised. After an install that seemed to go off without a hitch, when I would boot into Debian it would hang on several different items. After 20 minutes I gave up, boot wasn't happening. At first I thought the install disk was faulty so I MD5'd it and compared it to the MD5 on Debian's site: they were identical. After two more installs with the same result I logged onto the IRC channel to see if anyone else had ever experienced this. After spending some time in #debian, the nice folks there pointed me to backports.org, where I was able to obtain a newer version of the kernel that worked with my box. Aside from a few minor hiccups that were later ironed out, I was now able to boot properly. After booting into the OS, it took me a while to figure out that the reason apt wasn't working properly was because I didn't have the right repositories in my /etc/apt/sources.list. After adding them, I went about configuring the OS. The wireless card works out of the box, but the network manager did not, so after creating a shell script that would launch netapplet, and throwing it in /etc/init.d/ that problem too is rectified.

The result of the day? Laptop wiped, dual boot with Windows 7 x64 and Debian 5 Lenny x64. I originally wanted to do a multi-boot with those OS's and BSD as well, but it's 10:00 and after spending about 8 hours doing this I simply don't have the energy. Maybe tomorrow If I get around to finishing all the other tech-stuff I need to do.

Sunday, January 3, 2010

Adventures in Linux-land

I've really outdone myself this time. So many modifications have been made to my home's technological components in the past week I barely know where to begin, so bear with me if this post seems to be an incongruous wasteland of disorganized thought, I'll try to organize it the best I can.

First off, new computer:
AMD Phenom II x4 965 @ 3.4ghz
8GB (4 2GB modules) of OCZ DDR3 RAM 2 (1600)
Integrated Radeon HD 3300 Graphics (for now)
500 Watt PSU
Optical Drive/HDD/Card Reader/other unexciting peripherals

Now I also modified the computer I had prior to this one to be a home media server of sorts. Specs here:
Pentium IV @ 2.8ghz
2GB DDR2 RAM (800)
80GB IDE Drive (yeah I know, but it's only for the OS)
1.5TB Sata drive in a hot swap in one of the 5.25" bays.
256MB DDR2 8400 GS Nvidia GPU
other uninteresting peripherals.

The Phenom II box I built by hand with a few of my friends. I literally put my own blood and sweat into this machine (pin on the motherboard stabbed me under my thumbnail). After the build, it wouldn't POST. It didn't keep resetting either it just wouldn't post. It just stood there, powered on, mocking me. I tried swapping out the PCI-E graphics card and running it off of integrated, still wouldn't POST. Tried reducing RAM to one measly stick, still nothing. We took it apart and put it back together again with the same results. Then when I got home I completely disassembled it and put it back together again (in various configurations) TWICE, and still nothing. It sucked, $700 for parts on a machine that won't boot, yet has nothing apparently wrong with it.

Next day, I took it to Microcenter, where we basically tried the same thing. Of course now that I'm there it works. The knowledge bar attendant told me the PCI-E graphics card was shot, and managed to get into BIOS while using the integrated graphics. While in BIOS we noticed that my RAM was set to 1066, "Not on my watch" he said and promptly adjusted it to 1600. For some reason the board defaulted to that. I haven't had any problems with this machine since then but am still troubled by one thing: That graphics card works fine. I plugged it into the P4 box and it runs fine. I'm watching it work right now! At this point I'm hoping it was just a compatibility issue between the card and the new motherboard rather than the motherboard's PCI-E just being shot. We tried both sockets on the board too...

A brief segue: For a while, my router's been giving me issues on dual-boot machines. All the computers with only Linux on them ran fine, but my laptop which had Linux Mint 8 and Vista would act... for lack of a better term, 'iffy'. I would have to reset my router every time I booted into Windows because I would get a local only connection with a "limited connectivity" error. I thought the problem was limited to the laptop until I got the new computer (the Phenom II box) which exhibited the same problem. Long story short, after fighting with my router for the better part of an hour I got it to take to a firmware upgrade which rectified the problem, as well as added many new features. The router went from being a rather persistent pain in my ass to one of the most efficient and streamlined routing systems I've ever used. Good work Trendnet, I forgive you now.

Now here's what I did after the router's hiccup was cured: Installed Linux Mint 8 Helena on the P4 box, copying over my /home/steve/.azureus directory from a previous installation so I could keep my statistics/settings/et cetera. I then installed a new copy of Vuze from their website, as the version in synaptic's repositories is hopelessly outdated. I also got apache2 and php5 (from synaptic). Now... here's where things get fun. I set Apache's document root to be /media, several directories above my 1.5TB's mount point. In the /media directory there are several php scripts and an html form that will prompt a user for a username and password before forwarding you to the 1.5TB's directory. This was designed to keep out anyone who had already broke through my router's WPA2 level security.

Although this seems like a task much better left to MySQL, I'm way more familiar with php and was feeling adventurous. So now the P4 is serving everything on the 1.5 TB drive via httpd. This is fantastic for the computer illiterate. Mint 8 ships with Firefox configured with various media plugins, so by clicking a link to a media file, it will seamlessly start playing in the browser. Neat parlor trick for the grandparents, huh? Because quite frankly, my recounting of how I jerry-rigged a php script ignoring all conventions of proper syntax etiquette would be lost on them.

Now that the server is up and accessible, I need a way of remotely adding new content. My first thought is 'remote-desktop', but somehow that seemed a bit too bulky (in terms of bandwidth) for my needs. All I needed was to point Vuze to new content. So believe it or not, I wound up using pidgin, an open-source and cross-platform instant messenger client. Pidgin comes with a plugin to auto-accept transfers from pre-determined screennames, so I set it up to auto-accept transfers from mine and add the files to /home/mint/Uploads. I also set Vuze to auto add new content from that directory which it scans every 60 seconds. So Voila! By sending a .torrent via an instant message file transfer, I can remotely add content to Vuze's queue. And yes, I do have remote-desktop enabled as well in case I need to do anything more intensive from afar.

Now it doesn't end there. Suppose I want to watch the media on my 1.5TB on a television? I can do that too. The 8400 GS that is in the P4 media server has s-video out... Yeah, we don't have HD... Anyway, So I can use the TV as a monitor and watch movies that way. I also have a 3.5mm headphone jack (standard audio out on a computer) to RCA audio converter (the red and white plugs for sound on older televisions), so sound is a go as well.

I'm working with VLC as the player at the moment though I would prefer Boxee. VLC is by no means a shoddy player. In fact it's fantastic, just not ideal for a home media box outputting video to CRT television. Boxee's UI is fantastic for this purpose, but sadly they have not released the beta yet, and the alpha relies on packages in Jaunty's repositories which are outdated/incompatible with Mint 8 which is based of of Karmic. Boxee paired with an ATI Remote Wonder provides a UI simple enough even the biggest tech-tards can navigate their way through it. Once Boxee's beta is released, I'm going to start building boxes that will run it on start up and browse to the 1.5TB, and connect them to every television in the house.

I've also stumbled upon a nifty little media player called Songbird. I'm quite impressed. It can play the .mp3's on my server as if they were a playlist. For example, If I point it to "domain.com/songs/artist/album/" it will play everything in that directory as if it were local content. It's also open-source and cross-platform which is always a plus in my book (as per my love affair with Azureus, Pidgin, Firefox, et cetera).

I think that about sums up the past week. Again, sorry for the mess.