Tutorial: How to install Chocolate Doom w/ sound on Raspbian


9 posts
by Johnyz » Fri Nov 02, 2012 9:40 pm
Hey everybody,
since there are quite a few articles about playing Doom using Chocolate Doom on Arch Linux, but none about Raspbian, I decided I'd write one! First, I have to warn you. Unlike Arch Linux, where you can install this software with the package manager, here we have to compile it, since it doesn't seem to be in the repositories yet.

First off, we need to prepare a folder for the source code. I have a folder called Sources in my home directory where I direct all my source code and compiling related needs. So, let's start by creating one:
Code: Select all
cd ~
mkdir Sources
cd Sources


Next, we will download the .tar.gz archive from SourceForge either with Midori or NetSurf or download it on your computer and use SSH to transfer it to the Sources folder:
http://downloads.sourceforge.net/project/chocolate-doom/chocolate-doom/1.7.0/chocolate-doom-1.7.0.tar.gz

Then unpack it, delete the archive and navigate into the new folder:
Code: Select all
tar -xvf chocolate-doom-1.7.0.tar.gz
rm chocolate-doom-1.7.0.tar.gz
cd chocolate-doom-1.7.0


Before we start configuring and compiling, we need to download a pretty huge list of packages, they are mainly SDL related so they should be useful to you on your next compiling adventures.
Code: Select all
sudo apt-get update
sudo apt-get install gcc build-essential libsdl1.2-dev libsdl1.2debian libsdl-image1.2 libsdl-image1.2-dev libsdl-mixer1.2 libsdl-mixer1.2-dev libsdl-net1.2 libsdl-net1.2-dev timidity


When everything is installed, we can finally run the configuration script.
Code: Select all
./configure

(NOTE: If this gives you an error, it is most likely due to a part of your compiling masquerade is missing. Try googling the error and you will most likely find what you need to apt-get in order to fix it.)

Finally, we can start compiling. This will take some time but not nearly as long as Q3A.
Code: Select all
make


After compiling finishes, we will install our new binaries with the followning command:
Code: Select all
sudo make install

NOTE: You need to run this using sudo or as root, because the installing script copies binaries, icons and .desktop files to the /usr/share folder. On the bright side, this means that everything gets neatly embedded in your LXDE menu. Due to the way chocolate-doom is launched this is a bit unneeded, but we will talk about that later (at least we have the icon).

To configure Chocolate Doom, you need to run the following command from the terminal:
Code: Select all
chocolate-setup

This will bring you up a nice DOS-looking window where you can configure our new software. Under display configuration, you can either choose the full screen, but if you have a Full HD LCD like me, I reccomend hitting A, disabling "Fix aspect ratio" and then selecting 1280x800, since it tends to be quite laggy on full 1920x1080. Hit the escape key to return to the original menu. Since there is no joystick to be configured, we will head right to the keyboard configuration. If you want controls similar to more modern FPS games, set Move Forward to W, Move Backward to S, Strafe Left to A, Strafe Right to D and you can set Turn Left to Q and Turn Right to E or whatever you like and leave Speed On on Shift and Strafe On on Alt. Press escape to return and you can skip the Mouse configuration, since everything there is set by default to the "average" levels. You can fiddle around there yourself later. Go to Sound configuration and make sure Sound Effects is set to Digital and that Music playback is set to Native MIDI. Once you checked that, return to the main menu and select Save parameters and launch DOOM. Now, since there are no WAD files yet, the game will not lauch but the settings will be saved.

Now, we need to get the WAD files. A little google search will tell you how to *cough* *cough* extract these files from your original Doom CD. Alternatively, you can use Doom 2, Ultimate Doom, TNT: Eviluion or Plutonia. Log into your Raspberry Pi through SSH as root (for example using WinSCP) and make create a folder called doom in /usr/share and put your doom.wad, doom2.wad, tnt.wad or plutonia.wad. I have tried Strife and Hexen as well, but for some strange reason they don't work for me.

Then you can finally start the game using the terminal with the following command:
Code: Select all
chocolate-doom -iwad /usr/share/(name of your file).wad


Congratulations! You have now got Doom running on your Raspberry Pi.


OPTIONAL: Create a WAD-specific launcher so you don't have to use the terminal all the time

Open up LeafPad and type the following text in:
Code: Select all
[Desktop Entry]
Name=Doom 1
Exec=chocolate-doom -iwad /usr/share/doom/doom.wad
Icon=chocolate-doom
Type=Application
Comment=Conservative Doom source port. Loaded with a Doom1 WAD.
Categories=Game;ActionGame;

And save it on your desktop as doom1.desktop. The exact name doesn't really matter, since the name specified inside the file is the one getting displayed. Bang, you got your easy desktop launcher for Doom. Can you even ask for more? Well... Of course you can. Let me introduce you to the:

OPTIONAL 2: Create a laucher for multiple kinds of Doom using Zenity

So, let's say you happen to own both Doom 1, Doom 2, and on top of it you also own TNT and Plutonia. And you don't want to have four different icons. Then let us create a launcher with all these options! Using a little inspiration from the ever-popular Python Games, we will make ourselves a nice little menu using Zenity. Open up LeafPad, or, if you have it, Geany and paste the following script there:
Code: Select all
#!/bin/sh

RET=0
GAME=$(zenity --list --width=350 --height=250 --radiolist --title="Choose your game" --column "Select" --column="Game" TRUE "Doom 1/Ultimate Doom" FALSE "Doom 2" FALSE "TNT: Evilution" FALSE "The Plutonia Experiment"  )
RET=$?
echo $GAME
if [ "$GAME" = "Doom 1/Ultimate Doom" ]; then
   chocolate-doom -iwad /usr/share/doom/doom.wad
