(2-1-01 Note: This was originally written in July, 1999. Much of it is out of date, especialy since 3Dfx has gone out of business! Pretty much all the links
which go to www.3dfx.com don't work anymore. The best place I can find for the Glide packages are at http://www.rpmfind.net/linux/RPM/. At least you can get the Glide lib there and install it with little pain.
Another very interesting site is http://sourceforge.net/projects/glide/ which is the development site for,
apparently, an open-source flavor (or could be the same as production) Glide lib.)
This is an attempt to show how (in theory) one could use their 3dfx card to use some OpenGL based end product like Quake 3 Test
under Linux. Notice, Q3T has a problem with it's default configuration which makes it not work 'out-of-the-box' (as of version
1.05), so replace the config file with the one below. I'll be assuming that you have a Voodoo3 (this may work with a Banshee as
well), and a semi-recient Linux installation with access to the usual tools.
Get and install the packages:
Priority for getting things working:
BTW-Tv out works while in 3D rendering mode! Use the lm-sensors
package to control the BT869 on your Voodoo3. You need to change your 640x480 and 800x600 modes (for US NTSC) to:
ModeLine "640x480NTSC" 28.195793 640 656 658 784 480 520 525 600
ModeLine "800x600NTSC" 38.769241 800 812 814 880 600 646 649 735
HINTS:
People are able to get Q3T working by doing the following:
Setting in_dgamouse to "0" (in the config file)
Setting the enviroment variable 'MESA_GFX_FX' to 'f'
Choosing the Mesa lib with Glide support (by doing something like './linuxquake3 +set r_glDriver
/usr/src/Mesa-3.1/lib/libMesaGL.so')
Optionally, to turn on the optimal caching method for the Voodoo's (well, for video cards in general) by doing
something like: 'echo "base=0xXX000000 size=0x1000000 type=write-combining" > /proc/mtrr' (replace X's with the proper
values of the Prefetchable 32 bit memory for the video card)
Follow up: Here's a q3config.cfg which worked. (Thanks to Martijn de
Meulde)
More follow up: I just confirmed that the config file above works! Be sure to change some of the preferences (like player
name).
Update on the AMD issue:
(The AMD issue is out of date, and has been removed because it is no longer a problem.)
CPU usage fix. Q3T 1.05 and older had a problem with doing spin-waits, this version of the linuxquake3 app solves this. (Don't ask where it
came from... ;') Now, finally CPU usage drops down to about %20 (depending on the CPU, I suppose).
Enabling 'Bots': Well, it can be done on the Windoze version (using a 'patch' written by YoGrE [who has been giving
me tips and tricks to try for the Linux version]), but at least one vital library function for generating the 'nav' maps
is left undefined in both versions 1.03 and 1.05 for Linux. The best possible solution (as of the time of this writing
[6/26/99]) is to use a nav file generated from the Windoze patched version (like the one here for the Q3TEST1 map), and then try to use the 'bot' command to use
it. Here's how to 'patch' your qagamei386.so to enable bots:
Do this first. This unzips the pak and puts the contents in a
directory named 'baseq3'. If you've already done this, then skip this step. (BTW- You may need to copy maps/q3test1.bsp to
maps/Q3TEST1.bsp. There is some weird case-sensitive problems that can arise. Same goes for the Nav file.)
Duplicate qagamei386.so (for backup reasons)
Get a nav file for the map, like the one here. This is a .nav file created by the
Window's version of the bots patch which has the benefit of using the 'nav gen' console command missing for the Linux release.
Use a hexeditor (like hexedit) to change the 16 bytes starting at
offset 0x242A0 from
E8 1F 38 FE FF 83 C4 0C 85 C0 75 08 E8 53 37 FE
to
E8 23 94 FE FF 83 C4 0C 85 C0 90 90 E8 5B 9E FE
Then, use the 'bot' command like normal.
One catch to this is that the nav map is loaded every time the bot command is used. This can cause q3t to run out of memory if
you spawn a lot of bots. BTW- There are some rumblings that a new version of Q3T is going to be released soon and it may have
bots enabled.
Known Issues:
AMD machines (just those with '3DNow' support?) had problems getting even the glide tests to run. The 'fix' is to tell
Glide to not use the 3Dnow! instructions. Do this by setting the environment variable FX_CPU to "5". (Notice: The current
version of glide does not have the problem. Don't do this 'fix' unless you experience problems.)
ALSA sound drivers get locked-up after running Q3T once (/dev/dsp reports always being busy). Apparently, this is a known
bug in Alsa (not Q3T) and has since been fixed in the latest (CVS) version of the Alsa drivers. The problem has something to
do with the way some programs (like Q3T) directly DMA map audio to /dev/dsp. I haven't tested to see if using the latest Alsa
fixes this, but it sounds like it does.
Some have reported some build problems with the 3dfx.o module. I don't think you need 3dfx.o to play as root,
but if you need it, make sure that you read the building instructions and get certain flags correct (like -D__SMP__)
included when you need them. I didn't have any troubles building after reading the docs. Update: Daryll changed the way
the module builds, so read the docs. Also note that the 3dfx module does some optimization [like MTRR stuff] which can help
performance for root as well as for users.
Mesa on Redhat 6.0 might give people problems. If so, Jason McMullan (jmcc@ontv.com) suggests building using the "i386-glibc20-linux-gcc"
gcc. Or downloading the RedHat RPM package with 3Dfx support. Also check Daryll's page for
builds specific to glib2.1 and RH6.
Color allocation for 8-bit apps report 'color allocation failed' errors, even when running in 16-bit or better. I've
experienced this first hand, but wasn't able to pin it down from talking with Daryll, app developers, nor the X86Free team.
This probably requires some code sniffing by a third party to verify and fix the problem.
MTRR magic (a speed optimization):
Phil DeBecker (debecker@NO.SPAM.iglou.com) write:
[...] All that /dev/3dfx (the device entry for the 3dfx.o module)
does is allow you to remap the board's memory into user space so that
you can be a non-root user and access it.
If you want to set an MTRR write-combining entry for your V3, cat your
/proc/pci and look for the 3dfx entry. Mine looks like:
Bus 1, device 0, function 0:
VGA compatible controller: 3Dfx Unknown device (rev 1).
Vendor id=121a. Device id=5.
Fast devsel. Fast back-to-back capable. IRQ 11.
Non-prefetchable 32 bit memory at 0xf6000000 [0xf6000000].
Prefetchable 32 bit memory at 0xfc000000 [0xfc000008].
I/O at 0x9000 [0x9001].
(this is an AGP V3-3000 but it still gets a /proc/pci entry)
You want to use the prefetchable range; assuming your memory ranges are
like mine, you'd enter the following:
echo "base=0xfc000000 size=0x1000000 type=write-combining" > /proc/mtrr
This will yield (in /proc/mtrr):
reg00: base=0x00000000 ( 0MB), size= 128MB: write-back, count=1
reg01: base=0xfc000000 (4032MB), size= 16MB: write-combining, count=1
There is a noticeable speedup in small polygon rendering when you do this :)
For relative MTRR acceleration results, check out Bucciarelli's page here. I got roughly the same percentage increases for
these same tests with my Voodoo3 as he did for his Voodoo2 on his page.
This is a chart I made from my results of my Voodoo3 compaired to David Bucciarelli's
Voodoo2 using the same tests.
Other speed optimizations (over clocking and such). People are still experimenting and discovering things, but
here's what I know so far:
Overclocking or other 'hacks' can do bad things to your card. Do so at your own risk and know that you are probably
voiding the warranty (how would they know? I dunno, but you want to be a _good_ person, don't you?) Odds are that if you
didn't notice an improvement of the MTRR 'hack', then overclocking is probably going to do your hardware more harm than do you
good.
Hey, just cool it buddy! The card gets hot. Put a fan on it. If you really want to have fun, put a fan on it
and sandwich a Peltier between the chip and heatsink. Here's Peltier How-to I wrote after
playing with a couple Peltiers I ordered..
If the card 'hangs' during 3D, then it is getting too hot. If this happens without a fan and without overclocking,
then take the card back to the store where you bought it as a defective product. People are reporting this happening, and
3Dfx says to return it if this is the case.
Play with the environment variables. This is where people haven't had much luck, but head on over to this nice site which has some nice info, and looks nice,
too.
I did some 'poking around' and discovered these (environment?) variables:
IFX_GLIDE_NUM_TMU
FX_GLIDE_BOUNDS_CHECK
FX_GLIDE_NO_SPLASH
FX_GLIDE_SHAMELESS_PLUG
FX_GLIDE_IGNORE_REOPEN
FX_GLIDE_NO_DITHER_SUB
FX_GLIDE_LOD_DITHER
FX_GLIDE_ALLOC_COLOR
FX_GLIDE_TMU_MEMSIZE
FX_GLIDE_ALLOC_AUX
FX_GLIDE_LWM
FX_GLIDE_SWAPINTERVAL
FX_SNAPSHOT
SSTH3_RGAMMA
SSTH3_GGAMMA
SSTH3_BGAMMA
FX_CPU
FX_GLIDE_EMUL_RUSH
FX_GLIDE_BUMP
FX_GLIDE_BUMPSIZE
FX_GLIDE_GRXCLK
Other items of interest:
Another Voodoo3 How-to aimed at
Newbies.
Yet another V3 howto this time aimed at
Suse users. Very well organized and has different doc formats (besides HTML) as well as much detail.
A Debian Voodoo3 How-to aimed at, well, Debian
users who want to get their Voodoo3 or Banshee running.
Another Q3T Linux How-to breif, but has some good stuff.
The Lm-sensors project has some support for the BT869 video (TV) out at 640x480 and 800x600
resolutions (both NTSC and PAL).
Quake3Tool is a Java program I wrote to send remote connection commands ('rcon's) to a Quake
server over the internet to control it. It can also be used to query a server to gather information on what level is being
played, how may people are connected, etc.
xscreensaver is a screensaver package with some OpenGL (Mesa + Glide compatibile)
screensavers. There are also some neat non-GL ones like 'xmatrix' (the 'static' seen on the monitors in the movie "The Matrix").
3Dfx + Mesa Demos is a collection of demos and Mesa programs which the
author of the Glide interface for Mesa thought was interesting. The particle system package is quite fun (but requires some tweaking.
LinuxQuake web site is a popular site. This page has been known to have been linked
from there.
S'Cary's Shuga Shack is a good site, particularly the message board area for Q3T and Q3T
for Linux.
The (new) Quake 3 Arena site from Id, of course, is a good place to visit.
What to do when things go wrong:
Panic. Scream. Run naked in the streets. Then when you are done with those things, don't bother continuing
to get something farther down the list working if you run into something which doesn't work. E.g., if Glide
tests don't work, don't bother trying to get Mesa+Glide working.
Try to read as much of the docs you can for the software you failed to get working, and try to fix it. A good resource is the
3dfx.glide.linux newsgroup at news.3dfx.com. If you can't figure out your problem, first *read* the other posts, then if you can't
find your answer, post a message to 3dfx.glide.linux giving your errors and what you tried to do.
I got everything working, including q3test, from the steps above. I'm using a Voodoo3 3000 AGP on a 440GX dual
PentII Linux box running kernel 2.2.7+SMP with gcc version 2.8.1.
Visit Chickenhead:
Copyright by Philip Edelbrock, 1999. Please send corrections and comments to me at phil@netroedge.com.
300 +