Thread: Linux Guide
View Single Post
Old December 16th, 2007   #1 (permalink)
theMADscientist
Registered User
 
Join Date: Nov 2007
Location: US
Posts: 9
Linux Guide

Basically, this is a guide to help people that want to try pcsx2 on Linux. I'm using Ubuntu 7.10, so most of the examples will be specific for that, but I'll try to make it useful to everyone and thus long. Hopefully, this will cut down on the same Linux questions that seem to appear over and over.

1. Installing Linux and warnings to Linux newbies.
You can read up on how to install the version of Linux you are using on that versions website. Please read all the important information. The easiest and safest way to install for dual boot(having Linux and Windows on the same box) is a separate harddrive for Linux that windows won't see. Even if you do install it on a separate hard most Linux's will by default install a boot loader to your system. This is potential dangerous as the bootloaders can destroy the partisan table of NTFS drives(yes it really does happen). The data may still be accessible in Linux if this does happen but not in windows. So make sure you find that boot loader option and don't let it touch your NTFS drive. I mention this because it is a default behavior of Ubuntu =/. Also, don't use that NTFS drive repartition thing, it also can cause data loss. Yup Linux isn't 100% safe, but if you read all the material you'll probably be okay.

2. Update Your System.
You should probably update your system first. If you have Ubuntu do this, if not do whatever you need to update your system after install. Check your Linux's forum if need be.

Click System> Administration> Synaptic Package Manager. Enter your password. Mark all Upgrades. Apply. Wait a long time...(depending how much you have to upgrade). System> Quit> Restart(If it doesn't ask you to restart you don't need to, duh).

System> Administration> Update Manager> Check> Upgrade(not necessarily needed and might not be a good idea if the upgrade is an unstable version). Close. Start Upgrade. Wait some more...Remove Obsolete if you want. Restart.

3. Installing Graphics Card Drivers.
Please do not use beta drivers! I will not post answers on how to uninstall and reinstall the proper drivers. Read the forum for your Linux for posts on how to install the default drivers for your graphics card.

In Ubuntu, you can install the default graphics drivers for your card very easily. Click System> Administration> Restricted Drivers Manager. If you don't see Restricted Drivers Manager, search the Ubuntu forum for how to add it(I forget, something like Application> Add\Remove yada-yada). Find something that looks like graphics card drivers and Click Enable. Restart. Now you should be able to set your screen resolution correctly. But that can be a long process sometimes. So here's a link...
https://help.ubuntu.com/community/Fi...esolutionHowto

4. Download the libraries required to compile pcsx2.
Yeah even more steps. You need the following libraries to compile pcsx2(some might be repeats):
gtk2
opengl
libbz2
libjpeg
glew-dev
libxxf86vm-dev
x11proto-xf86vidmode
automake and autoconf (verion >= 1.9)
Nvidia Cg-Toolkit (Cg Toolkit 1.5)
libasound-dev
joystick
libbz2-dev
subversion
libjpeg62-dev
build-essential
libgtk2.0-dev
libxxf86vm-dev
x11proto-xf86vidmode-dev
libSDL-dev
libglu1-mesa-dev

This command will download and install most of the packages. Apt-get isn't used in all Linux es, almost all though. You may or may not need sudo or su.

sudo apt-get install subversion libjpeg62-dev build-essential libgtk2.0-dev libxxf86vm-dev x11proto-xf86vidmode-dev automake libbz2-dev libSDL-dev joystick libasound-dev autoconf libglew-dev

Probably not required but some people thinks it is...
sudo apt-get install libglu1-mesa-dev

You also need these libraries, but they may have got installed already when installing the other stuff:
gtk2 opengl libjpeg

Now finally for Nvidia Cg-Toolkit (Cg Toolkit 1.5). Some Linuxes will be able to use apt-get again, some won't.
If you use this command make sure its version 1.5:
sudo apt-get install nvidia-cg-toolkit

If that doesn't work. Go to Nvidia find the the link that matches your system the best. 64-bit Linux = 86-64, 32-bit = 86 (yeah I'm sure there is someone who couldn't figure that out). There are TAR.GZ files and RPM files. If your Linuxes doesn't support RPM you can use the alien package, if that's what you want to do. Don't do the following if the above command worked.

sudo apt-get install alien
Download the rpm somewhere where you can find it. Use the rpm that you downloaded instead of the one I used.
sudo alien -i ./Cg-1.5_Sep2007.i386.rpm

5. Download the svn's latest copy of pcsx2.

This command makes a directory called pcsx2 and downloads the svn copy there. If you change the last pcsx2 of the line it'll download there instead.

svn co https://pcsx2.svn.sourceforge.net/svnroot/pcsx2 pcsx2

You may need to add sudo or su in front of the command and check the permissions of the directory you are using it from. If you don't have write permission it'll fail.

