Showing posts with label how to. Show all posts
Showing posts with label how to. Show all posts

Thursday, January 31, 2013

Nvidia and Debian Squeeze

So, using the Raspberry Pi as my Linux machine has spoiled me.  Because every RPi is the same there aren't the Driver issues that Linux often has.  If you have the drivers for one Raspberry Pi, you have them all (though the problem sometimes rears it's head with peripherals like wifi and bluetooth cards, you can avoid it by going to the Verified Peripherals page and selecting one known to work.

But blaming Linux for the lack of driver support is unfair.  It's not Linux fault that most parts manufacturers don't support Linux or won't even give the devs the info they need to support it.  It's amazing we have the support that we do have, and full credit to those masked men and women who spend hours trying (and mostly succeeding) to backwards engineer drivers for us.  Thank-you.  We've come a long way in the last 20 years.  However the sad truth is that drivers still cause issues, more often with laptops where you can't swap out video, wireless, or bluetooth cards that don't work (the main offenders).

Modern video cards are especially tricky to write drivers for, because they're just so complex.  In Nvidia's defence, they do release some closed source drivers for Linux (they got it half right), but it's not very high on their list of priorities, and support often breaks when the kernel is updated.  I'd tried all the methods on the official Debian wiki to try and get them working on Debian Squeeze (the stable, safe version of Debian)1.  No joy.  I googled for tutorials, followed them, still no joy.  As soon as they were installed I lost my graphical user interface.  If this happens to you the following command is your friend.  It will stop the computer using the (non-working) nvidia drivers by renaming the xorg.conf file.

cd /etc/X11/
mv xorg.conf xorg.conf.nvidia

Though I recommend making a copy of the original xorg.conf file before you start messing around with the image drivers, and then you can just (as root in recovery mode) move it back into the cd /etc/X11/ directory if something goes wrong.

cd into the folder where you saved the copy (with a sensibile name like xorg.conf.backup).  The ls command is helpful here, as it lists the contents of your current folder (the names of other folders will be in blue).  cd .. will make you go up a level.  When you're in the folder where you saved the backup type:


mv xorg.conf.backup /etc/X11/xorg.conf


Though even with the above knowledge this can be a risky business, and I recommend backing up everything before trying installing any new drivers.  Actually, I am assuming you know you have and nvidia card before coming here, you can check by typing:

lspci

My video card results look like this:


02:00.0 VGA compatible controller: nVidia Corporation GT216 [GeForce GT 320M] (rev a2)

If you don't have an nVidia card you will need to look somewhere else.  I recommend a google using the linux distribution you are using (in this case Debian Squeeze) and the name of the card (in my case GeForce 320M).  Good-luck.  For those of you who do have an nVidia card, let's continue :).


Firstly you will need to add the following repositories (where the software comes from) to your sources:
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
deb-src http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
deb http://ftp.debian.org/debian/ squeeze main contrib non-free


sudo gedit /etc/apt/sources.list

Then copy and paste the green writing into gedit, and save the file.

Install the following programs, and follow the instructions (click yes when asked a question)

apt-get install -t squeeze-backports dkms nvidia-kernel-dkms

Then you will need to run them with:

dpkg-reconfigure nvidia-kernal-dkms

Nearly there.  The next step is to update the xorg.conf file so that it says to use the new drivers.


sudo gedit /etc/X11/xorg.conf

You may need to change the Device Section so that it reads:

Section "Device"
    Identifier     "Video Card"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"

Finally you will need to add a Module Section just before it:

Section "Module"
    Load        "glx"
EndSection

The final step is to reboot.  If you come come up with the black screen, then it means to nVidia driver install didn't work.  Just press CTRL+ALT+DEL and when you reboot choose the recovery version.  Enter you root password (you'll need to be root to make changes to the /etc/X11 folder) and follow the instructions for saving your xorg.conf.backup file as xorg.conf.  Hopefully, though, you get that interesting nVidia eye looking at you.  Good-luck!

1    Debian squeeze is the big brother of Raspbian, and so familiar to my fellow Raspberry Pi users.  This is why I chose it, though to be honest Xubuntu (a child of Debian) would be just as good a choice, and even runs the same Desktop (XFCE) and so may be a better choice for my fellow noobs.  This tutorial should work in Ubuntu as well.

Sunday, November 4, 2012

Gaaaaaaaaaaaaaaaames!


Now for the pretty pictures.  Well, a little less pretty now we're used to high definition gaming, but what they lack in pixels they make up for in gameplay.  Plus they're fun.  I like the dry wit present in many of these games.  Tasty.

ScummVM

Also relatively painless to install:
apt-get install scummvm