elif [ "$GAME" = "Doom 2" ]; then
   chocolate-doom -iwad /usr/share/doom/doom2.wad
elif [ "$GAME" = "TNT: Evilution" ]; then
   chocolate-doom -iwad /usr/share/doom/tnt.wad
elif [ "$GAME" = "The Plutonia Experiment" ]; then
   chocolate-doom -iwad /usr/share/doom/plutonia.wad
else
   echo "Cancelled..."
fi

And save it somewhere nice, like your home folder, under the name chocolate-doom-launcher (without the extension). Open up terminal, navigate to the file you just saved and issue these two commands:
Code: Select all
chmod +x chocolate-doom-launcher
sudo cp chocolate-doom-launcher /usr/bin

From now on, you have a new terminal command that brings up a nice little launcher for all your Doom related business. Now let's turn it into a pretty little icon, shall we? For the last time, open LeafPad or Geany and create a new file and paste this into it:
Code: Select all
[Desktop Entry]
Name=Chocolate Doom Launcher
Exec=chocolate-doom-launcher
Icon=chocolate-doom
Type=Application
Comment=One launcher for all Doom realted games.
Categories=Game

And save it on your desktop as chocolate-doom-launcher.desktop. If you want this launcher to appear in your menu as well, open up terminal for the last time and type in these two commands:
Code: Select all
cd ~/Desktop
sudo cp chocolate-doom-launcher.desktop /usr/share/applications


And that's it. You now have a fully working, configured installation of Chocolate Doom 1.7.0 with working MIDI sound thru Timidity, with a launcher for different games both on your desktop and in your applications menu. Time to give yourself a pat on the back, and go play some Doom! :arrow: Enjoy!

Sources of some information used: viewtopic.php?p=83495 http://www.sparkfun.com/tutorials/372
Posts: 3
Joined: Fri Nov 02, 2012 7:40 pm
by billb » Sat Nov 03, 2012 12:24 am
Excellent tutorial -- very well written. Thanks!

I've noticed you can run it straight from the terminal as well (without launching X), as long as you choose an 8-bit video mode in chocolate-setup. Hard to tell what resolution its actually running at, though my terminal is at 1920x1080 when I launch it.

And I see timidity launching at startup every time now, using a small amount of memory and no CPU time. Not really a concern for me with a 512MB Pi.
User avatar
Posts: 172
Joined: Wed Sep 19, 2012 10:27 pm
by Johnyz » Sat Nov 03, 2012 9:21 am
Thanks the heads up about running without X! I didn't know that. Timidity launches because it is used to play back the music, beacause we selected it during installation. You can also select the OPL AdLib emulation (I just verified that works too), but the music is pretty quiet even at max volume, plus MIDI offers better quality as well.
Posts: 3
Joined: Fri Nov 02, 2012 7:40 pm
by LeSanglier » Sun Jan 20, 2013 8:12 pm
Thank you Johnyz !
I can now play Doom on my Raspberry Pi !! :D
Geek Inside ! :D
Posts: 100
Joined: Fri Jan 11, 2013 8:11 pm
Location: Longwy (54400)
by UsefulDoor » Sun Jan 20, 2013 10:37 pm
How do you use SSH to transfer it to the Sources folder?
Posts: 5
Joined: Sun Jan 20, 2013 7:29 am
by LeSanglier » Mon Jan 21, 2013 9:24 am
From a linux computer that has all .wad :

[~] ➔ cd JEUX/DOOM/Wads
[~/JEUX/DOOM/Wads] ➔ ls
doom2.wad doom.wad heretic.wad hexen.wad prboom.cfg tnt31.wad tranmap.dat
doomu.wad freedoom.wad hexdd.wad plutonia.wad prboom.wad tnt.wad
[~/JEUX/DOOM/Wads] ➔ scp *wad pi@192.168.1.100:/home/pi/JEUX/DOOM/Doom

192.168.1.100 : the ip address of the raspberry pi
/home/pi/JEUX/DOOM/Doom : The directory on the raspberry pi where they will have wads
Geek Inside ! :D
Posts: 100
Joined: Fri Jan 11, 2013 8:11 pm
Location: Longwy (54400)
by 6677 » Tue Jan 22, 2013 3:58 pm
How this did not turn up when I was searching for how to get doom on the pi will forever be beyond me.


As for hexen not working. Hexen used a slightly updated form of the engine. Chocolate doom aims to be near identical to the original doom engine including original bugs. It doesnt support the extra hexen extensions. You need the raven branch of chocolate doom for that to work: http://www.chocolate-doom.org/wiki/inde ... ven-branch
Posts: 222
Joined: Wed Mar 14, 2012 9:23 pm
by QBall1977 » Tue Mar 12, 2013 6:12 am
Brilliant,

Thanks for the tutorial, well written, executed and thought out. You should do more.

:D :D :D :D :D

A DOOM is now over 7 years old has it not fallen out of copyright? I think the Carmack et al would approve of this approach.
____________________________________________
Looking for where to start - try Kernel Panic - http://goo.gl/EEQ5J
Posts: 22
Joined: Thu Aug 09, 2012 10:06 am
Location: Hull, East Yorkshire
by CerialPhreak » Wed Mar 13, 2013 1:46 am
I'm going to try to add this to EmulationStation. I haven't installed yet, but will I be able to configure Chocolate to use my usb gamepad?
Posts: 1
Joined: Sun Mar 10, 2013 7:47 pm