6. Compile
There are some options and stuff, but more on that later. Assuming you downloaded it to pcsx2

cd pcsx2
sudo sh ./build.sh all


This will build the pcsx2 file and make it belong to the "super user" and have those permissions. Some people are opposed to that cause its a security risk, so if you want you can also do this:


cd pcsx2
sh ./build.sh all

This will create permission problems for most versions of Linux so you'll need to use chmod.
cd bin
chmod 770 ./*

Yes, this is a lazy approach and makes some stuff that shouldn't be executable executable. But it doesn't really bother me, if it bothers you change it.
You may also need to change the permissions on the plugins(I just can't remember if I had to do this or not). If the plugins aren't read/write you'll have problems running or replacing them when recompiling.
cd plugins
chmod 660 ./*


If it ends with "Nothing to be done for 'install-data-am'... and some other stuff. That means everything went well. If not don't panic sometimes changes in the SVN make it so that it won't compile. Usually it fails on a plugin. So you can find the plugin that failed in the plugins directory. Add "exit 0"(no quotes) to the second line of the build.sh file for that plugin(Don't forget to remove it later so it will compile).

After you have compiled it once you can use the install command to compile new svn changed quickly. The install command doesn't recompile unless there is an updated file from the last time a compile happened.

sudo sh ./build.sh install

There is also the clean command. It deletes the old *.so and *.o files. There isn't much reason to use this unless you have reason to believe that an old compilation is messing up the new compile(should be impossible but I guess typos happen ?). Basically no reason to use this.

sudo sh ./build.sh clean

There are some other settings too. You can read about the various different settings in the pcsx2\INSTALL file. I'll add details on the other options later.

7. Setting Up
Ok, you finally got it to compile. You probably shouldn't move pcsx2 from where its compiled to cause it'll just slow you down with updating the svns later on. It should compile to pcsx2\bin\ assuming you saved the svn to pcsx2. First add your bios to pcsx2\bin\bios\. Now run \pcsx2\bin\pcsx2. It should complain that it needs to be configured. Change the plugins directory first, if you don't it'll just close down whenever it tries to save data for some reason. It will also close down if the permissions are wrong for the directories. Typically pcsx2 runs as root or SU and everything goes fine. But on some Linuxes that won't work right. So you may have to make all the directories in the bin directory read/write(7 will work fine) for whatever user you are, highly unlikely that this is your problem. Ok so set up the various plugins as you want them to be.

If you want to read ISOs from a NTFS drive or any other drive in linux don't forget to mount the drive before you start. Then select the file on that drive with one of the ISO CDVD plugins. You'll have to mount the drive again each time you umount it or restart your computer. Don't try use memcards on the NTFS drive. Writing to NTFS drives from a linux can end badly...

8. Random Bug fixes


Pcsx2 closes after I try to save anything in the Configuration window.
-Check the permissions on the directories and try selecting the plugins folder first. Also, don't move the plugins folder so that it is in a different directory than the pcsx2 and the inis folder.

Pcsx2 doesn't save my options and it won't work with the memory cards.
-Don't remember the solution, but I got around this. Try downloading the svn to another folder and compiling and running it there.

PCSX2 crashes every time I try to start it. I use the ISO and bios in Windows, so I know their good.
-If it every worked. Try downloading it again in a new directory and recompiling it, and don't change any of the default options.
-If it never worked. It might be your graphics drivers, bios, ISO. Try reading the logs and figure out why its crashing. Also, make sure that the logs are actually new logs.


The screen is black and freezes up and I have to use end process to close it.
-Various different bugs, I forget the solution. Will change this later.

There are weird black shapes instead of enemies.
-If I find out how to fix this all add it to here later.

The sound is messed up. It plays some of the time, but not all of the time.
-If I find out how to fix this all add it to here later.

The sound doesn't play at all.
-Make sure that your sound card is working on your Linux.
-Try using another sound plugin.


It's slow.
-It happens. And optimization tricks are mentioned in other threads.
-The only thing about this that relates to Linux is recompiling with different options for the most part.


My 64-bit Linux is slower than my 32-bit Windows.
-The 64-bit optimization for pcsx2 isn't done yet.

I can't use GSDX9 or GSDX10.
-You can only use openGL plugins for the most part. Wine would allow you to run directX ones, but that'd be slow if it'd even worked.

I can't see the console
-If you run the program from the terminal and have the enable console option set, it should display the normal console stuff in the terminal.


It says that I have SSE3 in the cpu config window, but when I run it the emulog says SSE3 not detected
-Recompile with the --enable-sse3 option seems to work. The first time I tried that it didn't though, so maybe I did something else to fix this.

Last edited by theMADscientist; December 16th, 2007 at 22:57..
theMADscientist is offline   Reply With Quote

Advertisement [Remove Advertisement]