Sound
But sound can be an issue if you're using HDMI.  If I haven't mentioned it before (sorry) you should force your Pi to use HDMI for sound if you can (ie aren't using a composite screen / analogue sound out).  To do so open the config.txt file located in the boot folder.  You will need to be a super user to save it, and so the easiest way is to open it in terminal:
sudo leafpad /boot/config.txt
or, if you've shelled in like I taught you a couple of posts back you will (for now) need to use a command-line text editor:
sudo nano /boot/config.txt
And 'uncomment' the line:
#hdmi_drive=2
Easy, peasy, just remove the hash - #.
hdmi_drive=2
Then save the file and reboot.  Sound sorted.  Remember to change it back if you want to go back to using the sound out port.

Now you are ready to open up ScummVM (in your Games folder in the Programs menu - press the Windows Key, or click the square in the bottom left corner, go up to the Games folder, and go from there).  You should see the bright yellow ScummVM screen.  Click the 'Options' button and tick the checkbox for fullscreen mode.

Now to add the games (ScummVM, like Gargoyle, is just the engine used to open and play games).  If you've used ScummVM before then you're set.  This is the same no matter whether you're using Windows, Linux, Mac, or some unholy hybrid.  If you already own the game you can just copy the files across from your CD or floppy to your hard disk. Click 'Add Game,' from within ScummVM, select the game file, and add it and you're ready to go.    Detailed instructions on buying the games legally can be found on the official ScummVM website.  You can grab Beneath a Steel Sky free from the repositories:
apt-get install beneath-a-steel-sky
And it will either open directly, or you can add it to ScummVM.  It is in "/usr/games/sky".

 Now for the final step - stay up all night reliving (or creating) awesome childhood memories.   And remember...
 



Now What - Old School Gaming

The Raspberry Pi is good for so much more than watching the movies and tv shows you've recorded though. I love being able to use my computer from my couch, and here are some of the things I've been up to.

Games

Old school style. No, that doesn't mean Doom - Before that, a long way before. I was born in 1978, so grew up with text adventures (though not as many as I'd like) and point-and-click adventure games (ditto). Actually, though I played them at school occasionally, and was totally obsessed with a couple of Infocom games my mother bought me, it wasn't until I 'rediscovered' them as a teenager (in the bargain bin in game shops) that I really got into these games.  Coming back to them yet again, in my 30s, they still hold up remarkably well.

Text Adventures / Interactive Fiction

Gargoyle was easy. Just type:
sudo apt-get install gargoyle-free
into the command line. After that you will need to run it (gargoyle from the command line, or there will be a link in your your programs bar, under 'Games').

Gargoyle is a front end for text adventure formats (just like XArchiver is a front end Archiving tools). It plays:
  • TADS games (a newer format for amateur writers,
  • Z formats z3 - z8 (Infocom, also popular with the new IF (interactive fiction) breed),
  • SAGA (Scott Adams Grand Adventure)
  • Level 9
  • Magnetic Scrolls
  • A heap of others.
Chances are, though, if I haven't piqued your interest by now you should just jump down to the adventure games section (or skip this post altogether if, immersive, story based gameplay isn't your thing) :p.

There was a bit of chatter on the forums about Zork.  Yes, gargoyle will play it (it's in the z-code formate).  Now that it's been released into the wild it's easy to source too:
http://ifdb.tads.org/search?searchfor=zork&searchgo=Search+Games
Just download the files from the Interactive Fiction archive.  Make sure you grab the z-machine files.  When you can either click on the name of the game you want to play, and choose to open it in Gargoyle.  I recommend ticking checkbox to always open those kinds of files in Gargoyle, so that in future all you need to do is double click on the game file.  Though opening a game from within Gargoyle is also easy.

The IF database is a good place to go for games.  You won't be able to find copies of other old favourites from the commercial realms because, while they're not still in 'print' (more's the pity) they are still covered by copyright and haven't been released by their makers.  You may be lucky like me and be able to grab a few from ebay, or source them elsewhere.  You can read details about the game on the archive, but you can't download it.

What the archive does well, though, is make the great output of 'amateur' IF writers available to play.  Though many of these writers are only 'amateur' in that they never got paid.  The four and five star games are at least as high in content, quality, and polish as the games of yore, and many of the 3 star games are also great fun (if a little lacking in polish).  Look through the lists, or do a more detailed search if you're looking for a certain type of game.  Heck, you can even start your own list, or get recommendations based on other games you like - just look down the bottom of the game description.

If you're new to all this (good on you for stretching your horizons) or it's been a while I highly recommend a play through of The Dreamhold by Andrew Plotkin.  It's an engaging game, lots of fun, and it has an 'adaptive' tutorial (ie the tutorial can read the info about how you've played the game so far and give you hints based on that.  Feel free to type 'help' at any time to get more info though.

Hopefully that's enough (too much???) to get you started.  Now, on to the pretty pictures.

I've decided to split these posts up, as I may have waffled on a little too much to include them both in the one update.